From 606c1541d87e9f5e164794ed3439403da3e82ed5 Mon Sep 17 00:00:00 2001 From: rodri Date: Sat, 15 Feb 2020 13:00:29 +0000 Subject: add a makefile and some instructions. --- Makefile | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..8c61b36 --- /dev/null +++ b/Makefile @@ -0,0 +1,37 @@ +CC=arm-none-eabi-gcc +OBJCOPY=arm-none-eabi-objcopy +CFLAGS=-Wall -fno-diagnostics-color -c +ARCH=-mthumb -mthumb-interwork +SPECS=-specs=gba.specs +O=o +BIN=$(HOME)/bin + +TARG=adventure +OFILES=\ + main.$O\ + +HFILES=\ + dat.h\ + regs.h\ + +.PHONY: all install uninstall clean +all: $(TARG) + +%.$O: %.c + $(CC) $(ARCH) $(CFLAGS) $< + +$(OFILES): $(HFILES) + +$(TARG): $(OFILES) + $(CC) $(SPECS) $(ARCH) -o $@ $< $(LIBS) $(LDFLAGS) + $(OBJCOPY) -O binary $@ $@.gba + gbafix $@.gba + +install: $(TARG) + cp $(TARG) $(BIN)/ + +uninstall: + rm -f $(BIN)/$(TARG) + +clean: + rm $(OFILES) $(TARG) *.gba -- cgit v1.2.3