esv/Makefile
Judah fb042840b1
feat[makefile,convert] Added makefile checks
I added further makefile checks for existing files.
I also corrected the shebang on convert.py
2024-03-05 00:10:54 -05:00

55 lines
1.1 KiB
Makefile

##
# esv command line bible
# Changelog:
# 2024-03-04 Added download feature to pull esv without distributing with source
PREFIX = /usr/local
esv: esv.sh esv.awk esv.tsv
cat esv.sh > $@
echo 'exit 0' >> $@
echo '#EOF' >> $@
tar czf - esv.awk esv.tsv >> $@
chmod +x $@
test: esv.sh
shellcheck -s sh esv.sh
clean:
rm -f esv ESV.json esv.zip
install: esv
mkdir -p $(DESTDIR)$(PREFIX)/bin
cp -f esv $(DESTDIR)$(PREFIX)/bin
chmod 755 $(DESTDIR)$(PREFIX)/bin/esv
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/esv
esv.tsv: download
download:
ifeq ("$(wildcard ./esv.tsv)","") # Check if the file exists before downloading
ifeq ( $(strip $(unzip -v)), )
ifeq ("$(wildcard ./ESV.json)","") # Check if the file exists before downloading
curl --location \
--request GET "https://bolls.life/static/translations/ESV.json" \
-o ESV.json
endif
else
ifeq ("$(wildcard ./esv.zip)","") # Check if the file exists before downloading
curl --location \
--request GET "https://bolls.life/static/translations/ESV.zip" \
-o esv.zip
endif
unzip esv.zip
endif
./convert.py
endif
.PHONY: test clean install uninstall
# end