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.
15 ##########################################################################
17 ##########################################################################
19 # Set DEBUGBUILD to 'TRUE' for full debugging (larger, slower binaries),
20 # or to 'FALSE' for release builds (smallest, fastest binaries)
23 ##########################################################################
24 # IDE Flags (Keeps various IDEs happy)
25 ##########################################################################
27 #OPTDEFINES = -D __NEWLIB__ -DR0KET
28 OPTDEFINES
= -D __NEWLIB__
-DHOB_REV2
29 ##########################################################################
30 # Project-specific files
31 ##########################################################################
36 badge
/jumpnrun
/collision.c \
37 badge
/jumpnrun
/enemies.c \
38 badge
/jumpnrun
/items.c \
39 badge
/jumpnrun
/jumpnrun.c \
40 badge
/jumpnrun
/level_load.c \
41 badge
/jumpnrun
/tiles.c \
42 badge
/jumpnrun
/stats.c \
51 dataflash
/at45db041d.c
60 project
/commands
/cmd_chibi_addr.c \
61 project
/commands
/cmd_chibi_tx.c \
62 project
/commands
/cmd_i2ceeprom_read.c \
63 project
/commands
/cmd_i2ceeprom_write.c \
64 project
/commands
/cmd_lm75b_gettemp.c \
65 project
/commands
/cmd_reset.c \
66 project
/commands
/cmd_sd_dir.c \
67 project
/commands
/cmd_sysinfo.c \
68 project
/commands
/cmd_uart.c \
69 project
/commands
/cmd_pwm.c
72 project
/commands
/drawing
/cmd_backlight.c \
73 project
/commands
/drawing
/cmd_bmp.c \
74 project
/commands
/drawing
/cmd_button.c \
75 project
/commands
/drawing
/cmd_calibrate.c \
76 project
/commands
/drawing
/cmd_circle.c \
77 project
/commands
/drawing
/cmd_clear.c \
78 project
/commands
/drawing
/cmd_line.c \
79 project
/commands
/drawing
/cmd_orientation.c \
80 project
/commands
/drawing
/cmd_pixel.c \
81 project
/commands
/drawing
/cmd_progress.c \
82 project
/commands
/drawing
/cmd_rectangle.c \
83 project
/commands
/drawing
/cmd_roundedcorner.c \
84 project
/commands
/drawing
/cmd_text.c \
85 project
/commands
/drawing
/cmd_textw.c \
86 project
/commands
/drawing
/cmd_tsthreshhold.c \
87 project
/commands
/drawing
/cmd_tswait.c \
88 project
/commands
/drawing
/cmd_triangle.c
90 ##########################################################################
91 # Optional driver files
92 ##########################################################################
94 # Chibi Light-Weight Wireless Stack (AT86RF212)
96 drivers
/rf
/chibi
/chb.c \
97 drivers
/rf
/chibi
/chb_buf.c \
98 drivers
/rf
/chibi
/chb_drvr.c \
99 drivers
/rf
/chibi
/chb_eeprom.c \
100 drivers
/rf
/chibi
/chb_spi.c
104 drivers
/storage
/eeprom
/eeprom.c \
105 drivers
/storage
/eeprom
/mcp24aa
/mcp24aa.c
107 # LM75B temperature sensor
109 drivers
/sensors
/lm75b
/lm75b.c
113 drivers
/rtc
/isl12022m
/isl12022m.c
117 drivers
/displays
/tft
/drawing.c \
118 drivers
/displays
/tft
/touchscreen.c \
119 drivers
/displays
/tft
/colors.c \
120 drivers
/displays
/tft
/theme.c \
121 drivers
/displays
/tft
/bmp.c
125 drivers
/displays
/tft
/controls
/button.c \
126 drivers
/displays
/tft
/controls
/hsbchart.c \
127 drivers
/displays
/tft
/controls
/huechart.c \
128 drivers
/displays
/tft
/controls
/label.c \
129 drivers
/displays
/tft
/controls
/labelcentered.c \
130 drivers
/displays
/tft
/controls
/progressbar.c
132 # Bitmap (non-AA) fonts
134 drivers
/displays
/tft
/fonts.c \
135 drivers
/displays
/tft
/fonts
/dejavusans9.c \
136 drivers
/displays
/tft
/fonts
/dejavusansbold9.c \
137 drivers
/displays
/tft
/fonts
/dejavusanscondensed9.c \
138 drivers
/displays
/tft
/fonts
/dejavusansmono8.c \
139 drivers
/displays
/tft
/fonts
/dejavusansmonobold8.c \
140 drivers
/displays
/tft
/fonts
/verdana9.c \
141 drivers
/displays
/tft
/fonts
/verdana14.c \
142 drivers
/displays
/tft
/fonts
/verdanabold14.c
146 drivers
/displays
/tft
/aafonts.c \
147 drivers
/displays
/tft
/aafonts
/aa2
/DejaVuSansCondensed14_AA2.c \
148 drivers
/displays
/tft
/aafonts
/aa2
/DejaVuSansCondensedBold14_AA2.c \
149 drivers
/displays
/tft
/aafonts
/aa2
/DejaVuSansMono10_AA2.c \
150 drivers
/displays
/tft
/aafonts
/aa2
/DejaVuSansMono13_AA2.c \
151 drivers
/displays
/tft
/aafonts
/aa2
/DejaVuSansMono14_AA2.c
153 # LCD Driver (Only one can be included at a time!)
154 # SRCS += drivers/displays/tft/hw/hx8340b.c
155 # SRCS += drivers/displays/tft/hw/hx8347d.c
156 # SRCS += drivers/displays/tft/hw/ILI9328.c
157 # SRCS += drivers/displays/tft/hw/ILI9325.c
158 # SRCS += drivers/displays/tft/hw/ssd1331.c
159 # SRCS += drivers/displays/tft/hw/ssd1351.c
160 # SRCS += drivers/displays/tft/hw/st7735.c
161 # SRCS += drivers/displays/tft/hw/st7783.c
163 # Bitmap/Monochrome LCD support (ST7565, SSD1306, etc.)
165 drivers
/displays
/smallfonts.c \
166 drivers
/displays
/bitmap
/sharpmem
/sharpmem.c \
167 drivers
/displays
/bitmap
/st7565
/st7565.c \
168 drivers
/displays
/bitmap
/ssd1306
/ssd1306.c
170 #Character Displays (VFD text displays, etc.)
172 drivers
/displays
/character
/samsung_20T202DA2JA
/samsung_20T202DA2JA.c
174 # ChaN FatFS and SD card support
177 # drivers/fatfs/mmc.c
181 drivers
/motor
/stepper
/stepper.c
183 # RSA Encryption/Descryption
189 drivers
/dac
/mcp4725
/mcp4725.c \
190 drivers
/dac
/mcp4901
/mcp4901.c
194 drivers
/rf
/pn532
/pn532.c \
195 drivers
/rf
/pn532
/pn532_bus_i2c.c \
196 drivers
/rf
/pn532
/pn532_bus_uart.c \
197 drivers
/rf
/pn532
/helpers
/pn532_mifare_classic.c \
198 drivers
/rf
/pn532
/helpers
/pn532_mifare_ultralight.c
202 drivers
/sensors
/tcs3414
/tcs3414.c \
203 drivers
/sensors
/tsl2561
/tsl2561.c
207 drivers
/storage
/spiflash
/w25q16bv
/w25q16bv.c
211 drivers
/audio
/tea5767
/tea5767.c
213 # IN219 Current Sensor
215 drivers
/sensors
/ina219
/ina219.c
217 # MPL115A2 Barometric Pressure Sensor
219 drivers
/sensors
/mpl115a2
/mpl115a2.c
223 drivers
/adc
/ads1015
/ads1015.c
225 ##########################################################################
227 ##########################################################################
241 core
/systick
/systick.c \
242 core
/timer16
/timer16.c \
243 core
/timer32
/timer32.c \
244 core
/uart
/uart_buf.c \
246 core
/usbcdc
/cdc_buf.c \
247 core
/usbcdc
/cdcuser.c \
248 core
/usbcdc
/usbcore.c \
249 core
/usbcdc
/usbdesc.c \
250 core
/usbcdc
/usbhw.c \
251 core
/usbcdc
/usbuser.c \
252 core
/usbhid-rom
/usbconfig.c \
253 core
/usbhid-rom
/usbhid.c \
254 core
/usbhid-rom
/usbmsc.c \
257 ##########################################################################
258 # GNU GCC compiler prefix and location
259 ##########################################################################
261 CROSS_COMPILE
= arm-none-eabi-
262 AS
= $(CROSS_COMPILE
)gcc
263 CC
= $(CROSS_COMPILE
)gcc
264 LD
= $(CROSS_COMPILE
)gcc
265 SIZE
= $(CROSS_COMPILE
)size
266 OBJCOPY
= $(CROSS_COMPILE
)objcopy
267 OBJDUMP
= $(CROSS_COMPILE
)objdump
273 ##########################################################################
274 # GNU GCC compiler flags
275 ##########################################################################
277 INCLUDE_PATHS
= -I
$(ROOT_PATH
) -I
$(ROOT_PATH
)/project
279 ##########################################################################
281 ##########################################################################
284 LD_SCRIPT
= $(LD_PATH
)/linkscript.
ld
285 LD_TEMP
= $(LD_PATH
)/memory.
ld
287 ifeq (LPC11xx
,$(TARGET
))
293 CPU_TYPE
= cortex-
$(CORTEX_TYPE
)
296 lpc1xxx
/$(TARGET
)_handlers.c \
297 lpc1xxx
/LPC1xxx_startup.c
299 OBJS
= $(SRCS
:%.c
=%.o
)
300 DEPS
= $(SRCS
:%.c
=%.dep
)
302 ##########################################################################
303 # Compiler settings, parameters and flags
304 ##########################################################################
305 ifeq (TRUE
,$(DEBUGBUILD
))
306 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
307 ASFLAGS
= -c
-g
-O0
$(INCLUDE_PATHS
) -Wall
-mthumb
-ffunction-sections
-fdata-sections
-fmessage-length
=0 -mcpu
=$(CPU_TYPE
) -D__ASSEMBLY__
-x assembler-with-cpp
309 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
310 ASFLAGS
= -c
-g
-Os
$(INCLUDE_PATHS
) -Wall
-mthumb
-ffunction-sections
-fdata-sections
-fmessage-length
=0 -mcpu
=$(CPU_TYPE
) -D__ASSEMBLY__
-x assembler-with-cpp
313 LDFLAGS
= -nostartfiles
-mthumb
-mcpu
=$(CPU_TYPE
) -Wl
,--gc-sections
315 OCFLAGS
= --strip-unneeded
317 all: dep size
$(OUTFILE
).bin
$(OUTFILE
).hex
321 $(DEPS
) : %.dep
: %.c
322 $(CC
) $(CPPFLAGS
) $(CFLAGS
) -MM
$< -MT
$@
-MT
$(@
:%.dep
=%.o
) -MF
$@
327 -@echo
"MEMORY" > $(LD_TEMP
)
328 -@echo
"{" >> $(LD_TEMP
)
329 -@echo
" flash(rx): ORIGIN = 0x00000000, LENGTH = $(FLASH)" >> $(LD_TEMP
)
330 -@echo
" sram(rwx): ORIGIN = 0x10000000+$(SRAM_USB), LENGTH = $(SRAM)-$(SRAM_USB)" >> $(LD_TEMP
)
331 -@echo
"}" >> $(LD_TEMP
)
332 -@echo
"INCLUDE $(LD_SCRIPT)" >> $(LD_TEMP
)
334 $(OUTFILE
).elf
: $(OBJS
) $(LD_TEMP
)
335 $(LD
) $(LDFLAGS
) -T
$(LD_TEMP
) -o
$(OUTFILE
).elf
$(OBJS
) $(LDLIBS
)
337 $(OUTFILE
).bin
: $(OUTFILE
).elf
$(LPCRC
)
338 $(OBJCOPY
) $(OCFLAGS
) -O binary
$(OUTFILE
).elf
$(OUTFILE
).bin
339 $(LPCRC
) $(OUTFILE
).bin
341 $(OUTFILE
).hex
: $(OUTFILE
).elf
342 $(OBJCOPY
) $(OCFLAGS
) -O ihex
$(OUTFILE
).elf
$(OUTFILE
).hex
345 $(SIZE
) $(OUTFILE
).elf
348 rm -f
$(OBJS
) $(LD_TEMP
) $(OUTFILE
).elf
$(OUTFILE
).bin
$(OUTFILE
).hex
351 rm -f
$(DEPS
) $(LPCRC
)
353 .PHONY
: all dep size
clean distclean
355 CFLAGS_FOR_BUILD
= -Wall
-Wextra
-std
=c99
-O0
-g
357 LPCRC_SRCS
= tools
/lpcrc
/lpcrc.c
358 LPCRC_OBJS
= $(LPCRC_SRCS
:%.c
=%.o
)
359 LPCRC_DEPS
= $(LPCRC_SRCS
:%.c
=%.dep
)
361 $(LPCRC_DEPS
) : %.dep
: %.c
362 $(CC_FOR_BUILD
) $(CPPFLAGS_FOR_BUILD
) $(CFLAGS_FOR_BUILD
) -MM
$< -MT
$@
-MT
$(@
:%.dep
=%.o
) -MF
$@
364 $(LPCRC_OBJS
): %.o
: %.c
365 $(CC_FOR_BUILD
) $(CPPFLAGS_FOR_BUILD
) $(CFLAGS_FOR_BUILD
) -o
$@
-c
$<
367 $(LPCRC
): $(LPCRC_OBJS
)
368 $(CC_FOR_BUILD
) $(CFLAGS_FOR_BUILD
) $(LDFLAGS_FOR_BUILD
) -o
$@
$+ $(LDLIBS_FOR_BUILD
)