From 5821436af1c522206c3faf90e0813415445ea6c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Fri, 1 May 2009 17:14:11 +0200 Subject: New target `install TEXMF=/path/to/root'. --- Makefile | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 3f9b2f6..8c37fda 100644 --- a/Makefile +++ b/Makefile @@ -22,10 +22,10 @@ ALL_FILES = $(GENERATED) $(SOURCE) # Installation locations FORMAT = luatex -RUNDIR = tex/$(FORMAT)/$(NAME) -DOCDIR = doc/$(FORMAT)/$(NAME) -SRCDIR = source/$(FORMAT)/$(NAME) -ALL_DIRS = $(RUNDIR) $(DOCDIR) $(SRCDIR) +RUNDIR = $(TEXMF)/tex/$(FORMAT)/$(NAME) +DOCDIR = $(TEXMF)/doc/$(FORMAT)/$(NAME) +SRCDIR = $(TEXMF)/source/$(FORMAT)/$(NAME) +TEXMF = ./texmf CTAN_ZIP = $(NAME).zip TDS_ZIP = $(NAME).tds.zip @@ -56,17 +56,25 @@ $(CTAN_ZIP): $(SOURCE) $(COMPILED) $(TDS_ZIP) @$(RM) -- $@ @zip -9 $@ $^ >/dev/null +define run-install +@mkdir -p $(RUNDIR) && cp $(RUNFILES) $(RUNDIR) +@mkdir -p $(DOCDIR) && cp $(DOCFILES) $(DOCDIR) +@mkdir -p $(SRCDIR) && cp $(SRCFILES) $(SRCDIR) +endef + +$(TDS_ZIP): TEXMF=./tmp-texmf $(TDS_ZIP): $(ALL_FILES) @echo "Making TDS-ready archive $@." @$(RM) -- $@ - @mkdir -p $(ALL_DIRS) - @cp $(RUNFILES) $(RUNDIR) - @cp $(DOCFILES) $(DOCDIR) - @cp $(SRCFILES) $(SRCDIR) - @zip -9 $@ -r $(ALL_DIRS) >/dev/null - @$(RM) -r tex doc source - -.PHONY: manifest clean mrproper + $(run-install) + @cd $(TEXMF) && zip -9 ../$@ -r . >/dev/null + @$(RM) -r -- $(TEXMF) + +.PHONY: install manifest clean mrproper + +install: $(ALL_FILES) + @echo "Installing in '$(TEXMF)'." + $(run-install) manifest: @echo "Source files:" -- cgit v1.2.3