aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAstatin <[email protected]>2025-06-18 19:46:59 +0200
committerAstatin <[email protected]>2025-06-18 19:46:59 +0200
commita82b9ba9e92a188fd2bf2be85384414a4121d119 (patch)
treeff34c98f6d08014036c785eb54f8e0ee234033d7 /Makefile
parent27617209a324f03a11faecc74392b048f08b45ae (diff)
Add build script for building a self containing linux executable
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile26
1 files changed, 23 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 2c502c5..e4330c9 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,6 @@
+GBASM=gbasm
+MAKESELF=makeself
+
all: run
.PHONY: clean sclean
@@ -24,11 +27,11 @@ build/main.rom: build/main.rom.unsigned
build/main.rom.unsigned: main.gbasm tileset.gbasm text.gbasm dialogues/text.gbasm map/maps.gbasm $(wildcard ./*.gbasm) $(wildcard ./**/*.gbasm) $(wildcard ./**/**/*.gbasm)
mkdir -p build
- gbasm $< $@ > build/main.sym
+ $(GBASM) $< $@ > build/main.sym
build/tileset-dump.rom: scripts/tileset-dump.gbasm
mkdir -p build
- gbasm $< $@ > /dev/null
+ $(GBASM) $< $@ > /dev/null
build/tileset-dump.rom.vram.dump: build/tileset-dump.rom
gb --skip-bootrom --stop-dump-state $<
@@ -36,6 +39,23 @@ build/tileset-dump.rom.vram.dump: build/tileset-dump.rom
build/tileset.png: build/tileset-dump.rom.vram.dump scripts/extract-vram-tileset.py
python scripts/extract-vram-tileset.py $< $@
+build/makeself/gb_linux-x86_64:
+ mkdir -p build/makeself
+ wget https://github.com/AstatinChan/gameboy-emulator/releases/download/latest/gb_linux-x86_64 -O $@
+ chmod +x $@
+
+build/makeself/main.rom: build/main.rom
+ mkdir -p build/makeself
+ cp $< $@
+
+build/makeself/start.sh: ./scripts/makeself-start.sh
+ mkdir -p build/makeself
+ cp $< $@
+ chmod +x $@
+
+build/game_linux_x86-64: build/makeself/start.sh build/makeself/main.rom build/makeself/gb_linux-x86_64
+ $(MAKESELF) ./build/makeself $@ "Astatin's Bunny Game" ./start.sh
+
run: build/main.rom
mkdir -p recordings
gb $< --record-input "./recordings/$(shell date -Iseconds).record"
@@ -51,5 +71,5 @@ clean:
sclean: clean
rm tileset.gbasm
- find . -name "*.gbtxt" | sed 's/\.gbtxt$/.gbasm/' | xargs rm
+ find . -name "*.gbtxt" | sed 's/\.gbtxt$$/.gbasm/' | xargs rm
rm map/maps/*.map.gbasm map/maps.gbasm