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