33 lines
797 B
Makefile
33 lines
797 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) $(shell for f in $(filter $(subst *,%,$2),$d); do [ -d "$$f" ] || printf "%s\n" "$$f"; done))
|
|
|
|
PDXNAME = Consoom!
|
|
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 $(dir $@)
|
|
fennel -c $< > $@
|
|
|
|
source/%: src/%
|
|
mkdir -p $(dir $@)
|
|
cp $< $@
|
|
|
|
$(PDXNAME).pdx: source
|
|
pdc source $@
|
|
|
|
clean:
|
|
rm -r $(PDXNAME).pdx
|
|
rm -r source
|
|
|
|
run: $(PDXNAME).pdx
|
|
PlaydateSimulator $<
|
|
|
|
.PHONY: all source clean
|