2011-05-11 21:17:30 +00:00
|
|
|
VPATH =
|
|
|
|
OBJS = main.o
|
|
|
|
|
|
|
|
##########################################################################
|
|
|
|
# Project-specific files
|
|
|
|
##########################################################################
|
|
|
|
|
|
|
|
VPATH +=
|
|
|
|
OBJS +=
|
2011-05-20 22:01:53 +00:00
|
|
|
OBJS += basic/basic.o
|
2011-05-19 12:05:28 +00:00
|
|
|
OBJS += eeprom/eeprom.o
|
2011-05-21 01:05:57 +00:00
|
|
|
OBJS += reinvoke_isp.o
|
2011-05-22 15:46:25 +00:00
|
|
|
LIBS += core/libcore.a lcd/liblcd.a modules/libmodules.a
|
2011-05-11 21:17:30 +00:00
|
|
|
|
|
|
|
##########################################################################
|
|
|
|
# GNU GCC compiler flags
|
|
|
|
##########################################################################
|
|
|
|
ROOT_PATH = .
|
|
|
|
INCLUDE_PATHS = -I$(ROOT_PATH) -I$(ROOT_PATH)/core
|
|
|
|
|
2011-05-21 00:16:03 +00:00
|
|
|
include $(ROOT_PATH)/Makefile.inc
|
2011-05-11 21:17:30 +00:00
|
|
|
|
|
|
|
VPATH += lpc1xxx
|
|
|
|
OBJS += $(TARGET)_handlers.o LPC1xxx_startup.o
|
|
|
|
|
|
|
|
##########################################################################
|
2011-05-21 00:16:03 +00:00
|
|
|
# Startup files
|
2011-05-11 21:17:30 +00:00
|
|
|
##########################################################################
|
2011-05-21 10:05:48 +00:00
|
|
|
LDLIBS = -lm
|
|
|
|
LDLIBS += -Lmodules -lmodules
|
|
|
|
LDLIBS += -Lcore -lcore
|
2011-05-22 15:46:25 +00:00
|
|
|
LDLIBS += -Llcd -llcd
|
2011-05-21 10:05:48 +00:00
|
|
|
OCFLAGS = --strip-unneeded
|
2011-05-11 21:17:30 +00:00
|
|
|
|
2011-05-21 00:16:03 +00:00
|
|
|
LD_PATH = lpc1xxx
|
|
|
|
LD_SCRIPT = $(LD_PATH)/linkscript.ld
|
|
|
|
LD_TEMP = $(LD_PATH)/memory.ld
|
2011-05-11 21:17:30 +00:00
|
|
|
|
|
|
|
all: firmware
|
|
|
|
|
|
|
|
%.o : %.c
|
|
|
|
$(CC) $(CFLAGS) -o $@ $<
|
|
|
|
|
|
|
|
core/libcore.a: core/projectconfig.h
|
2011-05-21 00:16:03 +00:00
|
|
|
cd core && $(MAKE) ROOT_PATH=../$(ROOT_PATH)
|
2011-05-11 21:17:30 +00:00
|
|
|
|
2011-05-22 15:46:25 +00:00
|
|
|
lcd/liblcd.a lcd/render.o lcd/display.o:
|
2011-05-21 00:16:03 +00:00
|
|
|
cd lcd && $(MAKE) ROOT_PATH=../$(ROOT_PATH)
|
2011-05-11 21:17:30 +00:00
|
|
|
|
2011-05-21 10:05:48 +00:00
|
|
|
modules/libmodules.a:
|
|
|
|
cd modules && $(MAKE) ROOT_PATH=../$(ROOT_PATH)
|
|
|
|
|
2011-05-11 21:17:30 +00:00
|
|
|
tools/lpcrc:
|
|
|
|
cd tools && $(MAKE)
|
|
|
|
|
|
|
|
firmware: $(OBJS) $(SYS_OBJS) $(LIBS) $(LPCRC)
|
|
|
|
-@echo "MEMORY" > $(LD_TEMP)
|
|
|
|
-@echo "{" >> $(LD_TEMP)
|
|
|
|
-@echo " flash(rx): ORIGIN = 0x00000000, LENGTH = $(FLASH)" >> $(LD_TEMP)
|
|
|
|
-@echo " sram(rwx): ORIGIN = 0x10000000+$(SRAM_USB), LENGTH = $(SRAM)-$(SRAM_USB)" >> $(LD_TEMP)
|
|
|
|
-@echo "}" >> $(LD_TEMP)
|
|
|
|
-@echo "INCLUDE $(LD_SCRIPT)" >> $(LD_TEMP)
|
|
|
|
$(LD) $(LDFLAGS) -T $(LD_TEMP) -o $(OUTFILE).elf $(OBJS) $(LDLIBS)
|
|
|
|
-@echo ""
|
|
|
|
$(SIZE) $(OUTFILE).elf
|
|
|
|
-@echo ""
|
|
|
|
$(OBJCOPY) $(OCFLAGS) -O binary $(OUTFILE).elf $(OUTFILE).bin
|
|
|
|
-@echo ""
|
|
|
|
$(LPCRC) $(OUTFILE).bin
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(OBJS) $(LD_TEMP) $(OUTFILE).elf $(OUTFILE).bin $(OUTFILE).hex
|
|
|
|
@cd core && $(MAKE) clean
|
|
|
|
@cd tools && $(MAKE) clean
|
|
|
|
@cd lcd && $(MAKE) clean
|
2011-05-21 10:05:48 +00:00
|
|
|
@cd modules && $(MAKE) clean
|
2011-05-13 13:20:08 +00:00
|
|
|
|
|
|
|
|
2011-05-22 15:46:25 +00:00
|
|
|
.PHONY: lcd/liblcd.a modules/libmodules.a
|
2011-05-13 13:20:08 +00:00
|
|
|
|