Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » eclipse script runing problem(runing a component.mk file when compiling the program.)
eclipse script runing problem [message #1817907] Mon, 02 December 2019 23:19 Go to next message
Zakaria Taleb Bendiab is currently offline Zakaria Taleb BendiabFriend
Messages: 2
Registered: November 2019
Junior Member
hello

i am working on an ESP32 program using eclipse and ESP-IDF.

i have a file named component.mk which contains a script that create a heder for keys to connect to AWS platform.

here is the script form:

COMPONENT_EXTRA_CLEAN := certs.h

main.o: certs.h

certs.h: $(COMPONENT_PATH)/certs/root-CA.crt $(COMPONENT_PATH)/certs/certificate.pem.crt $(COMPONENT_PATH)/certs/private.pem.key
$(Q) rm -f certs.h
$(Q) echo "const char *rootCA =" >> certs.h
$(Q) cat $(COMPONENT_PATH)/certs/root-CA.crt | tr -d "\r" | awk '{ print "\""$$0"\\r\\n\""}' >> certs.h
$(Q) echo ";" >> certs.h
$(Q) echo "const char *devicePrivateKey =" >> certs.h
$(Q) cat $(COMPONENT_PATH)/certs/private.pem.key | tr -d "\r" | awk '{ print "\""$$0"\\r\\n\""}' >> certs.h
$(Q) echo ";" >> certs.h
$(Q) echo "const char *deviceCert =" >> certs.h
$(Q) cat $(COMPONENT_PATH)/certs/certificate.pem.crt | tr -d "\r" | awk '{ print "\""$$0"\\r\\n\""}' >> certs.h
$(Q) echo ";" >> certs.h

is there a maner to run this script while compiling the program.

regards.

Zakaria.
Re: eclipse script runing problem [message #1817989 is a reply to message #1817907] Tue, 03 December 2019 23:33 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
The script should be run by make.
Put it somewhere and run in a terminal window.
make -f component.mk

Be aware that it requires at least COMPONENT_PATH to be defined.
Apparently to the base directory containing the .crt and .key files.

You could include it in your build makefile but only if your project is a Makefile project.
Meaning you control the makefile.
Re: eclipse script runing problem [message #1818020 is a reply to message #1817907] Wed, 04 December 2019 10:18 Go to previous message
Zakaria Taleb Bendiab is currently offline Zakaria Taleb BendiabFriend
Messages: 2
Registered: November 2019
Junior Member
hello David

thanks for the help.

i managed to run it with make.

regards.

Zakaria
Previous Topic:How to use CDT to create a .h with a class decl?
Next Topic: How to open/import Arduino IDE's into Eclipse
Goto Forum:
  


Current Time: Sat Apr 27 01:40:23 GMT 2024

Powered by FUDForum. Page generated in 0.03694 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top