mirror of
https://codeberg.org/kyonshi/ttrpg-fortunes.git
synced 2026-01-01 17:48:00 +01:00
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.
25 lines
520 B
Makefile
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))
|