summaryrefslogtreecommitdiff
path: root/n/avr/make/Makefile.avr
diff options
context:
space:
mode:
authorschodet2005-08-02 21:14:07 +0000
committerschodet2005-08-02 21:14:07 +0000
commit98694a3cab902c3ef3d1bdab941980ed6c94d67d (patch)
tree99527827d8a05b7650490ca0bb8dbf9530e5e908 /n/avr/make/Makefile.avr
parent3993c01f8c9ed6647eb22fc2a3a49c9a519474a4 (diff)
Ajout du support des fichiers asm.
Diffstat (limited to 'n/avr/make/Makefile.avr')
-rw-r--r--n/avr/make/Makefile.avr12
1 files changed, 10 insertions, 2 deletions
diff --git a/n/avr/make/Makefile.avr b/n/avr/make/Makefile.avr
index 8485324..8f8030d 100644
--- a/n/avr/make/Makefile.avr
+++ b/n/avr/make/Makefile.avr
@@ -3,6 +3,7 @@
# Flags.
AVR_CFLAGS = $(CFLAGS) -mmcu=$(AVR_MCU)
+AVR_ASFLAGS = $(ASFLAGS) -mmcu=$(AVR_MCU)
AVR_CPPFLAGS = $(CPPFLAGS) $(AVR_DEFS)
AVR_LDFLAGS = $(LDFLAGS)
AVR_LDLIBS = $(LDLIBS) $(AVR_LIBS)
@@ -11,6 +12,7 @@ AVR_CC = avr-gcc
AVR_OBJCOPY = avr-objcopy
AVR_OBJDUMP = avr-objdump
AVR_COMPILE.c = $(AVR_CC) $(AVR_CFLAGS) $(AVR_CPPFLAGS) -c
+AVR_COMPILE.S = $(AVR_CC) $(AVR_ASFLAGS) $(AVR_CPPFLAGS) -c
AVR_LINK.o = $(AVR_CC) $(AVR_CFLAGS) $(AVR_LDFLAGS)
# Main rules.
@@ -24,13 +26,16 @@ avr: elf lst hex
AVR_PROGS += $(PROGS)
AVR_ELFS = $(AVR_PROGS:%=%.avr.elf)
AVR_SOURCES = $(filter-out %.host.c,$(SOURCES))
-AVR_OBJECTS = $(AVR_SOURCES:%.c=%.avr.o)
+AVR_C_SOURCES = $(filter %.c,$(AVR_SOURCES))
+AVR_S_SOURCES = $(filter %.S,$(AVR_SOURCES))
+AVR_OBJECTS = $(AVR_C_SOURCES:%.c=%.avr.o) $(AVR_S_SOURCES:%.S=%.avr.o)
elf: $(AVR_ELFS)
lst: $(AVR_PROGS:%=%.avr.lst)
define AVR_PROG_template
-$(1).avr.elf: $$(patsubst %.c,%.avr.o,$$(filter-out %.host.c,$$($(1)_SOURCES)))
+$(1).avr.elf: $$(patsubst %.S,%.avr.o,$$(patsubst %.c,%.avr.o,\
+ $$(filter-out %.host.c,$$($(1)_SOURCES))))
endef
$(foreach prog,$(AVR_PROGS),$(eval $(call AVR_PROG_template,$(prog))))
@@ -44,6 +49,9 @@ $(AVR_ELFS):
%.avr.o: %.c
$(AVR_COMPILE.c) -o $@ $<
+%.avr.o: %.S
+ $(AVR_COMPILE.S) -o $@ $<
+
# Dependency checking.
-include $(AVR_OBJECTS:%.avr.o=%.avr.d)