Merge pull request #122 from g-oikonomou/contrib/target-identification

Move target identification code to separate Makefile
This commit is contained in:
Simon Duquennoy 2017-10-30 09:30:17 +01:00 committed by GitHub
commit 0ce1657653
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 17 deletions

9
Makefile.identify-target Normal file
View 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

View File

@ -8,15 +8,7 @@ endif
# Setting this option is also important for tests on Cooja motes to check for warnings.
WERROR ?= 1
ifeq ($(TARGET),)
-include Makefile.target
ifeq ($(TARGET),)
${info TARGET not defined, using target 'native'}
TARGET=native
else
${info using saved target '$(TARGET)'}
endif
endif
include $(CONTIKI)/Makefile.identify-target
ifeq ($(DEFINES),)
-include Makefile.$(TARGET).defines

View File

@ -1,15 +1,10 @@
CONTIKI_PROJECT = sensniff
CONTIKI = ../..
PROJECT_SOURCEFILES += sensniff-mac.c netstack.c
PROJECTDIRS += pool $(TARGET)
ifeq ($(TARGET),)
-include Makefile.target
ifeq ($(TARGET),)
TARGET=srf06-cc26xx
$(info TARGET not defined, using target $(TARGET))
endif
endif
-include $(CONTIKI)/Makefile.identify-target
### Optionally, the target can add its own Makefile, to do things like e.g.
### add more source files to the build or define make variables.
@ -19,7 +14,6 @@ all: $(CONTIKI_PROJECT)
# use a custom MAC driver: sensniff_mac_driver
MAKE_MAC = MAKE_MAC_OTHER
CONTIKI = ../..
include $(CONTIKI)/Makefile.include
PYTHON ?= python