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
30 VPATH
+= project
/commands
/drawing
31 OBJS
+= cmd_backlight.o cmd_bmp.o cmd_button.o cmd_calibrate.o
32 OBJS
+= cmd_circle.o cmd_clear.o cmd_line.o cmd_orientation.o
33 OBJS
+= cmd_pixel.o cmd_progress.o cmd_rectangle.o cmd_text.o
34 OBJS
+= cmd_textw.o cmd_tsthreshhold.o cmd_tswait.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
/rtc
/isl12022m
57 VPATH
+= drivers
/lcd
/tft drivers
/lcd
/tft
/hw drivers
/lcd
/tft
/fonts
58 VPATH
+= drivers
/lcd
/tft
/dialogues
59 OBJS
+= drawing.o touchscreen.o bmp.o alphanumeric.o
60 OBJS
+= dejavusans9.o dejavusansbold9.o dejavusanscondensed9.o
61 OBJS
+= dejavusansmono8.o dejavusansmonobold8.o
62 OBJS
+= veramono9.o veramonobold9.o veramono11.o veramonobold11.o
64 # LCD Driver (Only one can be included at a time!)
71 # Bitmap/Monochrome LCD support (ST7565, SSD1306, etc.)
72 VPATH
+= drivers
/lcd drivers
/lcd
/bitmap
/st7565
73 VPATH
+= drivers
/lcd
/bitmap
/ssd1306
74 OBJS
+= smallfonts.o st7565.o ssd1306.o
76 # ChaN FatFS and SD card support
77 VPATH
+= drivers
/fatfs
81 VPATH
+= drivers
/motor
/stepper
84 # RSA Encryption/Descryption
89 VPATH
+= drivers
/dac
/mcp4725
93 VPATH
+= drivers
/sensors
/pn532
94 OBJS
+= pn532.o pn532_drvr_uart.o
97 VPATH
+= drivers
/sensors
/tcs3414 drivers
/sensors
/tsl2561
98 OBJS
+= tcs3414.o tsl2561.o
100 ##########################################################################
102 ##########################################################################
104 VPATH
+= core core
/adc core
/cmd core
/cpu core
/gpio core
/i2c core
/pmu
105 VPATH
+= core
/ssp core
/systick core
/timer16 core
/timer32 core
/uart
106 VPATH
+= core
/usbhid-rom core
/libc core
/wdt core
/usbcdc core
/pwm
108 OBJS
+= adc.o cpu.o cmd.o gpio.o i2c.o pmu.o ssp.o systick.o timer16.o
109 OBJS
+= timer32.o uart.o uart_buf.o usbconfig.o usbhid.o stdio.o string.o
110 OBJS
+= wdt.o cdcuser.o cdc_buf.o usbcore.o usbdesc.o usbhw.o usbuser.o
111 OBJS
+= sysinit.o pwm.o iap.o
113 ##########################################################################
114 # GNU GCC compiler prefix and location
115 ##########################################################################
117 CROSS_COMPILE
= arm-none-eabi-
118 AS
= $(CROSS_COMPILE
)gcc
119 CC
= $(CROSS_COMPILE
)gcc
120 LD
= $(CROSS_COMPILE
)gcc
121 SIZE
= $(CROSS_COMPILE
)size
122 OBJCOPY
= $(CROSS_COMPILE
)objcopy
123 OBJDUMP
= $(CROSS_COMPILE
)objdump
127 ##########################################################################
128 # GNU GCC compiler flags
129 ##########################################################################
131 INCLUDE_PATHS
= -I
$(ROOT_PATH
) -I
$(ROOT_PATH
)/project
133 ##########################################################################
135 ##########################################################################
138 LD_SCRIPT
= $(LD_PATH
)/linkscript.
ld
139 LD_TEMP
= $(LD_PATH
)/memory.
ld
141 ifeq (LPC11xx
,$(TARGET
))
147 CPU_TYPE
= cortex-
$(CORTEX_TYPE
)
149 OBJS
+= $(TARGET
)_handlers.o LPC1xxx_startup.o
151 ##########################################################################
152 # Compiler settings, parameters and flags
153 ##########################################################################
155 CFLAGS
= -c
-g
-Os
$(INCLUDE_PATHS
) -Wall
-mthumb
-ffunction-sections
-fdata-sections
-fmessage-length
=0 -mcpu
=$(CPU_TYPE
) -DTARGET
=$(TARGET
) -fno-builtin
156 ASFLAGS
= -c
-g
-Os
$(INCLUDE_PATHS
) -Wall
-mthumb
-ffunction-sections
-fdata-sections
-fmessage-length
=0 -mcpu
=$(CPU_TYPE
) -D__ASSEMBLY__
-x assembler-with-cpp
157 LDFLAGS
= -nostartfiles
-mthumb
-mcpu
=$(CPU_TYPE
) -Wl
,--gc-sections
159 OCFLAGS
= --strip-unneeded
164 $(CC
) $(CFLAGS
) -o
$@
$<
167 $(AS
) $(ASFLAGS
) -o
$@
$<
169 firmware
: $(OBJS
) $(SYS_OBJS
)
170 -@echo
"MEMORY" > $(LD_TEMP
)
171 -@echo
"{" >> $(LD_TEMP
)
172 -@echo
" flash(rx): ORIGIN = 0x00000000, LENGTH = $(FLASH)" >> $(LD_TEMP
)
173 -@echo
" sram(rwx): ORIGIN = 0x10000000+$(SRAM_USB), LENGTH = $(SRAM)-$(SRAM_USB)" >> $(LD_TEMP
)
174 -@echo
"}" >> $(LD_TEMP
)
175 -@echo
"INCLUDE $(LD_SCRIPT)" >> $(LD_TEMP
)
176 $(LD
) $(LDFLAGS
) -T
$(LD_TEMP
) -o
$(OUTFILE
).elf
$(OBJS
) $(LDLIBS
)
178 $(SIZE
) $(OUTFILE
).elf
180 $(OBJCOPY
) $(OCFLAGS
) -O binary
$(OUTFILE
).elf
$(OUTFILE
).bin
181 $(OBJCOPY
) $(OCFLAGS
) -O ihex
$(OUTFILE
).elf
$(OUTFILE
).hex
183 $(LPCRC
) firmware.bin
186 rm -f
$(OBJS
) $(LD_TEMP
) $(OUTFILE
).elf
$(OUTFILE
).bin
$(OUTFILE
).hex