1 ##########################################################################
2 # User configuration and firmware specific object files
3 ##########################################################################
5 # The target, flash and ram of the LPC1xxx microprocessor.
6 # Use for the target the value: LPC11xx, LPC13xx or LPC17xx
11 # For USB HID support the LPC134x reserves 384 bytes from the sram,
12 # if you don't want to use the USB features, just use 0 here.
18 ##########################################################################
19 # Project-specific files
20 ##########################################################################
25 VPATH
+= project
/commands
26 OBJS
+= cmd_chibi_addr.o cmd_chibi_tx.o cmd_uart.o
27 OBJS
+= cmd_i2ceeprom_read.o cmd_i2ceeprom_write.o cmd_lm75b_gettemp.o
28 OBJS
+= cmd_sysinfo.o cmd_sd_dir.o cmd_tswait.o cmd_orientation.o
29 OBJS
+= cmd_tsthreshhold.o cmd_backlight.o
31 VPATH
+= project
/commands
/drawing
32 OBJS
+= cmd_button.o cmd_circle.o cmd_clear.o cmd_line.o cmd_pixel.o
33 OBJS
+= cmd_progress.o cmd_bmp.o cmd_gettext.o cmd_calibrate.o
34 OBJS
+= cmd_text.o cmd_textw.o cmd_rectangle.o
36 ##########################################################################
37 # Optional driver files
38 ##########################################################################
40 # Chibi Light-Weight Wireless Stack (AT86RF212)
41 VPATH
+= drivers
/chibi
42 OBJS
+= chb.o chb_buf.o chb_drvr.o chb_eeprom.o chb_spi.o
45 VPATH
+= drivers
/eeprom drivers
/eeprom
/mcp24aa
46 OBJS
+= eeprom.o mcp24aa.o
48 # LM75B temperature sensor
49 VPATH
+= drivers
/sensors
/lm75b
53 VPATH
+= drivers
/rtc
/isl12022m
57 VPATH
+= drivers
/lcd
/tft drivers
/lcd
/tft
/hw drivers
/lcd
/tft
/fonts
58 VPATH
+= drivers
/lcd
/tft
/dialogues
59 OBJS
+= drawing.o touchscreen.o bmp.o alphanumeric.o
60 OBJS
+= dejavusans9.o dejavusansbold9.o dejavusanscondensed9.o
61 OBJS
+= dejavusansmono8.o dejavusansmonobold8.o
62 OBJS
+= veramono9.o veramonobold9.o veramono11.o veramonobold11.o
63 # LCD Driver (Only one can be included at a time!)
69 # Bitmap/Monochrome LCD support (ST7565, SSD1306, etc.)
70 VPATH
+= drivers
/lcd drivers
/lcd
/bitmap
/st7565
71 VPATH
+= drivers
/lcd
/bitmap
/ssd1306
72 OBJS
+= smallfonts.o st7565.o ssd1306.o
74 # ChaN FatFS and SD card support
75 VPATH
+= drivers
/fatfs
79 VPATH
+= drivers
/motor
/stepper
82 # RSA Encryption/Descryption
87 VPATH
+= drivers
/dac
/mcp4725
91 VPATH
+= drivers
/sensors
/pn532
92 OBJS
+= pn532.o pn532_drvr_uart.o
95 VPATH
+= drivers
/sensors
/tcs3414 drivers
/sensors
/tsl2561
96 OBJS
+= tcs3414.o tsl2561.o
98 ##########################################################################
100 ##########################################################################
102 VPATH
+= core core
/adc core
/cmd core
/cpu core
/gpio core
/i2c core
/pmu
103 VPATH
+= core
/ssp core
/systick core
/timer16 core
/timer32 core
/uart
104 VPATH
+= core
/usbhid-rom core
/libc core
/wdt core
/usbcdc core
/pwm
106 OBJS
+= adc.o cpu.o cmd.o gpio.o i2c.o pmu.o ssp.o systick.o timer16.o
107 OBJS
+= timer32.o uart.o uart_buf.o usbconfig.o usbhid.o stdio.o string.o
108 OBJS
+= wdt.o cdcuser.o cdc_buf.o usbcore.o usbdesc.o usbhw.o usbuser.o
109 OBJS
+= sysinit.o pwm.o iap.o
111 ##########################################################################
112 # GNU GCC compiler prefix and location
113 ##########################################################################
115 CROSS_COMPILE
= arm-none-eabi-
116 AS
= $(CROSS_COMPILE
)gcc
117 CC
= $(CROSS_COMPILE
)gcc
118 LD
= $(CROSS_COMPILE
)gcc
119 SIZE
= $(CROSS_COMPILE
)size
120 OBJCOPY
= $(CROSS_COMPILE
)objcopy
121 OBJDUMP
= $(CROSS_COMPILE
)objdump
125 ##########################################################################
126 # GNU GCC compiler flags
127 ##########################################################################
129 INCLUDE_PATHS
= -I
$(ROOT_PATH
) -I
$(ROOT_PATH
)/project
131 ##########################################################################
133 ##########################################################################
136 LD_SCRIPT
= $(LD_PATH
)/linkscript.
ld
137 LD_TEMP
= $(LD_PATH
)/memory.
ld
139 ifeq (LPC11xx
,$(TARGET
))
145 CPU_TYPE
= cortex-
$(CORTEX_TYPE
)
147 OBJS
+= $(TARGET
)_handlers.o LPC1xxx_startup.o
149 ##########################################################################
150 # Compiler settings, parameters and flags
151 ##########################################################################
153 CFLAGS
= -c
-g
-Os
$(INCLUDE_PATHS
) -Wall
-mthumb
-ffunction-sections
-fdata-sections
-fmessage-length
=0 -mcpu
=$(CPU_TYPE
) -DTARGET
=$(TARGET
) -fno-builtin
154 ASFLAGS
= -c
-g
-Os
$(INCLUDE_PATHS
) -Wall
-mthumb
-ffunction-sections
-fdata-sections
-fmessage-length
=0 -mcpu
=$(CPU_TYPE
) -D__ASSEMBLY__
-x assembler-with-cpp
155 LDFLAGS
= -nostartfiles
-mthumb
-mcpu
=$(CPU_TYPE
) -Wl
,--gc-sections
157 OCFLAGS
= --strip-unneeded
162 $(CC
) $(CFLAGS
) -o
$@
$<
165 $(AS
) $(ASFLAGS
) -o
$@
$<
167 firmware
: $(OBJS
) $(SYS_OBJS
)
168 -@echo
"MEMORY" > $(LD_TEMP
)
169 -@echo
"{" >> $(LD_TEMP
)
170 -@echo
" flash(rx): ORIGIN = 0x00000000, LENGTH = $(FLASH)" >> $(LD_TEMP
)
171 -@echo
" sram(rwx): ORIGIN = 0x10000000+$(SRAM_USB), LENGTH = $(SRAM)-$(SRAM_USB)" >> $(LD_TEMP
)
172 -@echo
"}" >> $(LD_TEMP
)
173 -@echo
"INCLUDE $(LD_SCRIPT)" >> $(LD_TEMP
)
174 $(LD
) $(LDFLAGS
) -T
$(LD_TEMP
) -o
$(OUTFILE
).elf
$(OBJS
) $(LDLIBS
)
176 $(SIZE
) $(OUTFILE
).elf
178 $(OBJCOPY
) $(OCFLAGS
) -O binary
$(OUTFILE
).elf
$(OUTFILE
).bin
179 $(OBJCOPY
) $(OCFLAGS
) -O ihex
$(OUTFILE
).elf
$(OUTFILE
).hex
181 $(LPCRC
) firmware.bin
184 rm -f
$(OBJS
) $(LD_TEMP
) $(OUTFILE
).elf
$(OUTFILE
).bin
$(OUTFILE
).hex