aboutsummaryrefslogtreecommitdiffstats
path: root/refer/Makefile.mk
blob: 2c5761825339de20ae31b46d6da9f4f2c2b7e670 (plain) (blame)
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
ROBJ = glue1.o refer1.o refer2.o refer4.o refer5.o refer6.o mkey3.o \
	refer7.o refer8.o hunt2.o hunt3.o deliv2.o hunt5.o hunt6.o \
	hunt8.o glue3.o hunt7.o hunt9.o glue2.o glue4.o glue5.o refer0.o \
	shell.o version.o
AOBJ = addbib.o version.o
LOBJ = lookbib.o version.o
SOBJ = sortbib.o version.o
MOBJ = mkey1.o mkey2.o mkey3.o deliv2.o version.o
IOBJ = inv1.o inv2.o inv3.o inv5.o inv6.o deliv2.o version.o
HOBJ = hunt1.o hunt2.o hunt3.o hunt5.o hunt6.o hunt7.o glue5.o refer3.o \
	hunt9.o shell.o deliv2.o hunt8.o glue4.o tick.o version.o


FLAGS =	-DMACDIR='"$(MACDIR)"' -DREFDIR='"$(REFDIR)"' $(EUC) $(DEFINES) \
	-I../include

.c.o:
	$(CC) $(_CFLAGS) $(FLAGS) -c $<

all: refer addbib lookbib sortbib roffbib indxbib mkey inv hunt papers/runinv
	cd papers && PATH=..:$$PATH sh runinv

refer: $(ROBJ)
	$(CC) $(_CFLAGS) $(_LDFLAGS) $(ROBJ) $(LIBS) -o $@

addbib: $(AOBJ)
	$(CC) $(_CFLAGS) $(_LDFLAGS) $(AOBJ) $(LIBS) -o $@

lookbib: $(LOBJ)
	$(CC) $(_CFLAGS) $(_LDFLAGS) $(LOBJ) $(LIBS) -o $@

sortbib: $(SOBJ)
	$(CC) $(_CFLAGS) $(_LDFLAGS) $(SOBJ) $(LIBS) -o $@

mkey: $(MOBJ)
	$(CC) $(_CFLAGS) $(_LDFLAGS) $(MOBJ) $(LIBS) -o $@

inv: $(IOBJ)
	$(CC) $(_CFLAGS) $(_LDFLAGS) $(IOBJ) $(LIBS) -o $@

hunt: $(HOBJ)
	$(CC) $(_CFLAGS) $(_LDFLAGS) $(HOBJ) $(LIBS) -o $@

indxbib: indxbib.sh
	rm -f $@
	echo '#!$(SHELL)' >$@
	sed 's:@REFDIR@:$(REFDIR):g' indxbib.sh >>$@

roffbib: roffbib.sh
	rm -f $@
	echo '#!$(SHELL)' >$@
	sed 's:@BINDIR@:$(BINDIR):g' roffbib.sh >>$@

papers/runinv: papers/runinv.sh
	rm -f $@
	echo '#!$(SHELL)' >$@
	sed 's:@REFDIR@:$(REFDIR):g' papers/runinv.sh >>$@

install: all
	for i in refer addbib lookbib sortbib; \
	do \
		$(INSTALL) -c $$i $(ROOT)$(BINDIR)/$$i || exit; \
		$(STRIP) $(ROOT)$(BINDIR)/$$i || exit; \
	done
	$(INSTALL) -c roffbib $(ROOT)$(BINDIR)/roffbib
	$(INSTALL) -c indxbib $(ROOT)$(BINDIR)/indxbib
	test -d $(ROOT)$(REFDIR) || mkdir -p $(ROOT)$(REFDIR)
	for i in hunt inv mkey; \
	do \
		$(INSTALL) -c $$i $(ROOT)$(REFDIR)/$$i || exit; \
		$(STRIP) $(ROOT)$(REFDIR)/$$i || exit; \
	done
	test -d $(ROOT)$(REFDIR)/papers || mkdir -p $(ROOT)$(REFDIR)/papers
	$(INSTALL) -c -m 644 \
	    papers/Rbstjissue $(ROOT)$(REFDIR)/papers/Rbstjissue
	$(INSTALL) -c -m 644 papers/Rv7man $(ROOT)$(REFDIR)/papers/Rv7man
	$(INSTALL) -c papers/runinv $(ROOT)$(REFDIR)/papers/runinv
	for i in a b c; do \
		$(INSTALL) -m 644 papers/Ind.i$$i $(ROOT)$(REFDIR)/papers/; \
	done
	for i in addbib.1 lookbib.1 refer.1 roffbib.1 sortbib.1; \
	do \
		$(INSTALL) -c -m 644 $$i $(ROOT)$(MANDIR)/man1/$$i || exit; \
	done
	rm -f $(ROOT)$(MANDIR)/man1/indxbib.1
	ln -s lookbib.1 $(ROOT)$(MANDIR)/man1/indxbib.1

clean:
	rm -f $(ROBJ) refer $(AOBJ) addbib $(LOBJ) lookbib \
		$(SOBJ) sortbib roffbib indxbib $(MOBJ) mkey \
		$(IOBJ) inv $(HOBJ) hunt papers/runinv core log *~ \
		papers/Ind.i?

mrproper: clean

addbib.o: addbib.c
deliv2.o: deliv2.c refer..c
glue1.o: glue1.c refer..c
glue2.o: glue2.c refer..c
glue3.o: glue3.c refer..c
glue4.o: glue4.c refer..c
glue5.o: glue5.c refer..c
hunt1.o: hunt1.c refer..c
hunt2.o: hunt2.c refer..c
hunt3.o: hunt3.c refer..c
hunt5.o: hunt5.c
hunt6.o: hunt6.c refer..c
hunt7.o: hunt7.c refer..c
hunt8.o: hunt8.c refer..c
hunt9.o: hunt9.c
inv1.o: inv1.c refer..c
inv2.o: inv2.c refer..c
inv3.o: inv3.c
inv5.o: inv5.c refer..c
inv6.o: inv6.c refer..c
lookbib.o: lookbib.c
mkey1.o: mkey1.c refer..c
mkey2.o: mkey2.c refer..c
mkey3.o: mkey3.c refer..c
refer0.o: refer0.c refer..c
refer1.o: refer1.c refer..c
refer2.o: refer2.c refer..c
refer3.o: refer3.c refer..c
refer4.o: refer4.c refer..c
refer5.o: refer5.c refer..c
refer6.o: refer6.c refer..c
refer7.o: refer7.c refer..c
refer8.o: refer8.c refer..c
shell.o: shell.c
sortbib.o: sortbib.c
tick.o: tick.c
version.o: version.c