summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAlexander M Pickering <alex@cogarr.net>2024-12-09 16:44:32 -0600
committerAlexander M Pickering <alex@cogarr.net>2024-12-09 16:44:32 -0600
commit541ef6aaee248626c1a1c6e0db05f5980d09c7a5 (patch)
tree44ff154cb2f33843bb4ded69bdaa2e6461674173 /Makefile
downloadggj25-541ef6aaee248626c1a1c6e0db05f5980d09c7a5.tar.gz
ggj25-541ef6aaee248626c1a1c6e0db05f5980d09c7a5.tar.bz2
ggj25-541ef6aaee248626c1a1c6e0db05f5980d09c7a5.zip
Inital commit
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile51
1 files changed, 51 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..9c4bcf4
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,51 @@
+
+LUA?="$(shell where lua | head -n 1)"
+CP?=cp
+AMULET?="$(shell where amulet | head -n 1)"
+RM?=rm
+UNZIP?=7z x -y
+CD?=cd
+MOONC?="$(shell where moonc | head -n 1)"
+BUSTED?="$(shell where busted | head -n 1)"
+
+src_moon=$(wildcard src/*.moon)
+built_moon=$(src_moon:src/%.moon=data/%.lua)
+dbg_moon=$(src_moon:src/%.moon=data/%.lua.X)
+
+src_tl=$(wildcard src/*.tl)
+built_tl=$(src_tl:src/%.tl=data/%.lua)
+
+src_lua=$(wildcard src/*.lua)
+built_lua=$(src_lua:src/%.lua=data/%.lua)
+
+src_js=$(wildcard src/*.js)
+built_js=$(src_js:src/%.js=data/%.lua)
+
+built=$(built_moon) $(built_tl) $(built_lua) $(built_js)
+built_dbg=$(built) $(dbg_moon)
+
+all: $(built_dbg)
+ $(AMULET) export -html -a data
+ $(UNZIP) *.zip
+ $(CD) ggj25 && python3 -m http.server
+
+clean:
+ $(RM) $(built)
+
+test: $(built_dbg)
+ $(BUSTED) -m "./data/?.lua" -o utfTerminal -v spec | $(LUA) tools/rewrite.lua
+
+$(built_lua) : data/%.lua : src/%.lua
+ $(CP) $< $@
+
+$(built_moon) : data/%.lua : src/%.moon
+ $(MOONC) -p $< > $@
+
+$(dbg_moon) : data/%.lua.X : src/%.moon
+ $(MOONC) -X $< > $@
+
+$(test_lua) : spec/%.lua : src/%.lua
+ $(CP) $< $@
+
+$(test_moon) : spec/%.lua : src/%.moon
+ $(MOONC) -p $< > $@