-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
100 lines (78 loc) · 1.94 KB
/
Makefile
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#### Start of system configuration section. ####
srcdir = .
SHELL = /bin/sh
TEX = latex
INSTALL = install
INSTALL_PROGRAM = $(INSTALL)
INSTALL_DATA = $(INSTALL) -m 644
INSTALL_DIR = $(srcdir)/mkinstalldirs
prefix = /usr/local/share/texmf
docdir = $(prefix)/doc
dvipsdir = $(prefix)/dvips
fontsdir = $(prefix)/fonts
texdir = $(prefix)/tex/latex
#### End of system configuration section. ####
SRCS = ka.dtx
AUX = ka.ins ka.pdf example.tex example.pdf Makefile ChangeLog README mkinstalldirs
DOCS = ka.cfg
LOGS = ka.aux ka.log \
ka.glo ka.gls \
ka.idx ka.ilg ka.ind \
ka.dvi ka.ps \
example.aux example.log \
example.dvi example.ps
ka.sty : ka.dtx ka.ins
$(TEX) ka.ins
ka.ins : ka.dtx
$(TEX) ka.dtx
.PHONY : sty
sty : ka.sty
.PHONY : doc
doc : ka.pdf
ka.pdf : ka.dtx
latex ka.dtx
latex ka.dtx
makeindex -s gind ka
makeindex -s gglo.ist -o ka.gls ka.glo
latex ka.dtx
dvips -Ppdf ka.dvi
ps2pdf -sPAPERSIZE=a4 ka.ps
.PHONY : test
test : example.tex ka.sty
latex example.tex
latex example.tex
dvips -Ppdf example.dvi
ps2pdf -sPAPERSIZE=a4 example.ps
.PHONY : all
all : sty doc test
.PHONY : clean
clean :
@rm -f $(LOGS)
.PHONY : distclean
distclean : clean
@rm -f ka.sty $(DOCS)
.PHONY : installdirs
installdirs : mkinstalldirs
$(INSTALL_DIR) $(DESTDIR)$(docdir)
$(INSTALL_DIR) $(DESTDIR)$(texdir)
.PHONY : install
install : sty doc installdirs
$(INSTALL_DATA) ka.pdf $(DESTDIR)$(docdir)
$(INSTALL_DATA) ka.sty $(DESTDIR)$(texdir)
.PHONY : uninstall
uninstall :
-cd $(DESTDIR)$(docdir) && rm ka.pdf
-cd $(DESTDIR)$(texdir) && rm ka.sty
DATE := `date +%Y-%m-%d`
VERSION := `sed \
-e '/ProvidesPackage{.*}/!d' \
-e 's/.*v\([0-9.]*\).*/\1/' \
-e q ka.dtx`
.PHONY : dist
dist: $(SRCS) $(AUX)
echo ka-$(VERSION)-$(DATE) > .fname
-rm -rf `cat .fname`
mkdir `cat .fname`
ln $(SRCS) $(AUX) `cat .fname`
tar -chzf `cat .fname`.tar.gz `cat .fname`
-rm -rf `cat .fname` .fname