# IDE Flags (Keeps various IDEs happy)\r
##########################################################################\r
\r
-OPTDEFINES = -D __NEWLIB__\r
-\r
+#OPTDEFINES = -D __NEWLIB__ -DR0KET\r
+OPTDEFINES = -D __NEWLIB__ -DHOB_REV2\r
##########################################################################\r
# Project-specific files \r
##########################################################################\r
\r
SRCS = \\r
badge/main.c \\r
+ badge/init.c \\r
badge/jumpnrun/collision.c \\r
badge/jumpnrun/enemies.c \\r
badge/jumpnrun/items.c \\r
badge/jumpnrun/tiles.c \\r
badge/ui/display.c \\r
badge/ui/event.c \\r
+ badge/ui/font.c \\r
badge/ui/sprite.c\r
\r
SRCS += \\r
- dataflash/at45db041d.c \\r
dataflash/iobase.c \\r
- dataflash/diskio.c\r
+ dataflash/diskio.c \\r
+ dataflash/at45db041d.c\r
+\r
+SRCS += \\r
+ funk/nrf24l01p.c\r
\r
SRCS += \\r
project/commands.c\r
OBJCOPY = $(CROSS_COMPILE)objcopy\r
OBJDUMP = $(CROSS_COMPILE)objdump\r
OUTFILE = firmware\r
+\r
+CC_FOR_BUILD = gcc\r
LPCRC = ./lpcrc\r
\r
##########################################################################\r
dep: $(DEPS)\r
\r
$(DEPS) : %.dep : %.c\r
- $(CC) $(CPPFLAGS) $(CFLAGS) -MM $< -MT $@ -MT $(<:%.c=%.o) -MF $@\r
+ $(CC) $(CPPFLAGS) $(CFLAGS) -MM $< -MT $@ -MT $(@:%.dep=%.o) -MF $@\r
\r
sinclude $(DEPS)\r
\r
$(OUTFILE).elf: $(OBJS) $(LD_TEMP)\r
$(LD) $(LDFLAGS) -T $(LD_TEMP) -o $(OUTFILE).elf $(OBJS) $(LDLIBS)\r
\r
-$(OUTFILE).bin: $(OUTFILE).elf\r
+$(OUTFILE).bin: $(OUTFILE).elf $(LPCRC)\r
$(OBJCOPY) $(OCFLAGS) -O binary $(OUTFILE).elf $(OUTFILE).bin\r
$(LPCRC) $(OUTFILE).bin\r
\r
rm -f $(OBJS) $(LD_TEMP) $(OUTFILE).elf $(OUTFILE).bin $(OUTFILE).hex\r
\r
distclean: clean\r
- rm -f $(DEPS)\r
+ rm -f $(DEPS) $(LPCRC)\r
\r
.PHONY: all dep size clean distclean\r
+\r
+CFLAGS_FOR_BUILD = -Wall -Wextra -std=c99 -O0 -g\r
+\r
+LPCRC_SRCS = tools/lpcrc/lpcrc.c\r
+LPCRC_OBJS = $(LPCRC_SRCS:%.c=%.o)\r
+LPCRC_DEPS = $(LPCRC_SRCS:%.c=%.dep)\r
+\r
+$(LPCRC_DEPS) : %.dep : %.c\r
+ $(CC_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) -MM $< -MT $@ -MT $(@:%.dep=%.o) -MF $@\r
+\r
+$(LPCRC_OBJS): %.o : %.c\r
+ $(CC_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) -o $@ -c $<\r
+\r
+$(LPCRC): $(LPCRC_OBJS)\r
+ $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ $+ $(LDLIBS_FOR_BUILD)\r