mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-20 10:54:14 +01:00
Detect of quotes are needed and use quotes in echo-commands while generating InitMods.c
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@723 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
3edd28e60b
commit
ef73edfd0d
@ -461,6 +461,7 @@ REMOVE = $(REMOVE_CMD) -f
|
||||
###COPY = cp
|
||||
|
||||
|
||||
|
||||
# Define Messages
|
||||
# English
|
||||
MSG_ERRORS_NONE = Errors: none
|
||||
@ -521,14 +522,21 @@ endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# Test if quotes are needed for the echo-command
|
||||
result = ${shell echo "test"}
|
||||
ifeq (${result}, test)
|
||||
quote = '
|
||||
else
|
||||
quote =
|
||||
endif
|
||||
|
||||
${OUTDIR}/InitMods.c: Makefile
|
||||
@echo ${MSG_MODINIT}
|
||||
@echo // Autogenerated file > ${OUTDIR}/InitMods.c
|
||||
@echo ${foreach MOD, ${MODNAMES}, extern unsigned int ${MOD}Initialize(void);} >> ${OUTDIR}/InitMods.c
|
||||
@echo void InitModules() { >> ${OUTDIR}/InitMods.c
|
||||
@echo ${foreach MOD, ${MODNAMES}, ${MOD}Initialize();} >> ${OUTDIR}/InitMods.c
|
||||
@echo } >> ${OUTDIR}/InitMods.c
|
||||
@echo ${quote}${MSG_MODINIT}${quote}
|
||||
@echo ${quote}// Autogenerated file${quote} > ${OUTDIR}/InitMods.c
|
||||
@echo ${quote}${foreach MOD, ${MODNAMES}, extern unsigned int ${MOD}Initialize(void);}${quote} >> ${OUTDIR}/InitMods.c
|
||||
@echo ${quote}void InitModules() {${quote} >> ${OUTDIR}/InitMods.c
|
||||
@echo ${quote}${foreach MOD, ${MODNAMES}, ${MOD}Initialize();}${quote} >> ${OUTDIR}/InitMods.c
|
||||
@echo ${quote}}${quote} >> ${OUTDIR}/InitMods.c
|
||||
|
||||
# Eye candy.
|
||||
begin:
|
||||
|
Loading…
x
Reference in New Issue
Block a user