6fc4679d17952e1f5e03386a95e788e02bec3e4a
[idzebra-moved-to-github.git] / dict / Makefile
1 # Copyright (C) 1994, Index Data I/S 
2 # All rights reserved.
3 # Sebastian Hammer, Adam Dickmeiss
4 # $Id: Makefile,v 1.22 1996-05-22 08:26:46 adam Exp $
5
6 SHELL=/bin/sh
7 RANLIB=ranlib
8
9 YAZLIB=../../yaz/lib/libyaz.a
10 YAZINC=-I../../yaz/include
11
12 INCLUDE=-I../include $(YAZINC)
13 TPROG1=dicttest
14 TPROG2=dictext
15 DEFS=$(INCLUDE)
16 LIB=../lib/dict.a 
17 PO = scan.o dopen.o dclose.o drdwr.o open.o close.o insert.o lookup.o \
18  lookupec.o lookgrep.o delete.o
19 CPP=$(CC) -E
20
21 all: $(LIB)
22
23 alll: $(LIB) $(TPROG1) $(TPROG2)
24
25 $(TPROG1): $(TPROG1).o $(LIB) ../lib/bfile.a ../lib/alexutil.a ../lib/dfa.a
26         $(CC) $(CFLAGS) -o $(TPROG1) $(TPROG1).o $(LIB) \
27                 ../lib/bfile.a ../lib/dfa.a ../lib/alexutil.a $(YAZLIB)
28
29 $(TPROG2): $(TPROG2).o $(LIB) ../lib/alexutil.a
30         $(CC) $(CFLAGS) -o $(TPROG2) $(TPROG2).o ../lib/alexutil.a $(YAZLIB)
31
32 $(LIB): $(PO)
33         rm -f $(LIB)
34         ar qc $(LIB) $(PO)
35         $(RANLIB) $(LIB)
36
37 .c.o:
38         $(CC) -c $(DEFS) $(CFLAGS) $<
39
40 clean:
41         rm -f *.[oa] $(TPROG1) $(TPROG2) core mon.out gmon.out errlist
42
43 depend: depend2
44
45 depend1:
46         sed '/^#Depend/q' <Makefile >Makefile.tmp
47         $(CPP) $(DEFS) -M *.c >>Makefile.tmp
48         mv -f Makefile.tmp Makefile
49
50 depend2:
51         $(CPP) $(DEFS) -M *.c >.depend  
52
53 ifeq (.depend,$(wildcard .depend))
54 include .depend
55 endif
56
57 #Depend --- DOT NOT DELETE THIS LINE