consoom/Makefile

33 lines
797 B
Makefile
Raw Normal View History

# adapted from https://git.sr.ht/~nytpu/fennel-playdate-template/tree/master/item/Makefile
2023-10-28 01:41:42 +00:00
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
2023-10-28 01:41:42 +00:00
mkdir -p $(dir $@)
fennel -c $< > $@
source/%: src/%
2023-10-28 01:41:42 +00:00
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