From cb7b475d03b729b73744708e269c523f2008e1c0 Mon Sep 17 00:00:00 2001 From: James Cotton Date: Sun, 11 Mar 2012 18:30:19 -0500 Subject: [PATCH] Remove the need ot have two ways of listing the modules for simulation --- flight/Revolution/Makefile.osx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/flight/Revolution/Makefile.osx b/flight/Revolution/Makefile.osx index db04abe23..9a0522049 100644 --- a/flight/Revolution/Makefile.osx +++ b/flight/Revolution/Makefile.osx @@ -57,11 +57,8 @@ MODULES = Telemetry Actuator ManualControl Stabilization MODULES += Attitude/Revolution #MODULES += SimulatedAttitude -MOD_GEN = Telemetry Actuator ManualControl Stabilization Attitude - # To run simulation instead of connect to SITL MODULES += Sensors/Simulated -MOD_GEN += Sensors # MCU name, submodel and board # - MCU used for compiler-option (-mtune) @@ -439,8 +436,12 @@ endif # 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 +# 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 ${OUTDIR}/InitMods.c: Makefile.osx + echo ${MOD_GEN} @echo ${MSG_MODINIT} @echo ${quote}// Autogenerated file${quote} > ${OUTDIR}/InitMods.c @echo ${quote}${foreach MOD, ${MOD_GEN}, extern unsigned int ${MOD}Initialize(void);}${quote} >> ${OUTDIR}/InitMods.c