-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
143 lines (106 loc) · 3.5 KB
/
Makefile
File metadata and controls
143 lines (106 loc) · 3.5 KB
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
CONTRIBUTION = texdef
NAME = Martin Scharrer
EMAIL = martin.scharrer@web.de
DIRECTORY = /support/${CONTRIBUTION}
LICENSE = free
FREEVERSION = gpl
CTAN_FILE = ${CONTRIBUTION}.zip
export CONTRIBUTION VERSION NAME EMAIL SUMMARY DIRECTORY DONOTANNOUNCE ANNOUNCE NOTES LICENSE FREEVERSION CTAN_FILE CTAN_SERVER
README = README.txt
SCRIPTFILES = ${CONTRIBUTION}.pl
SCRDOCFILES = ${CONTRIBUTION}.pdf ${README} INSTALL.txt CHANGELOG.txt
SCRSRCFILES = ${CONTRIBUTION}.tex
CTANFILES = ${SCRIPTFILES} ${SCRDOCFILES} ${SCRSRCFILES} DEPENDS.txt
TDSZIP = ${CONTRIBUTION}.tds.zip
TEXMF = ${HOME}/texmf
SCRIPTDIR = ${TEXMF}/scripts/${CONTRIBUTION}/
SCRDOCDIR = ${TEXMF}/doc/support/${CONTRIBUTION}/
SCRSRCDIR = ${TEXMF}/source/support/${CONTRIBUTION}/
TDSDIR = tds
TDSFILES = ${SCRIPTFILES} ${SCRDOCFILES}
BUILDDIR = .
LATEXMK = latexmk -pdf -quiet
ZIP = zip -r
CP = cp
MKDIR = mkdir
RMDIR = rm -rf
WEBBROWSER = firefox
GETVERSION = $(strip $(shell grep 'my \$$VERSION' texdef.pl | sed 's/my \$$VERSION = '\''Version \(.*\) -- .*'\'';/v\1/') )
AUXEXTS = .aux .bbl .blg .cod .exa .fdb_latexmk .glo .gls .lof .log .lot .out .pdf .que .run.xml .sta .stp .svn .svt .toc
CLEANFILES = $(addprefix ${CONTRIBUTION}, ${AUXEXTS})
.PHONY: all doc clean distclean build
all: doc
doc: ${SCRDOCFILES}
build: doc
%.pdf: %.tex
latexmk -pdf $<
touch $@
${README}: texdef.pl
./texdef.pl --help > ${README}
clean:
latexmk -C ${SCRSRCFILES}
${RM} ${CLEANFILES}
${RM} -r ${TDSDIR} ${TDSZIP} ${CTAN_FILE}
distclean:
latexmk -C ${SCRSRCFILES}
${RM} ${CLEANFILES}
${RM} -r ${TDSDIR}
CPORLN=cp
installtds: ${TDSFILES}
ifneq ($(strip $(SCRIPTFILES)),)
test -d "${SCRIPTDIR}" || mkdir -p "${SCRIPTDIR}"
${CPORLN} ${SCRIPTFILES} "$(abspath ${SCRIPTDIR})"
endif
ifneq ($(strip $(SCRDOCFILES)),)
test -d "${SCRDOCDIR}" || mkdir -p "${SCRDOCDIR}"
${CPORLN} ${SCRDOCFILES} "$(abspath ${SCRDOCDIR})"
endif
ifneq ($(strip $(SCRSRCFILES)),)
test -d "${SCRSRCDIR}" || mkdir -p "${SCRSRCDIR}"
${CPORLN} ${SCRSRCFILES} "$(abspath ${SCRSRCDIR})"
endif
touch ${TEXMF}
-test -f ${TEXMF}/ls-R && texhash ${TEXMF} || true
ifeq ($(shell id -u),0)
INSTALLDIR=/usr/local/bin
else
INSTALLDIR=${HOME}/bin
endif
FLAVOURS=tex latex pdftex pdflatex xetex xelatex luatex lualatex context
LINKS=$(addsuffix def,${FLAVOURS})
install: texdef.pl ${LINKS}
install -t ${INSTALLDIR} $^
uninstall:
cd ${INSTALLDIR} && ${RM} texdef.pl ${LINKS}
.PHONY: links
links: ${LINKS}
${LINKS}:
ln -s texdef.pl $@
installsymlinks: CPORLN=ln -sf
installsymlinks: install
uninstalltds:
${RM} -rf ${SCRIPTDIR} ${SCRDOCDIR}
-test -f ${TEXMF}/ls-R && texhash ${TEXMF} || true
ifneq (${TDSDIR},tdsdir)
tdsdir: ${TDSDIR}
endif
${TDSDIR}: ${TDSFILES}
${MAKE} --no-print-directory installtds TEXMF=${TDSDIR}
tdszip: ${TDSZIP}
${TDSZIP}: ${TDSDIR}
-${RM} $@
cd ${TDSDIR} && ${ZIP} $(abspath $@) *
zip: ${CTAN_FILE}
${CTAN_FILE}: ${CTANFILES} ${TDSZIP}
-${RM} $@
-${RMDIR} ${CONTRIBUTION}/
${MKDIR} ${CONTRIBUTION}/
${CP} ${CTANFILES} ${CONTRIBUTION}/
${ZIP} $@ ${TDSZIP} ${CONTRIBUTION}/
-${RMDIR} ${CONTRIBUTION}/
upload: VERSION = ${GETVERSION}
upload: ${CTAN_FILE}
ctanupload -p
webupload: VERSION = ${GETVERSION}
webupload: ${CTAN_FILE}
${WEBBROWSER} 'http://dante.ctan.org/upload.html?contribution=${CONTRIBUTION}&version=${VERSION}&name=${NAME}&email=${EMAIL}&summary=${SUMMARY}&directory=${DIRECTORY}&DoNotAnnounce=${DONOTANNOUNCE}&announce=${ANNOUNCEMENT}¬es=${NOTES}&license=${LICENSE}&freeversion=${FREEVERSION}' &