1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

Remove the need ot have two ways of listing the modules for simulation

This commit is contained in:
James Cotton 2012-03-11 18:30:19 -05:00
parent 76bdd09795
commit cb7b475d03

View File

@ -57,11 +57,8 @@ MODULES = Telemetry Actuator ManualControl Stabilization
MODULES += Attitude/Revolution MODULES += Attitude/Revolution
#MODULES += SimulatedAttitude #MODULES += SimulatedAttitude
MOD_GEN = Telemetry Actuator ManualControl Stabilization Attitude
# To run simulation instead of connect to SITL # To run simulation instead of connect to SITL
MODULES += Sensors/Simulated MODULES += Sensors/Simulated
MOD_GEN += Sensors
# MCU name, submodel and board # MCU name, submodel and board
# - MCU used for compiler-option (-mtune) # - MCU used for compiler-option (-mtune)
@ -439,8 +436,12 @@ endif
# Generate intermediate code # Generate intermediate code
gencode: ${OUTDIR}/InitMods.c ${OUTDIR}/pmlib_img.c ${OUTDIR}/pmlib_nat.c ${OUTDIR}/pmlibusr_img.c ${OUTDIR}/pmlibusr_nat.c ${OUTDIR}/pmfeatures.h gencode: ${OUTDIR}/InitMods.c ${OUTDIR}/pmlib_img.c ${OUTDIR}/pmlib_nat.c ${OUTDIR}/pmlibusr_img.c ${OUTDIR}/pmlibusr_nat.c ${OUTDIR}/pmfeatures.h
# Remove any words after a slash (for module variants)
MOD_GEN = ${foreach MOD, ${MODULES}, $(shell echo $(MOD) | sed 's/\([a-z,A-Z]*\).*/\1/')}
# Generate code for module initialization # Generate code for module initialization
${OUTDIR}/InitMods.c: Makefile.osx ${OUTDIR}/InitMods.c: Makefile.osx
echo ${MOD_GEN}
@echo ${MSG_MODINIT} @echo ${MSG_MODINIT}
@echo ${quote}// Autogenerated file${quote} > ${OUTDIR}/InitMods.c @echo ${quote}// Autogenerated file${quote} > ${OUTDIR}/InitMods.c
@echo ${quote}${foreach MOD, ${MOD_GEN}, extern unsigned int ${MOD}Initialize(void);}${quote} >> ${OUTDIR}/InitMods.c @echo ${quote}${foreach MOD, ${MOD_GEN}, extern unsigned int ${MOD}Initialize(void);}${quote} >> ${OUTDIR}/InitMods.c