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 ##########################################################################
20 ##########################################################################
22 # Set DEBUGBUILD to 'TRUE' for full debugging (larger, slower binaries),
23 # or to 'FALSE' for release builds (smallest, fastest binaries)
26 ##########################################################################
27 # IDE Flags (Keeps various IDEs happy)
28 ##########################################################################
30 OPTDEFINES
= -D __NEWLIB__
32 ##########################################################################
33 # Project-specific files
34 ##########################################################################
39 VPATH
+= project
/commands
40 OBJS
+= cmd_chibi_addr.o cmd_chibi_tx.o
41 OBJS
+= cmd_i2ceeprom_read.o cmd_i2ceeprom_write.o cmd_lm75b_gettemp.o
42 OBJS
+= cmd_reset.o cmd_sd_dir.o cmd_sysinfo.o cmd_uart.o
43 OBJS
+= cmd_roundedcorner.o cmd_pwm.o
45 VPATH
+= project
/commands
/drawing
46 OBJS
+= cmd_backlight.o cmd_bmp.o cmd_button.o cmd_calibrate.o
47 OBJS
+= cmd_circle.o cmd_clear.o cmd_line.o cmd_orientation.o
48 OBJS
+= cmd_pixel.o cmd_progress.o cmd_rectangle.o cmd_text.o
49 OBJS
+= cmd_textw.o cmd_tsthreshhold.o cmd_tswait.o cmd_triangle.o
51 ##########################################################################
52 # Optional driver files
53 ##########################################################################
55 # Chibi Light-Weight Wireless Stack (AT86RF212)
56 VPATH
+= drivers
/rf
/chibi
57 OBJS
+= chb.o chb_buf.o chb_drvr.o chb_eeprom.o chb_spi.o
60 VPATH
+= drivers
/storage
/eeprom drivers
/storage
/eeprom
/mcp24aa
61 OBJS
+= eeprom.o mcp24aa.o
63 # LM75B temperature sensor
64 VPATH
+= drivers
/sensors
/lm75b
68 VPATH
+= drivers
/rtc
/isl12022m
72 VPATH
+= drivers
/displays
/tft drivers
/displays
/tft
/hw
73 OBJS
+= drawing.o touchscreen.o colors.o theme.o bmp.o
76 VPATH
+= drivers
/displays
/tft
/controls
77 OBJS
+= button.o hsbchart.o huechart.o label.o
78 OBJS
+= labelcentered.o progressbar.o
80 # Bitmap (non-AA) fonts
81 VPATH
+= drivers
/displays
/tft
/fonts
83 OBJS
+= dejavusans9.o dejavusansbold9.o dejavusanscondensed9.o
84 OBJS
+= dejavusansmono8.o dejavusansmonobold8.o
85 OBJS
+= verdana9.o verdana14.o verdanabold14.o
88 VPATH
+= drivers
/displays
/tft
/aafonts
/aa2 drivers
/displays
/tft
/aafonts
/aa4
90 OBJS
+= DejaVuSansCondensed14_AA2.o DejaVuSansCondensedBold14_AA2.o
91 OBJS
+= DejaVuSansMono10_AA2.o DejaVuSansMono13_AA2.o DejaVuSansMono14_AA2.o
93 # LCD Driver (Only one can be included at a time!)
103 # Bitmap/Monochrome LCD support (ST7565, SSD1306, etc.)
104 VPATH
+= drivers
/displays
105 VPATH
+= drivers
/displays
/bitmap
/sharpmem
106 VPATH
+= drivers
/displays
/bitmap
/st7565
107 VPATH
+= drivers
/displays
/bitmap
/ssd1306
108 OBJS
+= smallfonts.o sharpmem.o st7565.o ssd1306.o
110 #Character Displays (VFD text displays, etc.)
111 VPATH
+= drivers
/displays
/character
/samsung_20T202DA2JA
112 OBJS
+= samsung_20T202DA2JA.o
114 # ChaN FatFS and SD card support
115 VPATH
+= drivers
/fatfs
119 VPATH
+= drivers
/motor
/stepper
122 # RSA Encryption/Descryption
127 VPATH
+= drivers
/dac
/mcp4725 drivers
/dac
/mcp4901
128 OBJS
+= mcp4725.o mcp4901.o
131 VPATH
+= drivers
/rf
/pn532 drivers
/rf
/pn532
/helpers
132 OBJS
+= pn532.o pn532_bus_i2c.o pn532_bus_uart.o
133 OBJS
+= pn532_mifare_classic.o pn532_mifare_ultralight.o
136 VPATH
+= drivers
/sensors
/tcs3414 drivers
/sensors
/tsl2561
137 OBJS
+= tcs3414.o tsl2561.o
140 VPATH
+= drivers
/storage
/spiflash
/w25q16bv
144 VPATH
+= drivers
/audio
/tea5767
147 # IN219 Current Sensor
148 VPATH
+= drivers
/sensors
/ina219
151 # MPL115A2 Barometric Pressure Sensor
152 VPATH
+= drivers
/sensors
/mpl115a2
156 VPATH
+= drivers
/adc
/ads1015
159 ##########################################################################
161 ##########################################################################
163 VPATH
+= core core
/adc core
/cmd core
/cpu core
/gpio core
/i2c core
/pmu
164 VPATH
+= core
/ssp core
/systick core
/timer16 core
/timer32 core
/uart
165 VPATH
+= core
/usbhid-rom core
/wdt core
/usbcdc core
/pwm core
/iap
167 OBJS
+= stdio.o string.o
168 OBJS
+= adc.o cpu.o cmd.o gpio.o i2c.o pmu.o ssp.o systick.o timer16.o
169 OBJS
+= timer32.o uart.o uart_buf.o usbconfig.o usbhid.o usbmsc.o
170 OBJS
+= wdt.o cdcuser.o cdc_buf.o usbcore.o usbdesc.o usbhw.o usbuser.o
171 OBJS
+= sysinit.o pwm.o iap.o
175 OBJS
+= display.o sprite.o
178 OBJS
+= at45db041d.o iobase.o diskio.o
180 ##########################################################################
181 # GNU GCC compiler prefix and location
182 ##########################################################################
184 CROSS_COMPILE
= arm-none-eabi-
185 AS
= $(CROSS_COMPILE
)gcc
186 CC
= $(CROSS_COMPILE
)gcc
187 LD
= $(CROSS_COMPILE
)gcc
188 SIZE
= $(CROSS_COMPILE
)size
189 OBJCOPY
= $(CROSS_COMPILE
)objcopy
190 OBJDUMP
= $(CROSS_COMPILE
)objdump
194 ##########################################################################
195 # GNU GCC compiler flags
196 ##########################################################################
198 INCLUDE_PATHS
= -I
$(ROOT_PATH
) -I
$(ROOT_PATH
)/project
200 ##########################################################################
202 ##########################################################################
205 LD_SCRIPT
= $(LD_PATH
)/linkscript.
ld
206 LD_TEMP
= $(LD_PATH
)/memory.
ld
208 ifeq (LPC11xx
,$(TARGET
))
214 CPU_TYPE
= cortex-
$(CORTEX_TYPE
)
216 OBJS
+= $(TARGET
)_handlers.o LPC1xxx_startup.o
218 ##########################################################################
219 # Compiler settings, parameters and flags
220 ##########################################################################
221 ifeq (TRUE
,$(DEBUGBUILD
))
222 CFLAGS
= -c
-g
-O0
$(INCLUDE_PATHS
) -Wall
-mthumb
-ffunction-sections
-fdata-sections
-fmessage-length
=0 -mcpu
=$(CPU_TYPE
) -DTARGET
=$(TARGET
) -fno-builtin
$(OPTDEFINES
) -std
=c99
223 ASFLAGS
= -c
-g
-O0
$(INCLUDE_PATHS
) -Wall
-mthumb
-ffunction-sections
-fdata-sections
-fmessage-length
=0 -mcpu
=$(CPU_TYPE
) -D__ASSEMBLY__
-x assembler-with-cpp
225 CFLAGS
= -c
-g
-Os
$(INCLUDE_PATHS
) -Wall
-mthumb
-ffunction-sections
-fdata-sections
-fmessage-length
=0 -mcpu
=$(CPU_TYPE
) -DTARGET
=$(TARGET
) -fno-builtin
$(OPTDEFINES
) -std
=c99
226 ASFLAGS
= -c
-g
-Os
$(INCLUDE_PATHS
) -Wall
-mthumb
-ffunction-sections
-fdata-sections
-fmessage-length
=0 -mcpu
=$(CPU_TYPE
) -D__ASSEMBLY__
-x assembler-with-cpp
229 LDFLAGS
= -nostartfiles
-mthumb
-mcpu
=$(CPU_TYPE
) -Wl
,--gc-sections
231 OCFLAGS
= --strip-unneeded
236 $(CC
) $(CFLAGS
) -o
$@
$<
239 $(AS
) $(ASFLAGS
) -o
$@
$<
241 firmware
: $(OBJS
) $(SYS_OBJS
)
242 -@echo
"MEMORY" > $(LD_TEMP
)
243 -@echo
"{" >> $(LD_TEMP
)
244 -@echo
" flash(rx): ORIGIN = 0x00000000, LENGTH = $(FLASH)" >> $(LD_TEMP
)
245 -@echo
" sram(rwx): ORIGIN = 0x10000000+$(SRAM_USB), LENGTH = $(SRAM)-$(SRAM_USB)" >> $(LD_TEMP
)
246 -@echo
"}" >> $(LD_TEMP
)
247 -@echo
"INCLUDE $(LD_SCRIPT)" >> $(LD_TEMP
)
248 $(LD
) $(LDFLAGS
) -T
$(LD_TEMP
) -o
$(OUTFILE
).elf
$(OBJS
) $(LDLIBS
)
250 $(SIZE
) $(OUTFILE
).elf
252 $(OBJCOPY
) $(OCFLAGS
) -O binary
$(OUTFILE
).elf
$(OUTFILE
).bin
253 $(OBJCOPY
) $(OCFLAGS
) -O binary
$(OUTFILE
).elf
$(OUTFILE
).bin
254 $(OBJCOPY
) $(OCFLAGS
) -O ihex
$(OUTFILE
).elf
$(OUTFILE
).hex
256 $(LPCRC
) firmware.bin
259 rm -f
$(OBJS
) $(LD_TEMP
) $(OUTFILE
).elf
$(OUTFILE
).bin
$(OUTFILE
).hex