Skip to content

Commit

Permalink
Moved the 6502 custom rules into its own Makefile.customrules-6502 file
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdunkels committed Jan 26, 2014
1 parent cf32063 commit 36a5aad
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 27 deletions.
29 changes: 2 additions & 27 deletions cpu/6502/Makefile.6502
Expand Up @@ -68,30 +68,5 @@ CFLAGS += -t $(TARGET) -Or -W -unused-param,-unused-var,-const-comparison
LDFLAGS = $(STARTADDR_FLAG) -t $(TARGET) -m contiki-$(TARGET).map -D __STACKSIZE__=0x200
AROPTS = a

### Compilation rules

.SUFFIXES:

CUSTOM_RULE_C_TO_OBJECTDIR_O = 1
$(OBJECTDIR)/%.o: %.c | $(OBJECTDIR)
$(TRACE_CC)
$(Q)$(CC) -c -o $@ $(CFLAGS) --create-dep $(@:.o=.d) $<

CUSTOM_RULE_C_TO_CO = 1
%.co: %.c
$(TRACE_CC)
$(Q)$(CC) -c -o $@ $(CFLAGS) -DAUTOSTART_ENABLE --create-dep $(@:.o=.d) $<

CUSTOM_RULE_LINK = 1
%.$(TARGET): %.co $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) contiki-$(TARGET).a
$(TRACE_LD)
$(Q)$(LD) -o $@ $(LDFLAGS) -u _main $^ $(TARGET).lib

%.eth: $(OBJECTDIR)/%.o
$(TRACE_LD)
$(Q)$(LD) -o $@ -t module -m $@.map $<

ifdef ETHERNET
$(ETHERNET)-eth.S: $(ETHERNET).eth
co65 -o $@ --code-label _$(ETHERNET) $<
endif
## Default modules
MODULES += core/net/ipv4
27 changes: 27 additions & 0 deletions cpu/6502/Makefile.customrules-6502
@@ -0,0 +1,27 @@
### Compilation rules

.SUFFIXES:

CUSTOM_RULE_C_TO_OBJECTDIR_O = 1
$(OBJECTDIR)/%.o: %.c | $(OBJECTDIR)
$(TRACE_CC)
$(Q)$(CC) -c -o $@ $(CFLAGS) --create-dep $(@:.o=.d) $<

CUSTOM_RULE_C_TO_CO = 1
%.co: %.c
$(TRACE_CC)
$(Q)$(CC) -c -o $@ $(CFLAGS) -DAUTOSTART_ENABLE --create-dep $(@:.o=.d) $<

CUSTOM_RULE_LINK = 1
%.$(TARGET): %.co $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) contiki-$(TARGET).a
$(TRACE_LD)
$(Q)$(LD) -o $@ $(LDFLAGS) -u _main $^ $(TARGET).lib

%.eth: $(OBJECTDIR)/%.o
$(TRACE_LD)
$(Q)$(LD) -o $@ -t module -m $@.map $<

ifdef ETHERNET
$(ETHERNET)-eth.S: $(ETHERNET).eth
co65 -o $@ --code-label _$(ETHERNET) $<
endif
1 change: 1 addition & 0 deletions platform/apple2enh/Makefile.customrules-apple2enh
@@ -0,0 +1 @@
include $(CONTIKI_CPU)/Makefile.customrules-6502
1 change: 1 addition & 0 deletions platform/atarixl/Makefile.customrules-atarixl
@@ -0,0 +1 @@
include $(CONTIKI_CPU)/Makefile.customrules-6502
1 change: 1 addition & 0 deletions platform/c128/Makefile.customrules-c128
@@ -0,0 +1 @@
include $(CONTIKI_CPU)/Makefile.customrules-6502
1 change: 1 addition & 0 deletions platform/c64/Makefile.customrules-c64
@@ -0,0 +1 @@
include $(CONTIKI_CPU)/Makefile.customrules-6502

0 comments on commit 36a5aad

Please sign in to comment.