X-Git-Url: https://git.rohieb.name/hackover2013-badge-firmware.git/blobdiff_plain/83cbcb4103e4756b8ed1fc67770fad8e5d05696c..2fb9f70df407a731f55952a7e70eea641ad275d9:/Makefile diff --git a/Makefile b/Makefile index ef3b99f..9d1938d 100644 --- a/Makefile +++ b/Makefile @@ -24,21 +24,33 @@ DEBUGBUILD = FALSE # IDE Flags (Keeps various IDEs happy) ########################################################################## -OPTDEFINES = -D __NEWLIB__ - +#OPTDEFINES = -D __NEWLIB__ -DR0KET +OPTDEFINES = -D __NEWLIB__ -DHOB_REV2 ########################################################################## # Project-specific files ########################################################################## SRCS = \ badge/main.c \ + badge/init.c \ + badge/jumpnrun/collision.c \ + badge/jumpnrun/enemies.c \ + badge/jumpnrun/items.c \ + badge/jumpnrun/jumpnrun.c \ + badge/jumpnrun/level_load.c \ + badge/jumpnrun/tiles.c \ badge/ui/display.c \ + badge/ui/event.c \ + badge/ui/font.c \ badge/ui/sprite.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 @@ -253,6 +265,8 @@ SIZE = $(CROSS_COMPILE)size OBJCOPY = $(CROSS_COMPILE)objcopy OBJDUMP = $(CROSS_COMPILE)objdump OUTFILE = firmware + +CC_FOR_BUILD = gcc LPCRC = ./lpcrc ########################################################################## @@ -304,7 +318,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) @@ -319,7 +333,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 @@ -333,6 +347,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)