X-Git-Url: http://git.rohieb.name/hackover2013-badge-firmware.git/blobdiff_plain/fc45fce2847ac18bbbbe4c11bd34141f5a17def2..b2d84a4b240edc1e4e15793180529eacce45cec8:/Makefile diff --git a/Makefile b/Makefile index 99cefca..6a0817a 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,7 @@ SRAM = 8K # For USB HID support the LPC134x reserves 384 bytes from the sram, # if you don't want to use the USB features, just use 0 here. SRAM_USB = 384 +#SRAM_USB = 0 ########################################################################## # Debug settings @@ -24,28 +25,45 @@ DEBUGBUILD = FALSE # IDE Flags (Keeps various IDEs happy) ########################################################################## -OPTDEFINES = -D __NEWLIB__ - +OPTDEFINES = -D__NEWLIB__ +#OPTDEFINES += -DR0KET +OPTDEFINES += -DHOB_REV2 +#OPTDEFINES += -DUSBONLY ########################################################################## # Project-specific files ########################################################################## SRCS = \ + badge/fahrplan.c \ + badge/init.c \ badge/main.c \ badge/jumpnrun/collision.c \ badge/jumpnrun/enemies.c \ + badge/jumpnrun/game_state.c \ badge/jumpnrun/items.c \ badge/jumpnrun/jumpnrun.c \ badge/jumpnrun/level_load.c \ + badge/jumpnrun/player.c \ + badge/jumpnrun/render.c \ + badge/jumpnrun/shots.c \ + badge/jumpnrun/starter.c \ + badge/jumpnrun/stats.c \ badge/jumpnrun/tiles.c \ + badge/ui/browser.c \ badge/ui/display.c \ badge/ui/event.c \ - badge/ui/sprite.c + badge/ui/font.c \ + badge/ui/menu.c \ + badge/ui/sprite.c \ + badge/ui/vanity.c SRCS += \ - dataflash/at45db041d.c \ dataflash/iobase.c \ - dataflash/diskio.c + dataflash/diskio.c \ + dataflash/at45db041d.c + +SRCS += \ + funk/nrf24l01p.c SRCS += \ project/commands.c @@ -225,7 +243,6 @@ SRCS += \ core/cmd/cmd.c \ core/cpu/cpu.c \ core/gpio/gpio.c \ - core/i2c/i2c.c \ core/iap/iap.c \ core/libc/stdio.c \ core/libc/string.c \ @@ -235,8 +252,6 @@ SRCS += \ core/systick/systick.c \ core/timer16/timer16.c \ core/timer32/timer32.c \ - core/uart/uart_buf.c \ - core/uart/uart.c \ core/usbcdc/cdc_buf.c \ core/usbcdc/cdcuser.c \ core/usbcdc/usbcore.c \ @@ -248,6 +263,10 @@ SRCS += \ core/usbhid-rom/usbmsc.c \ core/wdt/wdt.c +# core/i2c/i2c.c +# core/uart/uart_buf.c +# core/uart/uart.c + ########################################################################## # GNU GCC compiler prefix and location ########################################################################## @@ -260,6 +279,8 @@ SIZE = $(CROSS_COMPILE)size OBJCOPY = $(CROSS_COMPILE)objcopy OBJDUMP = $(CROSS_COMPILE)objdump OUTFILE = firmware + +CC_FOR_BUILD = gcc LPCRC = ./lpcrc ########################################################################## @@ -311,7 +332,7 @@ all: dep size $(OUTFILE).bin $(OUTFILE).hex dep: $(DEPS) $(DEPS) : %.dep : %.c - $(CC) $(CPPFLAGS) $(CFLAGS) -MM $< -MT $@ -MT $(<:%.c=%.o) -MF $@ + $(CC) $(CPPFLAGS) $(CFLAGS) -MM $< -MT $@ -MT $(@:%.dep=%.o) -MF $@ sinclude $(DEPS) @@ -326,7 +347,7 @@ $(LD_TEMP): $(OUTFILE).elf: $(OBJS) $(LD_TEMP) $(LD) $(LDFLAGS) -T $(LD_TEMP) -o $(OUTFILE).elf $(OBJS) $(LDLIBS) -$(OUTFILE).bin: $(OUTFILE).elf +$(OUTFILE).bin: $(OUTFILE).elf $(LPCRC) $(OBJCOPY) $(OCFLAGS) -O binary $(OUTFILE).elf $(OUTFILE).bin $(LPCRC) $(OUTFILE).bin @@ -340,6 +361,21 @@ clean: rm -f $(OBJS) $(LD_TEMP) $(OUTFILE).elf $(OUTFILE).bin $(OUTFILE).hex distclean: clean - rm -f $(DEPS) + rm -f $(DEPS) $(LPCRC) .PHONY: all dep size clean distclean + +CFLAGS_FOR_BUILD = -Wall -Wextra -std=c99 -O0 -g + +LPCRC_SRCS = tools/lpcrc/lpcrc.c +LPCRC_OBJS = $(LPCRC_SRCS:%.c=%.o) +LPCRC_DEPS = $(LPCRC_SRCS:%.c=%.dep) + +$(LPCRC_DEPS) : %.dep : %.c + $(CC_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) -MM $< -MT $@ -MT $(@:%.dep=%.o) -MF $@ + +$(LPCRC_OBJS): %.o : %.c + $(CC_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) -o $@ -c $< + +$(LPCRC): $(LPCRC_OBJS) + $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ $+ $(LDLIBS_FOR_BUILD)