From 2f917ba45098c63ef6040455ec6cfb8785c0280c Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Thu, 6 Apr 2017 11:49:39 +0200 Subject: set some predefined variables in makefile --- makefile | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/makefile b/makefile index 00ef7a0..3014b34 100644 --- a/makefile +++ b/makefile @@ -1,4 +1,6 @@ pkg=arabluatex +TEXMFDIR := $(shell kpsewhich -expand-var='$$TEXMFHOME') +HOMEDIR := $$HOME sty: clean lualatex $(pkg).ins @@ -17,20 +19,20 @@ doc: clean sty all: clean sty doc local: clean sty - if [ ! -d "~/texmf/tex/lualatex/arabluatex" ]; then \ - mkdir -p ~/texmf/tex/lualatex/arabluatex; \ + if [ ! -d "$(TEXMFDIR)/tex/lualatex/arabluatex" ]; then \ + mkdir -p $(TEXMFDIR)/tex/lualatex/arabluatex; \ fi - cp $(pkg)*.{sty,lua} ~/texmf/tex/lualatex/arabluatex - if [ ! -d "~/.emacs.d/auctex/auto" ]; then \ - mkdir -p ~/.emacs.d/auctex/auto; \ + cp $(pkg)*.{sty,lua} $(TEXMFDIR)/tex/lualatex/arabluatex + if [ ! -d "$(HOMEDIR)/.emacs.d/auctex/auto" ]; then \ + mkdir -p $(HOMEDIR)/.emacs.d/auctex/auto; \ fi - cp $(pkg)*.el ~/.emacs.d/auctex/auto + cp $(pkg)*.el $(HOMEDIR)/.emacs.d/auctex/auto auctex: clean - if [ ! -d "~/.emacs.d/auctex/auto" ]; then \ - mkdir -p ~/.emacs.d/auctex/auto; \ + if [ ! -d "$(HOMEDIR)/.emacs.d/auctex/auto" ]; then \ + mkdir -p $(HOMEDIR)/.emacs.d/auctex/auto; \ fi - cp $(pkg)*.el ~/.emacs.d/auctex/auto + cp $(pkg)*.el $(HOMEDIR)/.emacs.d/auctex/auto package: clean all mkdir -p arabluatex/samples/ @@ -47,12 +49,12 @@ package: clean all tar czf arabluatex.tar.gz arabluatex.tds.zip arabluatex/ clean: - rm -rf ~/texmf/tex/lualatex/arabluatex/ - rm -rf ~/.emacs.d/auctex/auto/arabluatex*.el + rm -rf $(TEXMFDIR)/tex/lualatex/arabluatex/ + rm -rf $(HOMEDIR)/.emacs.d/auctex/auto/arabluatex*.el rm -rf tex/ doc/ source/ auto/ rm -rf arabluatex/ rm -rf saved/ TMP/ - find ./samples/ | grep -v samples | grep -v ".*tex$$" | xargs rm -rf + find ./samples/ | grep -v "samples/$$" | grep -v ".*tex$$" | xargs rm -rf mkdir saved cp *.{lua,ins,dtx,tex,el} makefile saved # .bib is in dtx rm *.* -- cgit v1.2.3