The feature set of gnumake is really frightening: This time I discovered 'target-specific variable values'...

This commit is contained in:
oliverschmidt 2008-05-26 11:26:57 +00:00
parent f74503c23c
commit 2ede893aa6

View file

@ -30,21 +30,14 @@
# #
# Author: Oliver Schmidt <ol.sc@web.de> # Author: Oliver Schmidt <ol.sc@web.de>
# #
# $Id: Makefile.apple2enh,v 1.6 2008/05/26 10:13:32 oliverschmidt Exp $ # $Id: Makefile.apple2enh,v 1.7 2008/05/26 11:26:57 oliverschmidt Exp $
# #
CONTIKI_SOURCEFILES += log-asm.S pfs.S CONTIKI_SOURCEFILES += log-asm.S pfs.S
HIGHCODE_SOURCEFILES = process.c etimer.c uip_arp.c HIGHCODE_SOURCEFILES = process.c etimer.c uip_arp.c
define highcode_template # Set a target-specific variable value
$(OBJECTDIR)/$(1:.c=.o): $(1) ${addprefix $(OBJECTDIR)/,${call oname, $(HIGHCODE_SOURCEFILES)}}: CFLAGS += --code-name HIGHCODE
$$(CC) --code-name HIGHCODE $$(CFLAGS) --create-dep $$< -o $$(@:.o=.s)
@$$(AS) $$(ASFLAGS) $$(@:.o=.s) -o $$@
@sed 's!.s:!.o:!' < $$(@:.o=.u) > $$(@:.o=.d)
@rm -f $$(@:.o=.s) $$(@:.o=.u)
endef
${foreach OBJECT,$(HIGHCODE_SOURCEFILES),${eval ${call highcode_template,$(OBJECT)}}}
CONTIKI_CPU = $(CONTIKI)/cpu/6502 CONTIKI_CPU = $(CONTIKI)/cpu/6502
include $(CONTIKI_CPU)/Makefile.6502 include $(CONTIKI_CPU)/Makefile.6502