Structured the cc65 makefile like all the other makefiles in the Contiki 2.x build system.
This commit is contained in:
parent
fe0e1fca17
commit
ec2411d5ea
|
@ -29,13 +29,9 @@
|
||||||
#
|
#
|
||||||
# Author: Oliver Schmidt <ol.sc@web.de>
|
# Author: Oliver Schmidt <ol.sc@web.de>
|
||||||
#
|
#
|
||||||
# $Id: Makefile.6502,v 1.5 2007/04/21 13:23:47 oliverschmidt Exp $
|
# $Id: Makefile.6502,v 1.6 2007/04/21 15:04:23 oliverschmidt Exp $
|
||||||
#
|
#
|
||||||
|
|
||||||
#######################
|
|
||||||
# General Definitions #
|
|
||||||
#######################
|
|
||||||
|
|
||||||
ifndef CONTIKI
|
ifndef CONTIKI
|
||||||
${error CONTIKI not defined! You must specify where CONTIKI resides!}
|
${error CONTIKI not defined! You must specify where CONTIKI resides!}
|
||||||
endif
|
endif
|
||||||
|
@ -52,27 +48,37 @@ ifndef LD65_OBJ
|
||||||
${error LD65_OBJ not defined! You must specify where the cc65 objects reside!}
|
${error LD65_OBJ not defined! You must specify where the cc65 objects reside!}
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
CONTIKI_TARGET_DIRS = .
|
||||||
|
CONTIKI_CPU_DIRS = . net sys
|
||||||
|
CONTIKI_TARGET_MAIN = ${addprefix $(OBJECTDIR)/,contiki-main.o}
|
||||||
|
|
||||||
|
CONTIKI_TARGET_SOURCEFILES = contiki-main.c
|
||||||
|
CONTIKI_CPU_SOURCEFILES = lc-asm.S uip_arch.c
|
||||||
|
|
||||||
|
CONTIKI_SOURCEFILES += $(CONTIKI_CPU_SOURCEFILES) $(CONTIKI_TARGET_SOURCEFILES)
|
||||||
|
|
||||||
|
TARGET_STARTFILES = $(TARGET).o --start-group
|
||||||
|
TARGET_LIBFILES = $(TARGET).lib --end-group
|
||||||
|
|
||||||
|
### Compiler definitions
|
||||||
|
|
||||||
AS = ca65
|
AS = ca65
|
||||||
CC = cc65
|
CC = cc65
|
||||||
LD = ld65
|
LD = ld65
|
||||||
AR = ar65
|
AR = ar65
|
||||||
|
|
||||||
AFLAGS = -t $(TARGET)
|
AFLAGS = -t $(TARGET)
|
||||||
CFLAGS += -t $(TARGET) -Or $(INCLUDES)
|
CFLAGS += -t $(TARGET) -Or ${addprefix -I,$(SOURCEDIRS)}
|
||||||
LDFLAGS = -C $(CONTIKI)/platform/$(TARGET)/linker.cfg -m contiki-$(TARGET).map
|
LDFLAGS = -C $(CONTIKI)/platform/$(TARGET)/linker.cfg -m contiki-$(TARGET).map
|
||||||
AROPTS = a
|
AROPTS = a
|
||||||
|
|
||||||
CONTIKI_TARGET_MAIN = $(OBJECTDIR)/contiki-main.o
|
### Compilation rules
|
||||||
CONTIKI_OBJECTFILES += $(OBJECTDIR)/contiki-main.o $(OBJECTDIR)/lc-asm.o $(OBJECTDIR)/uip_arch.o
|
|
||||||
TARGET_STARTFILES = $(TARGET).o --start-group
|
|
||||||
TARGET_LIBFILES = $(TARGET).lib --end-group
|
|
||||||
|
|
||||||
#########
|
.SUFFIXES:
|
||||||
# Rules #
|
|
||||||
#########
|
|
||||||
|
|
||||||
$(OBJECTDIR)/%.o: %.S
|
CUSTOM_RULE_C_TO_OBJECTDIR_D = 1
|
||||||
@$(AS) $(AFLAGS) $< -o $@
|
# No explicit dependency file generation necessary since it is done
|
||||||
|
# as compilation side effect using the --create-dep compiler option
|
||||||
|
|
||||||
CUSTOM_RULE_C_TO_OBJECTDIR_O = 1
|
CUSTOM_RULE_C_TO_OBJECTDIR_O = 1
|
||||||
$(OBJECTDIR)/%.o: %.c
|
$(OBJECTDIR)/%.o: %.c
|
||||||
|
@ -87,16 +93,18 @@ CUSTOM_RULE_C_TO_CO = 1
|
||||||
@$(AS) $(AFLAGS) $(@:.co=.s) -o $@
|
@$(AS) $(AFLAGS) $(@:.co=.s) -o $@
|
||||||
@rm -f $(@:.co=.s)
|
@rm -f $(@:.co=.s)
|
||||||
|
|
||||||
CUSTOM_RULE_C_TO_OBJECTDIR_D = 1
|
$(OBJECTDIR)/%.o: %.S
|
||||||
# No explicit dependency file generation necessary since it is done
|
$(AS) $(AFLAGS) $< -o $@
|
||||||
# as compilation side effect using the --create-dep compiler option
|
|
||||||
|
|
||||||
#################
|
### Setup directory search path for source files
|
||||||
# Path Settings #
|
|
||||||
#################
|
|
||||||
|
|
||||||
INCLUDES = -I$(CONTIKI)/platform/$(TARGET) -I$(CONTIKI_CPU) -I$(CONTIKI)/core ${addprefix -I,$(APPDIRS)}
|
CONTIKI_TARGET_DIRS_CONCAT = ${addprefix $(CONTIKI)/platform/$(TARGET)/, \
|
||||||
|
$(CONTIKI_TARGET_DIRS)}
|
||||||
|
CONTIKI_CPU_DIRS_CONCAT = ${addprefix $(CONTIKI)/cpu/6502/, \
|
||||||
|
$(CONTIKI_CPU_DIRS)}
|
||||||
|
SOURCEDIRS = $(PROJECTDIRS) \
|
||||||
|
$(CONTIKI_TARGET_DIRS_CONCAT) $(CONTIKI_CPU_DIRS_CONCAT) \
|
||||||
|
$(CONTIKIDIRS) $(APPDIRS) $(APP_DIRS)
|
||||||
|
|
||||||
vpath %.c $(CONTIKI)/platform/$(TARGET) $(CONTIKI_CPU)/net $(CONTIKIDIRS) $(APPDIRS)
|
vpath %.c $(SOURCEDIRS)
|
||||||
|
vpath %.S $(SOURCEDIRS)
|
||||||
vpath %.S $(CONTIKI_CPU)/sys
|
|
||||||
|
|
Loading…
Reference in a new issue