summaryrefslogtreecommitdiff
path: root/n/avr/make/Makefile.gen
diff options
context:
space:
mode:
authorschodet2005-06-26 23:31:42 +0000
committerschodet2005-06-26 23:31:42 +0000
commitd237184f11ebdf3147e03bd297f16797a8e990ca (patch)
tree65e5e0524472370756b6f6a8245728ecbab2024b /n/avr/make/Makefile.gen
parent21356146e4d51bdcc5d409fa167bd84af6b0c706 (diff)
Ajout du Makefile pour les modules AVR.
Diffstat (limited to 'n/avr/make/Makefile.gen')
-rw-r--r--n/avr/make/Makefile.gen58
1 files changed, 58 insertions, 0 deletions
diff --git a/n/avr/make/Makefile.gen b/n/avr/make/Makefile.gen
new file mode 100644
index 0000000..d6fdcca
--- /dev/null
+++ b/n/avr/make/Makefile.gen
@@ -0,0 +1,58 @@
+# Makefile.gen - General Makefile.
+
+# Flags {{{1
+
+INCLUDES = -Imodules
+OPTIMIZE =
+CFLAGS = -g -Wall $(OPTIMIZE)
+DEFS =
+CPPFLAGS = $(DEFS) $(INCLUDES) -MMD \
+ $(if $(CONFIGFILE),$(CONFIGFILE:%=-include %))
+LDFLAGS =
+
+# Main rules. {{{1
+
+all: avr host
+
+.PHONY: all clean doc
+
+# General rules. {{{1
+
+SOURCES = $(foreach prog,$(PROGS),$($(prog)_SOURCES))
+
+ifneq (,$(filter-out %.c,$(SOURCES)))
+$(error Sources should be c files)
+endif
+
+# Modules. {{{1
+
+include $(MODULES:%=$(BASE)/modules/%/Makefile.module)
+
+define MODULES_template
+$(1)_SOURCES += $(foreach module,$(MODULES),$($(module)_SOURCES))
+endef
+
+$(foreach prog,$(PROGS),$(eval $(call MODULES_template,$(prog))))
+
+vpath %.c $(MODULES:%=$(BASE)/modules/%)
+
+# Include other Makefiles. {{{1
+
+include $(BASE)/make/Makefile.avr
+include $(BASE)/make/Makefile.host
+
+# Rules for building the doc. {{{1
+
+doc: $(DOC)
+
+%.html: %.txt %.exd
+ aft $<
+
+%.exd: $(EXTRACTDOC)
+ test -n "$^" && extractdoc $^ > $@ || true
+
+# Cleanning. {{{1
+
+clean: clean.avr clean.host
+ rm -f *.bak *~ $(DOC) *.exd $(EXTRA_CLEAN_FILES)
+