First stab at implementing the MODULES mechanism

This commit is contained in:
Adam Dunkels 2013-11-22 09:46:11 +01:00
parent 5f3fe7f7c7
commit cf17bb441f

View file

@ -67,7 +67,7 @@ LIBS = memb.c mmem.c timer.c list.c etimer.c ctimer.c energest.c rtimer.c sti
print-stats.c ifft.c crc16.c random.c ringbuf.c settings.c print-stats.c ifft.c crc16.c random.c ringbuf.c settings.c
DEV = nullradio.c DEV = nullradio.c
include $(CONTIKI)/core/net/Makefile.uip #include $(CONTIKI)/core/net/Makefile.uip
include $(CONTIKI)/core/net/rpl/Makefile.rpl include $(CONTIKI)/core/net/rpl/Makefile.rpl
CTK = ctk.c CTK = ctk.c
@ -121,6 +121,16 @@ else
include $(target_makefile) include $(target_makefile)
endif endif
ifdef MODULES
MODULESSUBST = ${subst /,-,$(MODULES)}
MODULEDIRS = ${wildcard ${addprefix $(CONTIKI)/, $(MODULES)}}
MODULEINCLUDES = ${foreach m, $(MODULESSUBST), ${wildcard ${foreach d, $(MODULEDIRS), $(d)/Makefile.$(m)}}}
-include $(MODULEINCLUDES)
MODULES_SOURCES = ${foreach m, $(MODULESSUBST), $($(m)_src)}
CONTIKI_SOURCEFILES += $(MODULES_SOURCES)
APPDS += $(MODULEDIRS)
endif
ifdef PLATFORMAPPS ifdef PLATFORMAPPS
PLATFORMAPPDS = ${wildcard ${foreach DIR, $(APPDIRS), ${addprefix $(DIR)/, $(PLATFORMAPPS)}}} \ PLATFORMAPPDS = ${wildcard ${foreach DIR, $(APPDIRS), ${addprefix $(DIR)/, $(PLATFORMAPPS)}}} \
${wildcard ${addprefix $(CONTIKI)/apps/, $(PLATFORMAPPS)} \ ${wildcard ${addprefix $(CONTIKI)/apps/, $(PLATFORMAPPS)} \