summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/disser/Makefile
blob: ca7841edcc653c8ab23c31cd0995b58af6b88cfc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#
# Makefile for disser package
# Author: Stanislav Kruchinin <stanislav.kruchinin@gmail.com>
#

TARGET := disser

VER ?= 1.5.0
GIT ?= git
ARCHEXT ?= zip
ARCHIVE := $(TARGET)-$(VER).$(ARCHEXT)
EXCLUDEFILES := .gitignore
TDSDIR ?= ../$(TARGET)-tds
TDSARCHIVE := $(TARGET)-$(VER).tds.$(ARCHEXT)

.PHONY: package doc templates all clean install uninstall reinstall srcdist tds help

package doc:
	@$(MAKE) -i -C src $@

templates:
	@$(MAKE) -i -C templates
	@$(MAKE) -i -C templates-utf8

all: package templates

clean install uninstall reinstall:
	@$(MAKE) -i -C src $@
	@$(MAKE) -i -C templates $@
	@$(MAKE) -i -C templates-utf8 $@

srcdist:
	@[ -f $(ARCHIVE) ] && rm -f $(ARCHIVE) ;\
	$(GIT) archive --format=$(ARCHEXT) --output=$(ARCHIVE) -9 HEAD ;\
	7z d $(ARCHIVE) $(EXCLUDEFILES)

tds:
	@[ -f $(TDSARCHIVE) ] && rm -f $(TDSARCHIVE) ;\
	[ -d $(TDSDIR) ] && rm -rf $(TDSDIR) ;\
	mkdir -p $(TDSDIR) ;\
	env DESTDIR=../$(TDSDIR) $(MAKE) -i -C src install ;\
	env DESTDIR=../$(TDSDIR) $(MAKE) -i -C templates install ;\
	env DESTDIR=../$(TDSDIR) $(MAKE) -i -C templates-utf8 install ;\
	7z a -t$(ARCHEXT) -mx=9 $(TDSARCHIVE) $(TDSDIR)/*

help:
	@echo "  all        build classes, documentation and templates" ;\
	 echo "  clean      remove output files" ;\
	 echo "  doc        build DVI and PDF versions of documentation" ;\
	 echo "  help       show description of targets" ;\
	 echo "  install    install package and documentation" ;\
	 echo "  package    (default) build package and documentation" ;\
	 echo "  reinstall  reinstall package and documentation" ;\
	 echo "  srcdist    create source distribution" ;\
	 echo "  tds        create TDS archive with compiled sources" ;\
	 echo "  template   build templates" ;\
	 echo "  uninstall  uninstall package and documentation"