33 lines
758 B
Makefile
33 lines
758 B
Makefile
|
# adapted from https://git.sr.ht/~nytpu/fennel-playdate-template/tree/master/item/Makefile
|
||
|
|
||
|
rwildcard=$(foreach d,$(wildcard $(1:=/*)),$(call rwildcard,$d,$2) $(filter $(subst *,%,$2),$d))
|
||
|
|
||
|
PDXNAME = Explosionface
|
||
|
EXCLUDESOURCES = src/macros.fnl
|
||
|
SOURCEFILES = $(filter-out $(EXCLUDESOURCES),$(call rwildcard, src, *.fnl))
|
||
|
OUTFILES = $(subst src,source,$(SOURCEFILES:.fnl=.lua) $(filter-out $(SOURCEFILES),$(call rwildcard, src, *)))
|
||
|
|
||
|
all: $(PDXNAME).pdx
|
||
|
|
||
|
source: $(OUTFILES)
|
||
|
|
||
|
source/%.lua: src/%.fnl
|
||
|
mkdir -p $(shell dirname $@)
|
||
|
fennel -c $< > $@
|
||
|
|
||
|
source/%: src/%
|
||
|
mkdir -p $(shell dirname $@)
|
||
|
cp $< $@
|
||
|
|
||
|
$(PDXNAME).pdx: source
|
||
|
pdc source $@
|
||
|
|
||
|
clean:
|
||
|
rm -r $(PDXNAME).pdx
|
||
|
rm -r source
|
||
|
|
||
|
run: $(PDXNAME).pdx
|
||
|
PlaydateSimulator $<
|
||
|
|
||
|
.PHONY: all source clean
|