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
27 OBJS
+= cmd_i2ceeprom_read.o cmd_i2ceeprom_write.o cmd_lm75b_gettemp.o
28 OBJS
+= cmd_reset.o cmd_sd_dir.o cmd_sysinfo.o cmd_uart.o
29 OBJS
+= cmd_roundedcorner.o
31 VPATH
+= project
/commands
/drawing
32 OBJS
+= cmd_backlight.o cmd_bmp.o cmd_button.o cmd_calibrate.o
33 OBJS
+= cmd_circle.o cmd_clear.o cmd_line.o cmd_orientation.o
34 OBJS
+= cmd_pixel.o cmd_progress.o cmd_rectangle.o cmd_text.o
35 OBJS
+= cmd_textw.o cmd_tsthreshhold.o cmd_tswait.o cmd_triangle.o
37 ##########################################################################
38 # Optional driver files
39 ##########################################################################
41 # Chibi Light-Weight Wireless Stack (AT86RF212)
42 VPATH
+= drivers
/chibi
43 OBJS
+= chb.o chb_buf.o chb_drvr.o chb_eeprom.o chb_spi.o
46 VPATH
+= drivers
/eeprom drivers
/eeprom
/mcp24aa
47 OBJS
+= eeprom.o mcp24aa.o
49 # LM75B temperature sensor
50 VPATH
+= drivers
/sensors
/lm75b
54 VPATH
+= drivers
/rtc
/isl12022m
58 VPATH
+= drivers
/lcd
/tft drivers
/lcd
/tft
/hw drivers
/lcd
/tft
/fonts
59 VPATH
+= drivers
/lcd
/tft
/dialogues
60 OBJS
+= drawing.o touchscreen.o bmp.o alphanumeric.o
61 OBJS
+= dejavusans9.o dejavusansbold9.o dejavusanscondensed9.o
62 OBJS
+= dejavusansmono8.o dejavusansmonobold8.o
63 OBJS
+= verdana9.o verdana14.o verdanabold14.o
65 # LCD Driver (Only one can be included at a time!)
72 # Bitmap/Monochrome LCD support (ST7565, SSD1306, etc.)
73 VPATH
+= drivers
/lcd drivers
/lcd
/bitmap
/st7565
74 VPATH
+= drivers
/lcd
/bitmap
/ssd1306
75 OBJS
+= smallfonts.o st7565.o ssd1306.o
77 # ChaN FatFS and SD card support
78 VPATH
+= drivers
/fatfs
82 VPATH
+= drivers
/motor
/stepper
85 # RSA Encryption/Descryption
90 VPATH
+= drivers
/dac
/mcp4725
94 VPATH
+= drivers
/sensors
/pn532
98 VPATH
+= drivers
/sensors
/tcs3414 drivers
/sensors
/tsl2561
99 OBJS
+= tcs3414.o tsl2561.o
102 VPATH
+= drivers
/spiflash
/w25q16bv
105 ##########################################################################
107 ##########################################################################
109 VPATH
+= core core
/adc core
/cmd core
/cpu core
/gpio core
/i2c core
/pmu
110 VPATH
+= core
/ssp core
/systick core
/timer16 core
/timer32 core
/uart
111 VPATH
+= core
/usbhid-rom core
/libc core
/wdt core
/usbcdc core
/pwm
113 OBJS
+= adc.o cpu.o cmd.o gpio.o i2c.o pmu.o ssp.o systick.o timer16.o
114 OBJS
+= timer32.o uart.o uart_buf.o usbconfig.o usbhid.o stdio.o string.o
115 OBJS
+= wdt.o cdcuser.o cdc_buf.o usbcore.o usbdesc.o usbhw.o usbuser.o
116 OBJS
+= sysinit.o pwm.o iap.o
118 ##########################################################################
119 # GNU GCC compiler prefix and location
120 ##########################################################################
122 CROSS_COMPILE
= arm-none-eabi-
123 AS
= $(CROSS_COMPILE
)gcc
124 CC
= $(CROSS_COMPILE
)gcc
125 LD
= $(CROSS_COMPILE
)gcc
126 SIZE
= $(CROSS_COMPILE
)size
127 OBJCOPY
= $(CROSS_COMPILE
)objcopy
128 OBJDUMP
= $(CROSS_COMPILE
)objdump
133 ##########################################################################
134 # GNU GCC compiler flags
135 ##########################################################################
137 INCLUDE_PATHS
= -I
$(ROOT_PATH
) -I
$(ROOT_PATH
)/project
139 ##########################################################################
141 ##########################################################################
144 LD_SCRIPT
= $(LD_PATH
)/linkscript.
ld
145 LD_TEMP
= $(LD_PATH
)/memory.
ld
147 ifeq (LPC11xx
,$(TARGET
))
153 CPU_TYPE
= cortex-
$(CORTEX_TYPE
)
155 OBJS
+= $(TARGET
)_handlers.o LPC1xxx_startup.o
157 ##########################################################################
158 # Compiler settings, parameters and flags
159 ##########################################################################
161 CFLAGS
= -c
-g
-Os
$(INCLUDE_PATHS
) -Wall
-mthumb
-ffunction-sections
-fdata-sections
-fmessage-length
=0 -mcpu
=$(CPU_TYPE
) -DTARGET
=$(TARGET
) -fno-builtin
162 ASFLAGS
= -c
-g
-Os
$(INCLUDE_PATHS
) -Wall
-mthumb
-ffunction-sections
-fdata-sections
-fmessage-length
=0 -mcpu
=$(CPU_TYPE
) -D__ASSEMBLY__
-x assembler-with-cpp
163 LDFLAGS
= -nostartfiles
-mthumb
-mcpu
=$(CPU_TYPE
) -Wl
,--gc-sections
165 OCFLAGS
= --strip-unneeded
170 $(CC
) $(CFLAGS
) -o
$@
$<
173 $(AS
) $(ASFLAGS
) -o
$@
$<
175 firmware
: $(OBJS
) $(SYS_OBJS
)
176 -@echo
"MEMORY" > $(LD_TEMP
)
177 -@echo
"{" >> $(LD_TEMP
)
178 -@echo
" flash(rx): ORIGIN = 0x00000000, LENGTH = $(FLASH)" >> $(LD_TEMP
)
179 -@echo
" sram(rwx): ORIGIN = 0x10000000+$(SRAM_USB), LENGTH = $(SRAM)-$(SRAM_USB)" >> $(LD_TEMP
)
180 -@echo
"}" >> $(LD_TEMP
)
181 -@echo
"INCLUDE $(LD_SCRIPT)" >> $(LD_TEMP
)
182 $(LD
) $(LDFLAGS
) -T
$(LD_TEMP
) -o
$(OUTFILE
).elf
$(OBJS
) $(LDLIBS
)
184 $(SIZE
) $(OUTFILE
).elf
186 $(OBJCOPY
) $(OCFLAGS
) -O binary
$(OUTFILE
).elf
$(OUTFILE
).bin
187 $(OBJCOPY
) $(OCFLAGS
) -O ihex
$(OUTFILE
).elf
$(OUTFILE
).hex
189 $(LPCRC
) firmware.bin
192 rm -f
$(OBJS
) $(LD_TEMP
) $(OUTFILE
).elf
$(OUTFILE
).bin
$(OUTFILE
).hex