makefile 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. pkg := arabluatex
  2. ver := $(shell ltxfileinfo -v $(pkg).dtx|sed -e 's/^v//')
  3. TEXMFDIR := $(shell kpsewhich -expand-var='$$TEXMFHOME')
  4. HOMEDIR := $$HOME
  5. CMP = lualatex-dev
  6. sty: clean
  7. $(CMP) $(pkg).ins
  8. doc: clean sty
  9. $(CMP) --shell-escape $(pkg).dtx
  10. biber arabluatex
  11. $(CMP) --shell-escape $(pkg).dtx
  12. makeindex -s gind.ist -o $(pkg).ind $(pkg).idx
  13. makeindex -s gglo.ist -o $(pkg).gls $(pkg).glo
  14. $(CMP) --shell-escape $(pkg).dtx
  15. $(CMP) --shell-escape $(pkg).dtx
  16. for i in samples/*.tex; \
  17. do latexmk -outdir=TMP -lualatex -e '$$lualatex=q/$(CMP) %O --shell-escape %S/' $$i; \
  18. done
  19. mv TMP/*.pdf samples/
  20. all: clean sty doc
  21. local: clean sty
  22. if [ ! -d "$(TEXMFDIR)/tex/lualatex/arabluatex" ]; then \
  23. mkdir -p $(TEXMFDIR)/tex/lualatex/arabluatex; \
  24. fi
  25. cp $(pkg)*.{sty,lua} $(TEXMFDIR)/tex/lualatex/arabluatex
  26. if [ ! -d "$(HOMEDIR)/.emacs.d/auctex/auto" ]; then \
  27. mkdir -p $(HOMEDIR)/.emacs.d/auctex/auto; \
  28. fi
  29. cp $(pkg)*.el $(HOMEDIR)/.emacs.d/auctex/auto
  30. auctex: clean
  31. if [ ! -d "$(HOMEDIR)/.emacs.d/auctex/auto" ]; then \
  32. mkdir -p $(HOMEDIR)/.emacs.d/auctex/auto; \
  33. fi
  34. cp $(pkg)*.el $(HOMEDIR)/.emacs.d/auctex/auto
  35. package: clean all
  36. mkdir -p arabluatex/samples/
  37. cp *.{lua,ins,dtx,md,pdf} makefile README.tex arabluatex/ # .bib is in dtx
  38. cp samples/*.{tex,pdf} arabluatex/samples/
  39. mkdir -p tex/lualatex/arabluatex/
  40. cp *.lua *.sty tex/lualatex/arabluatex/
  41. mkdir -p doc/lualatex/arabluatex/samples
  42. cp *.{pdf,el} doc/lualatex/arabluatex/
  43. cp samples/*.{tex,pdf} doc/lualatex/arabluatex/samples
  44. mkdir -p source/lualatex/arabluatex/
  45. cp *.{ins,dtx,tex,md} makefile source/lualatex/arabluatex/ # .bib is in dtx
  46. zip -r arabluatex.tds.zip tex doc source
  47. tar czf arabluatex-$(ver).tar.gz arabluatex.tds.zip arabluatex/
  48. clean:
  49. rm -rf $(TEXMFDIR)/tex/lualatex/arabluatex/
  50. rm -rf $(HOMEDIR)/.emacs.d/auctex/auto/arabluatex*.{el,elc}
  51. rm -rf tex/ doc/ source/ auto/
  52. rm -rf arabluatex/
  53. rm -rf saved/ TMP/ _minted-arabluatex/
  54. find ./samples/ | grep -v "\./samples/$$" | grep -v ".*tex$$" | xargs rm -rf
  55. mkdir saved
  56. cp *.{lua,ins,dtx,tex,el} makefile saved # .bib is in dtx
  57. rm *.*
  58. cp saved/* .
  59. rm -rf saved/
  60. pandoc -s README.tex -o README.md && sed -i 's/{#.*}//g' README.md
  61. pandoc -s README.tex -o about.html
  62. .PHONY: sty doc all local auctex package clean