diff options
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 51 |
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 $< > $@ |
