summaryrefslogtreecommitdiff
path: root/n/avr/make/Makefile.gen
diff options
context:
space:
mode:
Diffstat (limited to 'n/avr/make/Makefile.gen')
-rw-r--r--n/avr/make/Makefile.gen11
1 files changed, 7 insertions, 4 deletions
diff --git a/n/avr/make/Makefile.gen b/n/avr/make/Makefile.gen
index baa18d0..7e34c2b 100644
--- a/n/avr/make/Makefile.gen
+++ b/n/avr/make/Makefile.gen
@@ -17,19 +17,22 @@ all: avr host
# General rules. {{{1
-SOURCES = $(foreach prog,$(PROGS),$($(prog)_SOURCES))
+ALL_PROGS = $(PROGS) $(AVR_PROGS) $(HOST_PROGS)
+SOURCES = $(foreach prog,$(ALL_PROGS),$($(prog)_SOURCES))
# Modules. {{{1
+MODULES += host
+
ifneq (,$(MODULES))
include $(MODULES:%=$(BASE)/modules/%/Makefile.module)
endif
define MODULES_template
-$(1)_SOURCES += $(foreach module,$(MODULES),$($(module)_SOURCES))
+$(1)_SOURCES += $(foreach module,$(MODULES),$($(subst /,_,$(module))_SOURCES))
endef
-$(foreach prog,$(PROGS),$(eval $(call MODULES_template,$(prog))))
+$(foreach prog,$(ALL_PROGS),$(eval $(call MODULES_template,$(prog))))
vpath %.c $(MODULES:%=$(BASE)/modules/%)
@@ -57,7 +60,7 @@ ifneq (,$(filter-out %.c,$(SOURCES)))
$(error Sources should be c files)
endif
-ifneq (,$(PROGS))
+ifneq (,$(ALL_PROGS))
include $(BASE)/make/Makefile.avr
include $(BASE)/make/Makefile.host
else