Makefile 739 B

123456789101112131415161718192021222324252627
  1. TOKEN = $(wildcard ~/token)
  2. ifeq (,${TOKEN})
  3. TOKEN = $(wildcard token)
  4. endif
  5. ifeq (bib,$(firstword $(MAKECMDGOALS)))
  6. # use the rest as arguments for "bib"
  7. SEARCH_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
  8. # ...and turn them into do-nothing targets
  9. $(eval $(SEARCH_ARGS):;@:)
  10. endif
  11. all: biblio
  12. echo "run"
  13. latexmk -latexoption="-file-line-error -shell-escape -interaction=errorstopmode -halt-on-error -synctex=1" -g -pdf main.tex
  14. clean:
  15. latexmk -C
  16. biblio:
  17. -CHECK_DEP=${CHECK_DEP} python3 bibtool.py --tokenfile=${TOKEN} --server https://bib.gruss.cc get --exclude_sub_dirs
  18. bib:
  19. python3 bibtool.py --tokenfile=${TOKEN} --server https://bib.gruss.cc --exclude_sub_dirs --query "$(SEARCH_ARGS)" search