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
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
/lcd
/tft drivers
/lcd
/tft
/hw drivers
/lcd
/tft
/fonts
54 VPATH
+= drivers
/lcd
/tft
/dialogues
55 OBJS
+= drawing.o touchscreen.o bmp.o alphanumeric.o
56 OBJS
+= dejavusans9.o dejavusansbold9.o dejavusanscondensed9.o
57 OBJS
+= dejavusansmono8.o dejavusansmonobold8.o
58 OBJS
+= veramono9.o veramonobold9.o veramono11.o veramonobold11.o
59 # LCD Driver (Only one can be included at a time!)
65 # Bitmap/Monochrome LCD support (ST7565, SSD1306, etc.)
66 VPATH
+= drivers
/lcd drivers
/lcd
/bitmap
/st7565
67 VPATH
+= drivers
/lcd
/bitmap
/ssd1306
68 OBJS
+= smallfonts.o st7565.o ssd1306.o
70 # ChaN FatFS and SD card support
71 VPATH
+= drivers
/fatfs
75 VPATH
+= drivers
/motor
/stepper
78 # RSA Encryption/Descryption
83 VPATH
+= drivers
/dac
/mcp4725
87 VPATH
+= drivers
/sensors
/pn532
88 OBJS
+= pn532.o pn532_drvr_uart.o
91 VPATH
+= drivers
/sensors
/tcs3414 drivers
/sensors
/tsl2561
92 OBJS
+= tcs3414.o tsl2561.o
94 ##########################################################################
96 ##########################################################################
98 VPATH
+= core core
/adc core
/cmd core
/cpu core
/gpio core
/i2c core
/pmu
99 VPATH
+= core
/ssp core
/systick core
/timer16 core
/timer32 core
/uart
100 VPATH
+= core
/usbhid-rom core
/libc core
/wdt core
/usbcdc core
/pwm
102 OBJS
+= adc.o cpu.o cmd.o gpio.o i2c.o pmu.o ssp.o systick.o timer16.o
103 OBJS
+= timer32.o uart.o uart_buf.o usbconfig.o usbhid.o stdio.o string.o
104 OBJS
+= wdt.o cdcuser.o cdc_buf.o usbcore.o usbdesc.o usbhw.o usbuser.o
105 OBJS
+= sysinit.o pwm.o iap.o
107 ##########################################################################
108 # GNU GCC compiler prefix and location
109 ##########################################################################
111 CROSS_COMPILE
= arm-none-eabi-
112 AS
= $(CROSS_COMPILE
)gcc
113 CC
= $(CROSS_COMPILE
)gcc
114 LD
= $(CROSS_COMPILE
)gcc
115 SIZE
= $(CROSS_COMPILE
)size
116 OBJCOPY
= $(CROSS_COMPILE
)objcopy
117 OBJDUMP
= $(CROSS_COMPILE
)objdump
121 ##########################################################################
122 # GNU GCC compiler flags
123 ##########################################################################
125 INCLUDE_PATHS
= -I
$(ROOT_PATH
) -I
$(ROOT_PATH
)/project
127 ##########################################################################
129 ##########################################################################
132 LD_SCRIPT
= $(LD_PATH
)/linkscript.
ld
133 LD_TEMP
= $(LD_PATH
)/memory.
ld
135 ifeq (LPC11xx
,$(TARGET
))
141 CPU_TYPE
= cortex-
$(CORTEX_TYPE
)
143 OBJS
+= $(TARGET
)_handlers.o LPC1xxx_startup.o
145 ##########################################################################
146 # Compiler settings, parameters and flags
147 ##########################################################################
149 CFLAGS
= -c
-g
-Os
$(INCLUDE_PATHS
) -Wall
-mthumb
-ffunction-sections
-fdata-sections
-fmessage-length
=0 -mcpu
=$(CPU_TYPE
) -DTARGET
=$(TARGET
) -fno-builtin
150 ASFLAGS
= -c
-g
-Os
$(INCLUDE_PATHS
) -Wall
-mthumb
-ffunction-sections
-fdata-sections
-fmessage-length
=0 -mcpu
=$(CPU_TYPE
) -D__ASSEMBLY__
-x assembler-with-cpp
151 LDFLAGS
= -nostartfiles
-mthumb
-mcpu
=$(CPU_TYPE
) -Wl
,--gc-sections
153 OCFLAGS
= --strip-unneeded
158 $(CC
) $(CFLAGS
) -o
$@
$<
161 $(AS
) $(ASFLAGS
) -o
$@
$<
163 firmware
: $(OBJS
) $(SYS_OBJS
)
164 -@echo
"MEMORY" > $(LD_TEMP
)
165 -@echo
"{" >> $(LD_TEMP
)
166 -@echo
" flash(rx): ORIGIN = 0x00000000, LENGTH = $(FLASH)" >> $(LD_TEMP
)
167 -@echo
" sram(rwx): ORIGIN = 0x10000000+$(SRAM_USB), LENGTH = $(SRAM)-$(SRAM_USB)" >> $(LD_TEMP
)
168 -@echo
"}" >> $(LD_TEMP
)
169 -@echo
"INCLUDE $(LD_SCRIPT)" >> $(LD_TEMP
)
170 $(LD
) $(LDFLAGS
) -T
$(LD_TEMP
) -o
$(OUTFILE
).elf
$(OBJS
) $(LDLIBS
)
172 $(SIZE
) $(OUTFILE
).elf
174 $(OBJCOPY
) $(OCFLAGS
) -O binary
$(OUTFILE
).elf
$(OUTFILE
).bin
175 $(OBJCOPY
) $(OCFLAGS
) -O ihex
$(OUTFILE
).elf
$(OUTFILE
).hex
177 $(LPCRC
) firmware.bin
180 rm -f
$(OBJS
) $(LD_TEMP
) $(OUTFILE
).elf
$(OUTFILE
).bin
$(OUTFILE
).hex