[build] add case modifier to modules' makefile

- this allow to use lower and upper version of a makefile variable.
- can also be use to provide default value to some variables.
This commit is contained in:
Gautier Hattenberger
2016-02-10 18:05:43 +01:00
parent 15eb4e7550
commit 904507a4e6
38 changed files with 97 additions and 231 deletions
+6 -7
View File
@@ -21,15 +21,14 @@
<file name="gps.c" dir="subsystems"/>
<file name="gps_ubx.c" dir="subsystems/gps"/>
<define name="USE_GPS"/>
<configure name="GPS_PORT" case="upper|lower"/>
<define name="USE_$(GPS_PORT_UPPER)"/>
<define name="GPS_LINK" value="$(GPS_PORT_LOWER)"/>
<define name="$(GPS_PORT_UPPER)_BAUD" value="$(GPS_BAUD)"/>
<configure name="GPS_LED" value="none" default="TRUE"/>
<define name="GPS_LED" value="$(GPS_LED)" cond="ifneq ($(GPS_LED),none)"/>
<raw>
UBX_GPS_PORT_LOWER=$(shell echo $(GPS_PORT) | tr A-Z a-z)
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_ubx.h\"
ap.CFLAGS += -DUSE_$(GPS_PORT) -D$(GPS_PORT)_BAUD=$(GPS_BAUD)
ap.CFLAGS += -DUSE_GPS -DGPS_LINK=$(UBX_GPS_PORT_LOWER)
GPS_LED ?= none
ifneq ($(GPS_LED),none)
ap.CFLAGS += -DGPS_LED=$(GPS_LED)
endif
</raw>
</makefile>
<makefile target="nps">