X-Git-Url: https://git.rohieb.name/hackover2013-badge-firmware.git/blobdiff_plain/43b7092bd42d639a527b32dae4af87e37528ef57..20c30c8c53dc90381bf24a56d4d5f98d407406dd:/Makefile diff --git a/Makefile b/Makefile index 789305a..78bfbf7 100644 --- a/Makefile +++ b/Makefile @@ -15,6 +15,14 @@ SRAM_USB = 384 VPATH = OBJS = main.o +########################################################################## +# Debug settings +########################################################################## + +# Set DEBUGBUILD to 'TRUE' for full debugging (larger, slower binaries), +# or to 'FALSE' for release builds (smallest, fastest binaries) +DEBUGBUILD = FALSE + ########################################################################## # Project-specific files ########################################################################## @@ -23,15 +31,16 @@ VPATH += project OBJS += commands.o VPATH += project/commands -OBJS += cmd_chibi_addr.o cmd_chibi_tx.o cmd_uart.o +OBJS += cmd_chibi_addr.o cmd_chibi_tx.o OBJS += cmd_i2ceeprom_read.o cmd_i2ceeprom_write.o cmd_lm75b_gettemp.o -OBJS += cmd_sysinfo.o cmd_sd_dir.o cmd_tswait.o cmd_orientation.o -OBJS += cmd_tsthreshhold.o cmd_backlight.o +OBJS += cmd_reset.o cmd_sd_dir.o cmd_sysinfo.o cmd_uart.o +OBJS += cmd_roundedcorner.o VPATH += project/commands/drawing -OBJS += cmd_button.o cmd_circle.o cmd_clear.o cmd_line.o cmd_pixel.o -OBJS += cmd_progress.o cmd_bmp.o cmd_gettext.o cmd_calibrate.o -OBJS += cmd_text.o cmd_textw.o cmd_rectangle.o +OBJS += cmd_backlight.o cmd_bmp.o cmd_button.o cmd_calibrate.o +OBJS += cmd_circle.o cmd_clear.o cmd_line.o cmd_orientation.o +OBJS += cmd_pixel.o cmd_progress.o cmd_rectangle.o cmd_text.o +OBJS += cmd_textw.o cmd_tsthreshhold.o cmd_tswait.o cmd_triangle.o ########################################################################## # Optional driver files @@ -59,10 +68,12 @@ VPATH += drivers/lcd/tft/dialogues OBJS += drawing.o touchscreen.o bmp.o alphanumeric.o OBJS += dejavusans9.o dejavusansbold9.o dejavusanscondensed9.o OBJS += dejavusansmono8.o dejavusansmonobold8.o -OBJS += veramono9.o veramonobold9.o veramono11.o veramonobold11.o +OBJS += verdana9.o verdana14.o verdanabold14.o + # LCD Driver (Only one can be included at a time!) OBJS += ILI9328.o # OBJS += ILI9325.o +# OBJS += ssd1331.o # OBJS += st7735.o # OBJS += st7783.o @@ -89,12 +100,16 @@ OBJS += mcp4725.o # RFID/NFC VPATH += drivers/sensors/pn532 -OBJS += pn532.o pn532_drvr_uart.o +OBJS += pn532.o # TAOS Light Sensors VPATH += drivers/sensors/tcs3414 drivers/sensors/tsl2561 OBJS += tcs3414.o tsl2561.o +# SPI Flash +VPATH += drivers/spiflash/w25q16bv +OBJS += w25q16bv.o + ########################################################################## # Library files ########################################################################## @@ -102,7 +117,7 @@ OBJS += tcs3414.o tsl2561.o VPATH += core core/adc core/cmd core/cpu core/gpio core/i2c core/pmu VPATH += core/ssp core/systick core/timer16 core/timer32 core/uart VPATH += core/usbhid-rom core/libc core/wdt core/usbcdc core/pwm -VPATH += core/IAP +VPATH += core/iap OBJS += adc.o cpu.o cmd.o gpio.o i2c.o pmu.o ssp.o systick.o timer16.o OBJS += timer32.o uart.o uart_buf.o usbconfig.o usbhid.o stdio.o string.o OBJS += wdt.o cdcuser.o cdc_buf.o usbcore.o usbdesc.o usbhw.o usbuser.o @@ -121,6 +136,7 @@ OBJCOPY = $(CROSS_COMPILE)objcopy OBJDUMP = $(CROSS_COMPILE)objdump OUTFILE = firmware LPCRC = ./lpcrc +CP = cp ########################################################################## # GNU GCC compiler flags @@ -149,9 +165,14 @@ OBJS += $(TARGET)_handlers.o LPC1xxx_startup.o ########################################################################## # Compiler settings, parameters and flags ########################################################################## +ifeq (TRUE,$(DEBUGBUILD)) + CFLAGS = -c -g -O0 $(INCLUDE_PATHS) -Wall -mthumb -ffunction-sections -fdata-sections -fmessage-length=0 -mcpu=$(CPU_TYPE) -DTARGET=$(TARGET) -fno-builtin + ASFLAGS = -c -g -O0 $(INCLUDE_PATHS) -Wall -mthumb -ffunction-sections -fdata-sections -fmessage-length=0 -mcpu=$(CPU_TYPE) -D__ASSEMBLY__ -x assembler-with-cpp +else + CFLAGS = -c -g -Os $(INCLUDE_PATHS) -Wall -mthumb -ffunction-sections -fdata-sections -fmessage-length=0 -mcpu=$(CPU_TYPE) -DTARGET=$(TARGET) -fno-builtin + ASFLAGS = -c -g -Os $(INCLUDE_PATHS) -Wall -mthumb -ffunction-sections -fdata-sections -fmessage-length=0 -mcpu=$(CPU_TYPE) -D__ASSEMBLY__ -x assembler-with-cpp +endif -CFLAGS = -c -g -Os $(INCLUDE_PATHS) -Wall -mthumb -ffunction-sections -fdata-sections -fmessage-length=0 -mcpu=$(CPU_TYPE) -DTARGET=$(TARGET) -fno-builtin -ASFLAGS = -c -g -Os $(INCLUDE_PATHS) -Wall -mthumb -ffunction-sections -fdata-sections -fmessage-length=0 -mcpu=$(CPU_TYPE) -D__ASSEMBLY__ -x assembler-with-cpp LDFLAGS = -nostartfiles -mthumb -mcpu=$(CPU_TYPE) -Wl,--gc-sections LDLIBS = -lm OCFLAGS = --strip-unneeded