From 6ec744fdc2bd2e6b8384676382a8b0908b68de40 Mon Sep 17 00:00:00 2001 From: Niclas Finne Date: Thu, 13 Apr 2017 01:27:06 +0200 Subject: [PATCH] Made the Sparrow Makefile use MODULES to include source files in the build whenever possible. This avoids including some source files when they are not needed. --- Makefile.include | 9 ++++----- Makefile.sparrow | 4 ---- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/Makefile.include b/Makefile.include index 26fd34a..1aa6339 100644 --- a/Makefile.include +++ b/Makefile.include @@ -68,7 +68,7 @@ TARGET_BOARD_UPPERCASE := ${strip ${shell echo $(BOARD) | sed y!$(LOWERCASE)!$(U CFLAGS += -DCONTIKI_BOARD_$(TARGET_BOARD_UPPERCASE)=1 endif -MODULES += core/sys core/dev core/lib +MODULES += core core/sys core/dev core/lib # Include IPv6, IPv4, and/or Rime @@ -109,8 +109,7 @@ endif CONTIKI_SOURCEFILES += $(CONTIKIFILES) -CONTIKIDIRS += ${addprefix $(CONTIKI)/core/,dev lib net net/llsec net/mac net/rime \ - net/rpl sys cfs ctk lib/ctk loader . } +CONTIKIDIRS += ${addprefix $(CONTIKI)/core/,cfs loader} oname = ${patsubst %.c,%.o,${patsubst %.S,%.o,$(1)}} @@ -156,9 +155,9 @@ endif ifdef MODULES UNIQUEMODULES = $(call uniq,$(MODULES)) - MODULEDIRS = ${wildcard ${addprefix $(CONTIKI)/, $(UNIQUEMODULES)}} + MODULEDIRS = ${wildcard ${addprefix $(SPARROW)/, $(UNIQUEMODULES)} ${addprefix $(CONTIKI)/, $(UNIQUEMODULES)}} MODULES_SOURCES = ${foreach d, $(MODULEDIRS), ${subst ${d}/,,${wildcard $(d)/*.c}}} - CONTIKI_SOURCEFILES += $(MODULES_SOURCES) + CONTIKI_SOURCEFILES += $(call uniq,$(MODULES_SOURCES)) APPDS += $(MODULEDIRS) endif diff --git a/Makefile.sparrow b/Makefile.sparrow index 8c9f1f6..04be3a2 100644 --- a/Makefile.sparrow +++ b/Makefile.sparrow @@ -8,10 +8,6 @@ endif SPARROW_TOOLS=$(SPARROW)/tools/sparrow -SPARROWDIRS += $(SPARROW)/core ${addprefix $(SPARROW)/core/,dev net net/ip net/ipv6 net/rpl net/mac net/mac/tsch sys lib} -CONTIKIDIRS += $(SPARROWDIRS) -CONTIKI_SOURCEFILES += ${notdir ${wildcard ${addsuffix /*.c,$(SPARROWDIRS)}}} - APPDIRS += $(SPARROW)/apps TARGETDIRS += $(SPARROW)/platform