diff --git a/Makefile.identify-target b/Makefile.identify-target new file mode 100644 index 000000000..7843fdf6a --- /dev/null +++ b/Makefile.identify-target @@ -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 diff --git a/Makefile.include b/Makefile.include index 7b503eabf..3b8c41605 100644 --- a/Makefile.include +++ b/Makefile.include @@ -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