aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2020-02-15 13:00:29 +0000
committerrodri <rgl@antares-labs.eu>2020-02-15 13:00:29 +0000
commit606c1541d87e9f5e164794ed3439403da3e82ed5 (patch)
tree1f5ef2f7079cdaa671c717751ed456de9cde8530
parent5a3198e108fc868da57a002abaca9a4db28d096b (diff)
downloadgbadev-606c1541d87e9f5e164794ed3439403da3e82ed5.tar.gz
gbadev-606c1541d87e9f5e164794ed3439403da3e82ed5.tar.bz2
gbadev-606c1541d87e9f5e164794ed3439403da3e82ed5.zip
add a makefile and some instructions.
-rw-r--r--Makefile37
-rw-r--r--readme9
2 files changed, 46 insertions, 0 deletions
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
diff --git a/readme b/readme
new file mode 100644
index 0000000..80186cc
--- /dev/null
+++ b/readme
@@ -0,0 +1,9 @@
+Install devkitpro's devkitARM, the devkitarm-rules and devkitarm-crtls
+files, and set DEVKITPRO to the path where you installed it.
+After that, arm-none-eabi* should resolve to the tools in this kit
+with the proper files in place, not the one in the system.
+
+If all goes well:
+ make && vba *.gba
+
+Have fun!