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 # Project-specific files
28 ##########################################################################
33 VPATH
+= project
/commands
34 OBJS
+= cmd_chibi_addr.o cmd_chibi_tx.o
35 OBJS
+= cmd_i2ceeprom_read.o cmd_i2ceeprom_write.o cmd_lm75b_gettemp.o
36 OBJS
+= cmd_reset.o cmd_sd_dir.o cmd_sysinfo.o cmd_uart.o
37 OBJS
+= cmd_roundedcorner.o
39 VPATH
+= project
/commands
/drawing
40 OBJS
+= cmd_backlight.o cmd_bmp.o cmd_button.o cmd_calibrate.o
41 OBJS
+= cmd_circle.o cmd_clear.o cmd_line.o cmd_orientation.o
42 OBJS
+= cmd_pixel.o cmd_progress.o cmd_rectangle.o cmd_text.o
43 OBJS
+= cmd_textw.o cmd_tsthreshhold.o cmd_tswait.o cmd_triangle.o
45 ##########################################################################
46 # Optional driver files
47 ##########################################################################
49 # Chibi Light-Weight Wireless Stack (AT86RF212)
50 VPATH
+= drivers
/chibi
51 OBJS
+= chb.o chb_buf.o chb_drvr.o chb_eeprom.o chb_spi.o
54 VPATH
+= drivers
/eeprom drivers
/eeprom
/mcp24aa
55 OBJS
+= eeprom.o mcp24aa.o
57 # LM75B temperature sensor
58 VPATH
+= drivers
/sensors
/lm75b
62 VPATH
+= drivers
/rtc
/isl12022m
66 VPATH
+= drivers
/lcd
/tft drivers
/lcd
/tft
/hw drivers
/lcd
/tft
/fonts
67 VPATH
+= drivers
/lcd
/tft
/dialogues
68 OBJS
+= drawing.o touchscreen.o bmp.o alphanumeric.o
69 OBJS
+= dejavusans9.o dejavusansbold9.o dejavusanscondensed9.o
70 OBJS
+= dejavusansmono8.o dejavusansmonobold8.o
71 OBJS
+= verdana9.o verdana14.o verdanabold14.o
73 # LCD Driver (Only one can be included at a time!)
80 # Bitmap/Monochrome LCD support (ST7565, SSD1306, etc.)
81 VPATH
+= drivers
/lcd drivers
/lcd
/bitmap
/st7565
82 VPATH
+= drivers
/lcd
/bitmap
/ssd1306
83 OBJS
+= smallfonts.o st7565.o ssd1306.o
85 # ChaN FatFS and SD card support
86 VPATH
+= drivers
/fatfs
90 VPATH
+= drivers
/motor
/stepper
93 # RSA Encryption/Descryption
98 VPATH
+= drivers
/dac
/mcp4725
102 VPATH
+= drivers
/sensors
/pn532
106 VPATH
+= drivers
/sensors
/tcs3414 drivers
/sensors
/tsl2561
107 OBJS
+= tcs3414.o tsl2561.o
110 VPATH
+= drivers
/spiflash
/w25q16bv
113 ##########################################################################
115 ##########################################################################
117 VPATH
+= core core
/adc core
/cmd core
/cpu core
/gpio core
/i2c core
/pmu
118 VPATH
+= core
/ssp core
/systick core
/timer16 core
/timer32 core
/uart
119 VPATH
+= core
/usbhid-rom core
/libc core
/wdt core
/usbcdc core
/pwm
121 OBJS
+= adc.o cpu.o cmd.o gpio.o i2c.o pmu.o ssp.o systick.o timer16.o
122 OBJS
+= timer32.o uart.o uart_buf.o usbconfig.o usbhid.o stdio.o string.o
123 OBJS
+= wdt.o cdcuser.o cdc_buf.o usbcore.o usbdesc.o usbhw.o usbuser.o
124 OBJS
+= sysinit.o pwm.o iap.o
126 ##########################################################################
127 # GNU GCC compiler prefix and location
128 ##########################################################################
130 CROSS_COMPILE
= arm-none-eabi-
131 AS
= $(CROSS_COMPILE
)gcc
132 CC
= $(CROSS_COMPILE
)gcc
133 LD
= $(CROSS_COMPILE
)gcc
134 SIZE
= $(CROSS_COMPILE
)size
135 OBJCOPY
= $(CROSS_COMPILE
)objcopy
136 OBJDUMP
= $(CROSS_COMPILE
)objdump
141 ##########################################################################
142 # GNU GCC compiler flags
143 ##########################################################################
145 INCLUDE_PATHS
= -I
$(ROOT_PATH
) -I
$(ROOT_PATH
)/project
147 ##########################################################################
149 ##########################################################################
152 LD_SCRIPT
= $(LD_PATH
)/linkscript.
ld
153 LD_TEMP
= $(LD_PATH
)/memory.
ld
155 ifeq (LPC11xx
,$(TARGET
))
161 CPU_TYPE
= cortex-
$(CORTEX_TYPE
)
163 OBJS
+= $(TARGET
)_handlers.o LPC1xxx_startup.o
165 ##########################################################################
166 # Compiler settings, parameters and flags
167 ##########################################################################
168 ifeq (TRUE
,$(DEBUGBUILD
))
169 CFLAGS
= -c
-g
-O0
$(INCLUDE_PATHS
) -Wall
-mthumb
-ffunction-sections
-fdata-sections
-fmessage-length
=0 -mcpu
=$(CPU_TYPE
) -DTARGET
=$(TARGET
) -fno-builtin
170 ASFLAGS
= -c
-g
-O0
$(INCLUDE_PATHS
) -Wall
-mthumb
-ffunction-sections
-fdata-sections
-fmessage-length
=0 -mcpu
=$(CPU_TYPE
) -D__ASSEMBLY__
-x assembler-with-cpp
172 CFLAGS
= -c
-g
-Os
$(INCLUDE_PATHS
) -Wall
-mthumb
-ffunction-sections
-fdata-sections
-fmessage-length
=0 -mcpu
=$(CPU_TYPE
) -DTARGET
=$(TARGET
) -fno-builtin
173 ASFLAGS
= -c
-g
-Os
$(INCLUDE_PATHS
) -Wall
-mthumb
-ffunction-sections
-fdata-sections
-fmessage-length
=0 -mcpu
=$(CPU_TYPE
) -D__ASSEMBLY__
-x assembler-with-cpp
176 LDFLAGS
= -nostartfiles
-mthumb
-mcpu
=$(CPU_TYPE
) -Wl
,--gc-sections
178 OCFLAGS
= --strip-unneeded
183 $(CC
) $(CFLAGS
) -o
$@
$<
186 $(AS
) $(ASFLAGS
) -o
$@
$<
188 firmware
: $(OBJS
) $(SYS_OBJS
)
189 -@echo
"MEMORY" > $(LD_TEMP
)
190 -@echo
"{" >> $(LD_TEMP
)
191 -@echo
" flash(rx): ORIGIN = 0x00000000, LENGTH = $(FLASH)" >> $(LD_TEMP
)
192 -@echo
" sram(rwx): ORIGIN = 0x10000000+$(SRAM_USB), LENGTH = $(SRAM)-$(SRAM_USB)" >> $(LD_TEMP
)
193 -@echo
"}" >> $(LD_TEMP
)
194 -@echo
"INCLUDE $(LD_SCRIPT)" >> $(LD_TEMP
)
195 $(LD
) $(LDFLAGS
) -T
$(LD_TEMP
) -o
$(OUTFILE
).elf
$(OBJS
) $(LDLIBS
)
197 $(SIZE
) $(OUTFILE
).elf
199 $(OBJCOPY
) $(OCFLAGS
) -O binary
$(OUTFILE
).elf
$(OUTFILE
).bin
200 $(OBJCOPY
) $(OCFLAGS
) -O ihex
$(OUTFILE
).elf
$(OUTFILE
).hex
202 $(LPCRC
) firmware.bin
205 rm -f
$(OBJS
) $(LD_TEMP
) $(OUTFILE
).elf
$(OUTFILE
).bin
$(OUTFILE
).hex