bbl

Read, search and index the Bible on the command line -- Greek, Latin, KJV, Knox, RSV, and more
git clone git://git.wilsonrgheen.com/bbl
Log | Files | Refs | README | LICENSE

Makefile (1144B)


      1 
      2 PREFIX = /usr/local
      3 
      4 bbl: bbl.sh bbl.awk readings/*/*.tsv readings/*/*.aliases
      5 	cat bbl.sh > $@
      6 	echo 'exit 0' >> $@
      7 	echo "#EOF" >> $@
      8 	tar cf bbl.tar input.awk bbl.awk
      9 	(cd readings && \
     10 	for d in $$(find . -mindepth 1 -maxdepth 1 -type d -printf '%f\n'); do \
     11 		(cd "$$d" && \
     12 		common_aliases="$$d.aliases"; \
     13 		[ -f "$$common_aliases" ] && tar rf ../../bbl.tar "$$common_aliases"; \
     14 		for f in *.tsv; do \
     15 			aliases_file="$${f%%.tsv}.aliases"; \
     16 			[ -f "$$aliases_file" ] && tar rf ../../bbl.tar "$$aliases_file"; \
     17 			tar rf ../../bbl.tar "$$f"; \
     18 		done; )\
     19 	done)
     20 	gzip -c bbl.tar >> $@
     21 	rm -f bbl.tar
     22 	chmod +x $@
     23 
     24 test: bbl.sh input.awk bbl.awk
     25 	@{ shellcheck -s sh -S error bbl.sh; \
     26 	   echo -n | gawk --lint=fatal -f input.awk -f bbl.awk; } 2>&1 \
     27 	 | grep -v 'warning: turning off `--lint' | tee test || true
     28 	@{ [ "$$(wc -l test | cut -d' ' -f1)" = 0 ] && echo "PASSED" || echo "FAILED"; } | tee -a test
     29 
     30 
     31 clean:
     32 	rm -f bbl
     33 
     34 install: bbl
     35 	mkdir -p $(DESTDIR)$(PREFIX)/bin
     36 	cp -f bbl $(DESTDIR)$(PREFIX)/bin
     37 	chmod 755 $(DESTDIR)$(PREFIX)/bin/bbl
     38 
     39 uninstall:
     40 	rm -f $(DESTDIR)$(PREFIX)/bin/bbl
     41 
     42 .PHONY: clean install uninstall