a72310501848e5dd113951c032383d6c902e112f
[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.20 1995-12-06 17:48:30 adam Exp $
5
6 SHELL=/bin/sh
7 RANLIB=ranlib
8
9 YAZLIB=-lyaz
10 YAZINC=
11
12 INCLUDE=-I../include $(YAZINC)
13 TPROG1=dicttest
14 TPROG2=dictext
15 #CFLAGS=-g -Wall -pedantic -ansi
16 DEFS=$(INCLUDE)
17 LIB=../lib/dict.a 
18 PO = scan.o dopen.o dclose.o drdwr.o open.o close.o insert.o lookup.o \
19  lookupec.o lookgrep.o delete.o
20 CPP=$(CC) -E
21
22 all: $(LIB)
23
24 alll: $(LIB) $(TPROG1) $(TPROG2)
25
26 $(TPROG1): $(TPROG1).o $(LIB) ../lib/bfile.a ../lib/alexutil.a ../lib/dfa.a
27         $(CC) $(CFLAGS) -o $(TPROG1) $(TPROG1).o $(LIB) \
28                 ../lib/bfile.a ../lib/dfa.a ../lib/alexutil.a $(YAZLIB)
29
30 $(TPROG2): $(TPROG2).o $(LIB) ../lib/alexutil.a
31         $(CC) $(CFLAGS) -o $(TPROG2) $(TPROG2).o ../lib/alexutil.a $(YAZLIB)
32
33 $(LIB): $(PO)
34         rm -f $(LIB)
35         ar qc $(LIB) $(PO)
36         $(RANLIB) $(LIB)
37
38 .c.o:
39         $(CC) -c $(DEFS) $(CFLAGS) $<
40
41 clean:
42         rm -f *.[oa] $(TPROG1) $(TPROG2) core mon.out gmon.out errlist
43
44 depend: depend2
45
46 depend1:
47         sed '/^#Depend/q' <Makefile >Makefile.tmp
48         $(CPP) $(DEFS) -M *.c >>Makefile.tmp
49         mv -f Makefile.tmp Makefile
50
51 depend2:
52         $(CPP) $(DEFS) -M *.c >.depend  
53
54 ifeq (.depend,$(wildcard .depend))
55 include .depend
56 endif
57
58 #Depend --- DOT NOT DELETE THIS LINE