Files
ttrpg-fortunes/Makefile
Malin Freeborn 4e2849377a refactor for automatic .dat files
Now `make` makes .dat files on the fly, so they're never out of sync
with the base-file.

Also, /usr/local has been abandoned as it does not work with fortune.
2025-04-14 15:35:33 +02:00

25 lines
520 B
Makefile

########## Variables ##########
fortune_directory = /usr/share/fortune
cookies = $(wildcard ttrpg*)
target_cookies = $(patsubst %, $(fortune_directory)/%, $(cookies))
target_dats = $(patsubst %, $(fortune_directory)/%.dat, $(cookies))
targets = $(target_cookies) $(target_dats)
########## Rules ##########
.PHONY: install
install: $(targets)
$(target_cookies): $(fortune_directory)/%: %
install -pm644 $< $@
$(target_dats): $(fortune_directory)/%.dat: %
strfile $< $@
uninstall:
$(RM) $(wildcard $(targets))