Move target identification code to a separate file
For some cross-platform examples, we need to tweak things based on the target platform. For this reason, target identification needs to happen early, before inclusion of the top-level Makefile.include. Up to now, we have simply replicated the target-identification code to example Makefiles, leading to code-replication and on occasion bugs (incorrect platform identification). This commits moves the correct working code to a separate file, so that example Makefiles can include this "as a library". The top-level Makefile merely includes this file now.
This commit is contained in:
parent
5e2f79a6c2
commit
e73edfaa60
9
Makefile.identify-target
Normal file
9
Makefile.identify-target
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
ifeq ($(TARGET),)
|
||||||
|
-include Makefile.target
|
||||||
|
ifeq ($(TARGET),)
|
||||||
|
${info TARGET not defined, using target 'native'}
|
||||||
|
TARGET=native
|
||||||
|
else
|
||||||
|
${info using saved target '$(TARGET)'}
|
||||||
|
endif
|
||||||
|
endif
|
@ -8,15 +8,7 @@ endif
|
|||||||
# Setting this option is also important for tests on Cooja motes to check for warnings.
|
# Setting this option is also important for tests on Cooja motes to check for warnings.
|
||||||
WERROR ?= 1
|
WERROR ?= 1
|
||||||
|
|
||||||
ifeq ($(TARGET),)
|
include $(CONTIKI)/Makefile.identify-target
|
||||||
-include Makefile.target
|
|
||||||
ifeq ($(TARGET),)
|
|
||||||
${info TARGET not defined, using target 'native'}
|
|
||||||
TARGET=native
|
|
||||||
else
|
|
||||||
${info using saved target '$(TARGET)'}
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(DEFINES),)
|
ifeq ($(DEFINES),)
|
||||||
-include Makefile.$(TARGET).defines
|
-include Makefile.$(TARGET).defines
|
||||||
|
Loading…
Reference in New Issue
Block a user