Minor changes.
[idzebra-moved-to-github.git] / index / Makefile
1 # Copyright (C) 1995-1996, Index Data I/S 
2 # All rights reserved.
3 # Sebastian Hammer, Adam Dickmeiss
4 # $Id: Makefile,v 1.43 1997-09-04 13:59:28 adam Exp $
5
6 SHELL=/bin/sh
7 RANLIB=ranlib
8
9 YAZLIB=../../yaz/lib/libyaz.a
10 #YAZLIB=-lyaz
11 YAZINC=-I../../yaz/include
12 #OSILIB=../../xtimosi/src/libmosi.a ../../yaz/lib/librfc.a
13 #OSILIB=../../xtimosi/src/libmosi.a -lrfc
14 #NETLIB=-lnsl -lsocket
15
16 INCLUDE=-I../include $(YAZINC)
17 TPROG1=zebraidx
18 TPROG2=kdump
19 TPROG3=zebrasrv
20 DEFS=$(INCLUDE)
21 O1 = main.o dir.o dirs.o trav.o extract.o kinput.o kcompare.o \
22  symtab.o recindex.o recstat.o lockutil.o lockidx.o \
23  zinfo.o invstat.o keychars.o
24 O2 = kdump.o
25 O3 = zserver.o kcompare.o zrpn.o zsets.o attribute.o recindex.o \
26  zlogs.o lockutil.o locksrv.o zinfo.o keychars.o trunc.o
27 CPP=$(CC) -E
28
29 all: $(TPROG1) $(TPROG2) $(TPROG3)
30
31 $(TPROG1): $(O1) ../lib/dict.a ../lib/isam.a ../lib/isamc.a ../lib/recctrl.a \
32                 ../lib/bfile.a ../lib/dfa.a ../lib/zebrautl.a $(YAZLIB)
33         $(CC) $(CFLAGS) -o $(TPROG1) $(O1) \
34                 ../lib/dict.a ../lib/isam.a ../lib/isamc.a ../lib/recctrl.a \
35                 ../lib/bfile.a ../lib/dfa.a ../lib/zebrautl.a \
36                 $(YAZLIB)
37
38 $(TPROG2): $(O2)
39         $(CC) $(CFLAGS) -o $(TPROG2) $(O2) ../lib/zebrautl.a $(YAZLIB)
40
41 $(TPROG3): $(O3) \
42                 ../lib/rset.a ../lib/dict.a ../lib/isam.a ../lib/recctrl.a \
43                 ../lib/isamc.a ../lib/bfile.a ../lib/dfa.a ../lib/zebrautl.a \
44                 $(YAZLIB)
45         $(CC) $(CFLAGS) -o $(TPROG3) $(O3) \
46                 ../lib/rset.a ../lib/dict.a ../lib/isam.a ../lib/recctrl.a \
47                 ../lib/isamc.a ../lib/bfile.a ../lib/dfa.a ../lib/zebrautl.a \
48                 $(YAZLIB) $(OSILIB) $(NETLIB) -lm
49
50 .c.o:
51         $(CC) -c $(DEFS) $(CFLAGS) $<
52
53 clean:
54         rm -f *.[oa] $(TPROG1) $(TPROG2) $(TPROG3)
55         rm -f core mon.out gmon.out errlist
56
57 depend: depend2
58
59 depend1:
60         sed '/^#Depend/q' <Makefile >Makefile.tmp
61         $(CPP) $(DEFS) -M *.c >>Makefile.tmp
62         mv -f Makefile.tmp Makefile
63
64 depend2:
65         $(CPP) $(DEFS) -M *.c >.depend  
66
67 ifeq (.depend,$(wildcard .depend))
68 include .depend
69 endif
70
71 #Depend --- DOT NOT DELETE THIS LINE