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