From d237184f11ebdf3147e03bd297f16797a8e990ca Mon Sep 17 00:00:00 2001 From: schodet Date: Sun, 26 Jun 2005 23:31:42 +0000 Subject: Ajout du Makefile pour les modules AVR. --- n/avr/make/Makefile.gen | 58 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 n/avr/make/Makefile.gen (limited to 'n/avr/make/Makefile.gen') 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) + -- cgit v1.2.3