summaryrefslogtreecommitdiff
path: root/support/glosstex/Makefile
blob: fc6077d3c8667877c7f4b60c5ec7237788ef301f (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
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
143
144
145
146
147
148
149
150
151
152
153
154
155
# -*- Makefile -*-
# automatically generated from Makefile.m4

# ======================================================================
# you may need to set some of these
# ======================================================================


include Release

CFLAGS += -Wall -ansi -pedantic

DEBUG = 
THISDIR = ./

ifdef DEBUG
 CFLAGS += -g
 LDFLAGS += -g
endif



M4 = m4

LATEXENV = TEXINPUTS=.:
LATEX = $(LATEXENV) latex

MAKEINDEX = makeindex
GLOSSTEX = $(THISDIR)glosstex$(EXE)
MV = mv
RM = rm -f


# ======================================================================
# you shouldn't need to touch anything below
# ======================================================================

TEXAUX = *.aux *.lof *.lot *.log *.toc *.glo 
GLOSSTEXAUX = *.gxs *.gxg
MAKEINDEXAUX = *.glg *.glx *.ilg *.ind

MAKEFILESX=\
	Makefile\
	Makefile.os2\
	Makefile.unx

READMES=\
	README\
	LIESMICH

O=\
	database.o\
	error.o\
	labels.o\
	list.o\
	main.o\
	version.o

DTX=\
	glosstex.sty\
	glosstex.std\
	glosstex.ist\
	glosstex.gdf

C=$(O:%.o=%.c)

all: glosstex$(EXE) $(DTX)

glosstex: $(O)
	$(CC) $(LDFLAGS) $(O) $(LOADLIBS) -o $@



$(DTX): glosstex.dtx glosstex.ins
	$(LATEX) glosstex.ins


doc: glosstex$(EXE) glosstex.dvi

glosstex.dvi: $(DTX) glosstex.dtx

%.dvi: %.dtx
	$(LATEX) $<
	$(GLOSSTEX) $*.aux $*.gdf
	$(MAKEINDEX) $*.gxs -o $*.glx -t $*.glg -s glosstex.ist
	$(LATEX) $<
	$(GLOSSTEX) $*.aux $*.gdf
	$(MAKEINDEX) $*.gxs -o $*.glx -t $*.glg -s glosstex.ist
	$(LATEX) $<

clean:
	$(RM) $(O) $(TEXAUX) $(MAKEINDEXAUX) $(GLOSSTEXAUX) $(DTX) *~

proper: clean
	$(RM) $(GLOSSTEX) glosstex.dvi

makefiles: $(MAKEFILESX)

Makefile: Makefile.m4
	$(M4) -P -DMASTER $< > $@

Makefile.os2: Makefile.m4
	$(M4) -P -DOSTYPE=OS2 $< > $@

Makefile.unx: Makefile.m4
	$(M4) -P -DOSTYPE=UNX $< > $@

readmes: $(READMES)

README: README.m4
	$(M4) -P -DENGLISH $< > README

LIESMICH: README.m4
	$(M4) -P -DGERMAN $< > LIESMICH

dist: makefiles dep all $(READMES) doc
	@UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown;\
	UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown;\
	UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown;\
	SYSTEM=$$UNAME_MACHINE-$$UNAME_SYSTEM-$$UNAME_RELEASE;\
	mkdir /tmp/glosstex-$$$$;\
	mkdir /tmp/glosstex-$$$$/glosstex-$(RELEASE);\
	cp -rp * .depend /tmp/glosstex-$$$$/glosstex-$(RELEASE);\
	pushd /tmp/glosstex-$$$$/glosstex-$(RELEASE);\
	rm -rf CVS bin/CVS test;\
	mv glosstex$(EXE) bin/glosstex-$$SYSTEM;\
	$(MAKE) clean;\
	cd ..;\
	tar czf glosstex-$(RELEASE).tar.gz glosstex-$(RELEASE);\
	popd;\
	mv /tmp/glosstex-$$$$/glosstex-$(RELEASE).tar.gz ..;\
	echo released glosstex-$(RELEASE) for $$SYSTEM

dep:
	$(CPP) -MM $(INCDIR) $(C) > .depend

lint:
	lint $(C) 

version.c : Release
	$(MV) $@ $@.in
	sed < $@.in > $@ -e 's/version .*\\n/version $(RELEASE)\\n/'
	$(RM) $@.in

glosstex.dtx : Release
	$(MV) $@ $@.in
	sed < $@.in > $@\
	-e 's/\\def\\fileversion{.*}/\\def\\fileversion{$(RELEASE)}/'\
	-e 's/\\def\\filedate{.*}/\\def\\filedate{'`date '+%Y\/%m\/%d'`'}/'
	$(RM) $@.in

ifeq (.depend, $(wildcard .depend))
include .depend
endif