From 0492a96051eebf99e9d87ece3052def8452dddf9 Mon Sep 17 00:00:00 2001 From: schodet Date: Sun, 18 Jul 2004 21:10:29 +0000 Subject: Nouveau système de modules. --- n/avr/howto/Makefile | 1 + n/avr/howto/Makefile.avr | 13 +++++-------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/n/avr/howto/Makefile b/n/avr/howto/Makefile index 2ac6571..25dfd1a 100644 --- a/n/avr/howto/Makefile +++ b/n/avr/howto/Makefile @@ -3,6 +3,7 @@ SOURCES = example.c DOC = howto-avr.html EXTRACTDOC = MODULES = +CONFIGFILE = # atmega8, atmega8535, atmega128... MCU_TARGET = atmega8 # -O2 : speed diff --git a/n/avr/howto/Makefile.avr b/n/avr/howto/Makefile.avr index d1411f4..01c9b7b 100644 --- a/n/avr/howto/Makefile.avr +++ b/n/avr/howto/Makefile.avr @@ -2,7 +2,8 @@ CC = avr-gcc -CFLAGS = -g -Wall $(OPTIMIZE) -mmcu=$(MCU_TARGET) +CFLAGS = -g -Wall $(OPTIMIZE) -mmcu=$(MCU_TARGET) \ + $(if $(CONFIGFILE), $(CONFIGFILE:%=-include %)) CPPFLAGS = $(DEFS) -Imodules LDFLAGS = @@ -22,19 +23,15 @@ all: elf lst hex # Rules for modules. {{{1 -MODULESFILES = $(MODULES:%=modules/%/Module) +MODULESFILES = $(MODULES:%=modules/%/Makefile.module) -Makefile: $(MODULESFILES) +include $(MODULESFILES) -MODULESOURCES = $(addprefix modules/$(module)/,\ - $(shell cat modules/$(module)/Module)) -MODULESSOURCES := $(if $(MODULES),\ - $(foreach module,$(MODULES),$(MODULESOURCES))) SOURCES += $(MODULESSOURCES) $(MODULESFILES): mkdir -p modules - cd modules && cvs co $(@:modules/%/Module=%) + cd modules && cvs co $(@:modules/%/Makefile.module=%) test -f $@ # General rules. {{{1 -- cgit v1.2.3