forked from schoradt/rechnung
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
142 lines (113 loc) · 3.39 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
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
142
# Makefile :-- install rechnung.
# Copyright (C) 2010 Tom Kazimiers (tom AT voodoo-arts.net)
# Based on the Makefile of emp latex package by Thorsten Ohl
#
# Rechnung is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# Rechnung is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# $Id: Makefile,v 1.0 2010/02/25 21:14:41 kazimiers Exp $
#
########################################################################
VERSION = 1
RELEASE = 00
STATUS =
########################################################################
# Directories
prefix = $(HOME)
ifeq ($(OS),Windows_NT)
detected_OS := Windows
# not supported
else
detected_OS := $(shell uname -s)
ifeq ($(detected_OS),Darwin)
# macOS
prefix := $(prefix)/Library/texmf
endif
ifeq ($(detected_OS),Linux)
prefix := $(prefix)/texmf
endif
endif
texdir = $(prefix)/tex/inputs
docdir = $(texdir)/doc
dvidir = $(prefix)/doc
# Commands
INSTALL = install -c -m 755
INSTALL_DATA = install -c -m 644
# INSTALL = cp
# INSTALL_DATA = cp
LATEX = latex
MAKEINDEX = makeindex
DVIPS = dvips
DFLAGS =
########################################################################
# No user serviceable parts below:
########################################################################
RESOLVE_XREF = \
$(LATEX) $*.drv && \
while grep 'Rerun to get cross-references right\.' $*.log; \
do \
$(LATEX) $*.drv; \
done
RUN_MAKEINDEX = \
$(MAKEINDEX) -s gind.ist -o $*.ind $*.idx && \
$(MAKEINDEX) -s gglo.ist -o $*.gls $*.glo
all: rechnung.sty rechnung.drv
man: rechnungman.dvi
ps: rechnung.ps
dvi: rechnung.dvi
install: all
mkdir -p $(texdir)
$(INSTALL_DATA) rechnung.sty $(texdir)
install.doc: all
mkdir -p $(docdir)
$(INSTALL_DATA) rechnung.dtx $(docdir)
$(INSTALL_DATA) rechnung.drv $(docdir)
$(INSTALL_DATA) rechnungman.drv $(docdir)
install.dvi: dvi
mkdir -p $(dvidir)
$(INSTALL_DATA) rechnung.dvi $(dvidir)
uninstall:
rm -f $(texdir)/rechnung.sty
uninstall.doc:
rm -f $(docdir)/rechnung.dtx
rm -f $(docdir)/rechnung.drv
rm -f $(docdir)/rechnungman.drv
rechnung.sty: rechnung.dtx rechnung.ins
$(LATEX) rechnung.ins
rechnung.drv rechnungman.drv: rechnung.sty
rechnung.dvi: rechnung.dtx rechnung.drv rechnung.sty
-$(LATEX) $*.drv
$(RUN_MAKEINDEX)
$(RESOLVE_XREF)
rechnungman.dvi: rechnung.dtx rechnungman.drv rechnung.sty
-$(LATEX) $*.drv
$(RUN_MAKEINDEX)
$(RESOLVE_XREF)
example: example.pdf
example.pdf: rechnung.sty example.tex
pdflatex example.tex
manual.ps.gz: manual.ps
gzip < $< > $@
manual.ps: rechnungman.dvi $(MANPICS)
$(DVIPS) $(DFLAGS) -o $@ $<
rechnung.ps: rechnung.dvi $(MANPICS)
$(DVIPS) $(DFLAGS) -o $@ $<
clean:
rm -f *.mp *.rawmp *.[0-9]* \
*.log *.dvi *.aux *.toc *.ilg *.glo *.gls *.idx *.ind \
*.ps *.mpx '#*#' *~ .*~ *.pdf
realclean: clean
rm -f rechnung.sty rechnung.drv rechnungman*
distclean: realclean