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