summaryrefslogtreecommitdiff
path: root/chapter31/graphics.mk
diff options
context:
space:
mode:
authorCliff Click <cliffc@acm.org>2026-11-12 13:16:00 -0800
committerCliff Click <cliffc@acm.org>2026-11-12 13:52:46 -0800
commit467338ee01565234762db8077c067df42c3b40a8 (patch)
tree42c44a77da87c4811b1eb7611d0952dc2c55e022 /chapter31/graphics.mk
parent0720fd8ed0aa92248622a9f3c3ebd522b002fd91 (diff)
downloadSimple-467338ee01565234762db8077c067df42c3b40a8.tar.gz
Simple-467338ee01565234762db8077c067df42c3b40a8.zip
Add audio, overhaul makefiles
Adds simple audio support to Simple Overhaul makefiles; remove common boilerplate; make them more uniform
Diffstat (limited to 'chapter31/graphics.mk')
-rw-r--r--chapter31/graphics.mk20
1 files changed, 12 insertions, 8 deletions
diff --git a/chapter31/graphics.mk b/chapter31/graphics.mk
index 719c5fcd..9ede649d 100644
--- a/chapter31/graphics.mk
+++ b/chapter31/graphics.mk
@@ -1,7 +1,8 @@
# Optional MiniFB build, pinned independently of Simple's default build.
# A C-only GDI/X11 subset: no OpenGL, C++ wrapper, examples, or CMake required.
MINIFB_REV := f92be8e966f194004853c10196e704f4510f58d4
-MINIFB_SRC := build/deps/minifb
+MINIFB_SRC := lib/minifb-$(MINIFB_REV)
+MINIFB_ARCHIVE := lib/minifb-$(MINIFB_REV).tar.gz
MINIFB_STAMP := $(MINIFB_SRC)/.simple-$(MINIFB_REV)
MINIFB_COMMON := MiniFB_common MiniFB_cpu_x86 MiniFB_internal MiniFB_stretch \
MiniFB_stretch_sse2 MiniFB_stretch_avx2 MiniFB_stretch_neon MiniFB_timer MiniFB_utf8
@@ -29,15 +30,18 @@ graphical-tictactoe: $(GRAPHICAL_TICTACTOE)
$(GRAPHICAL_TICTACTOE): docs/examples/TicTacToeGraphical.smp $(CLZDIR)/test/.ttag $(RELEASE_SYS) $(RELEASE_CRT) graphics.mk
@$(JVM) com.seaofnodes.simple.Simple --link --cpu $(CPU_PORT) --abi $(CALL_CONV) -L $(dir $(RELEASE_SYS)) -o $(GAME_DIR)/TicTacToeGraphical.o $<
-run-graphical-tictactoe: graphics graphical-tictactoe
- SIMPLE_MINIFB="$(abspath $(GRAPHICS_LIB))" $(GRAPHICAL_TICTACTOE)
+run-graphical-tictactoe: graphics audio graphical-tictactoe
+ SIMPLE_MINIFB="$(abspath $(GRAPHICS_LIB))" SIMPLE_MINIAUDIO="$(abspath $(AUDIO_LIB))" $(GRAPHICAL_TICTACTOE)
graphics: $(GRAPHICS_LIB)
-$(MINIFB_STAMP): graphics.mk
- @mkdir -p $(dir $(MINIFB_SRC))
- @test -d $(MINIFB_SRC)/.git || git clone --no-checkout https://github.com/emoon/minifb.git $(MINIFB_SRC)
- @git -C $(MINIFB_SRC) fetch --depth 1 origin $(MINIFB_REV)
- @git -C $(MINIFB_SRC) checkout --detach $(MINIFB_REV)
+lib libs init: $(MINIFB_STAMP)
+
+$(MINIFB_ARCHIVE):
+ @$(call download-library,https://codeload.github.com/emoon/minifb/tar.gz/$(MINIFB_REV))
+
+$(MINIFB_STAMP): $(MINIFB_ARCHIVE)
+ @mkdir -p $(MINIFB_SRC)
+ @tar -xzf $< --strip-components=1 -C $(MINIFB_SRC)
@touch $@
$(GRAPHICS_LIB): $(MINIFB_STAMP) src/main/c/simple_minifb.c src/main/c/simple_graphics.h graphics.mk