moved the MAKE_NET code in makefile include so that platform makefiles are before decisions
This commit is contained in:
parent
1143d6f5aa
commit
5d87cd1b5f
|
@ -79,6 +79,34 @@ ifneq ("$(wildcard project-conf.h)","")
|
||||||
CFLAGS += -DPROJECT_CONF_PATH=\"project-conf.h\"
|
CFLAGS += -DPROJECT_CONF_PATH=\"project-conf.h\"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
MODULES += os os/net os/net/mac os/storage
|
||||||
|
|
||||||
|
oname = ${patsubst %.c,%.o,${patsubst %.S,%.o,$(1)}}
|
||||||
|
|
||||||
|
CONTIKI_OBJECTFILES = ${addprefix $(OBJECTDIR)/,${call oname, $(CONTIKI_SOURCEFILES)}}
|
||||||
|
|
||||||
|
PROJECT_OBJECTFILES = ${addprefix $(OBJECTDIR)/,${call oname, $(PROJECT_SOURCEFILES)}}
|
||||||
|
|
||||||
|
# Provide way to create $(OBJECTDIR) if it has been removed by make clean
|
||||||
|
$(OBJECTDIR):
|
||||||
|
mkdir $@
|
||||||
|
|
||||||
|
uniq = $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1)))
|
||||||
|
|
||||||
|
### Include target makefile (TODO Unsafe?)
|
||||||
|
|
||||||
|
target_makefile := $(wildcard $(CONTIKI)/arch/platform/$(TARGET)/Makefile.$(TARGET) ${foreach TDIR, $(TARGETDIRS), $(TDIR)/$(TARGET)/Makefile.$(TARGET)})
|
||||||
|
|
||||||
|
# Check if the target makefile exists, and create the object directory if necessary.
|
||||||
|
ifeq ($(strip $(target_makefile)),)
|
||||||
|
${error The target platform "$(TARGET)" does not exist (maybe it was misspelled?)}
|
||||||
|
else
|
||||||
|
ifneq (1, ${words $(target_makefile)})
|
||||||
|
${error More than one TARGET Makefile found: $(target_makefile)}
|
||||||
|
endif
|
||||||
|
include $(target_makefile)
|
||||||
|
endif
|
||||||
|
|
||||||
# Configure MAC layer
|
# Configure MAC layer
|
||||||
|
|
||||||
# The different options
|
# The different options
|
||||||
|
@ -91,6 +119,7 @@ MAKE_MAC_OTHER = 3
|
||||||
MAKE_MAC ?= MAKE_MAC_CSMA
|
MAKE_MAC ?= MAKE_MAC_CSMA
|
||||||
|
|
||||||
ifeq ($(MAKE_MAC),MAKE_MAC_NULLMAC)
|
ifeq ($(MAKE_MAC),MAKE_MAC_NULLMAC)
|
||||||
|
MODULES+=os/net/mac/nullmac
|
||||||
CFLAGS += -DMAC_CONF_WITH_NULLMAC=1
|
CFLAGS += -DMAC_CONF_WITH_NULLMAC=1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -147,34 +176,6 @@ else
|
||||||
CFLAGS += -DUIP_CONF_IPV6_RPL=0
|
CFLAGS += -DUIP_CONF_IPV6_RPL=0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
MODULES += os os/net os/net/mac os/storage
|
|
||||||
|
|
||||||
oname = ${patsubst %.c,%.o,${patsubst %.S,%.o,$(1)}}
|
|
||||||
|
|
||||||
CONTIKI_OBJECTFILES = ${addprefix $(OBJECTDIR)/,${call oname, $(CONTIKI_SOURCEFILES)}}
|
|
||||||
|
|
||||||
PROJECT_OBJECTFILES = ${addprefix $(OBJECTDIR)/,${call oname, $(PROJECT_SOURCEFILES)}}
|
|
||||||
|
|
||||||
# Provide way to create $(OBJECTDIR) if it has been removed by make clean
|
|
||||||
$(OBJECTDIR):
|
|
||||||
mkdir $@
|
|
||||||
|
|
||||||
uniq = $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1)))
|
|
||||||
|
|
||||||
### Include target makefile (TODO Unsafe?)
|
|
||||||
|
|
||||||
target_makefile := $(wildcard $(CONTIKI)/arch/platform/$(TARGET)/Makefile.$(TARGET) ${foreach TDIR, $(TARGETDIRS), $(TDIR)/$(TARGET)/Makefile.$(TARGET)})
|
|
||||||
|
|
||||||
# Check if the target makefile exists, and create the object directory if necessary.
|
|
||||||
ifeq ($(strip $(target_makefile)),)
|
|
||||||
${error The target platform "$(TARGET)" does not exist (maybe it was misspelled?)}
|
|
||||||
else
|
|
||||||
ifneq (1, ${words $(target_makefile)})
|
|
||||||
${error More than one TARGET Makefile found: $(target_makefile)}
|
|
||||||
endif
|
|
||||||
include $(target_makefile)
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(WITH_IP64),1)
|
ifeq ($(WITH_IP64),1)
|
||||||
MODULES += os/services/ip64
|
MODULES += os/services/ip64
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -50,14 +50,9 @@ endif
|
||||||
|
|
||||||
### Banking Guesswork:
|
### Banking Guesswork:
|
||||||
### Generic examples do not specify banking.
|
### Generic examples do not specify banking.
|
||||||
### We automatically turn it on if its unspecified and if we are building with
|
### We automatically turn it on if its unspecified.
|
||||||
### MAKE_NET_IPV6
|
|
||||||
ifndef HAVE_BANKING
|
ifndef HAVE_BANKING
|
||||||
ifeq ($(MAKE_NET),MAKE_NET_IPV6)
|
|
||||||
HAVE_BANKING=1
|
HAVE_BANKING=1
|
||||||
else
|
|
||||||
HAVE_BANKING=0
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
### Does the project want us to offset the firmware?
|
### Does the project want us to offset the firmware?
|
||||||
|
|
|
@ -11,6 +11,7 @@ ifeq ($(NRF52_JLINK_PATH),)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
MAKE_NET ?= MAKE_NET_IPV6
|
||||||
ifneq ($(MAKE_NET),MAKE_NET_IPV6)
|
ifneq ($(MAKE_NET),MAKE_NET_IPV6)
|
||||||
$(error Only IPv6 stack is supported!)
|
$(error Only IPv6 stack is supported!)
|
||||||
endif
|
endif
|
||||||
|
|
Loading…
Reference in New Issue