2011-05-11 21:17:30 +00:00
|
|
|
VPATH =
|
|
|
|
OBJS = main.o
|
|
|
|
|
|
|
|
##########################################################################
|
|
|
|
# Project-specific files
|
|
|
|
##########################################################################
|
|
|
|
|
|
|
|
VPATH +=
|
|
|
|
OBJS +=
|
2011-06-13 21:17:09 +00:00
|
|
|
OBJS += basic/basic.o basic/reinvoke_isp.o basic/delayms.o basic/voltage.o
|
2011-06-13 21:53:02 +00:00
|
|
|
OBJS += basic/keyin.o
|
2011-05-19 12:05:28 +00:00
|
|
|
OBJS += eeprom/eeprom.o
|
2011-06-15 08:51:22 +00:00
|
|
|
LIBS += core/libcore.a lcd/liblcd.a modules/libmodules.a filesystem/libfat.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-06-15 08:51:22 +00:00
|
|
|
LDLIBS += -Lfilesystem -lfat
|
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
|
|
|
|
2011-06-09 11:20:03 +00:00
|
|
|
all: $(OUTFILE).bin
|
2011-05-11 21:17:30 +00:00
|
|
|
|
|
|
|
%.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-06-15 08:51:22 +00:00
|
|
|
filesystem/libfat.a:
|
|
|
|
cd filesystem && $(MAKE) ROOT_PATH=../$(ROOT_PATH)
|
|
|
|
|
2011-06-09 11:20:03 +00:00
|
|
|
tools/lpcfix:
|
2011-05-11 21:17:30 +00:00
|
|
|
cd tools && $(MAKE)
|
|
|
|
|
2011-06-09 11:20:03 +00:00
|
|
|
$(OUTFILE).bin: $(OBJS) $(SYS_OBJS) $(LIBS) $(LPCFIX)
|
2011-05-11 21:17:30 +00:00
|
|
|
-@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 ""
|
2011-06-09 11:20:03 +00:00
|
|
|
$(LPCFIX) -c $(OUTFILE).bin
|
|
|
|
|
|
|
|
protect: $(OUTFILE).bin
|
|
|
|
$(LPCFIX) -p 2 $(OUTFILE).bin
|
2011-05-11 21:17:30 +00:00
|
|
|
|
|
|
|
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-06-15 08:51:22 +00:00
|
|
|
@cd filesystem && $(MAKE) clean
|
2011-05-13 13:20:08 +00:00
|
|
|
|
|
|
|
|
2011-06-15 08:51:22 +00:00
|
|
|
.PHONY: lcd/liblcd.a modules/libmodules.a filesystem/libfat.a
|
2011-05-13 13:20:08 +00:00
|
|
|
|