a6748971219d2d6a3da2ff88325818fb243ddd9c
[idzebra-moved-to-github.git] / util / Makefile
1 # Copyright (C) 1994-1996, Index Data I/S 
2 # All rights reserved.
3 # Sebastian Hammer, Adam Dickmeiss
4 # $Id: Makefile,v 1.28 1998-06-22 11:36:51 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 TPROG=opt-test
14 DEFS=$(INCLUDE) -DUSE_CRYPT=0
15 CPP=$(CC) -E
16 LIB=../lib/zebrautl.a
17 PO = res.o charmap.o zebramap.o passwddb.o
18
19 all: $(LIB)
20
21 alll: res-test all passtest
22
23 res-test: res-test.o $(LIB) 
24         $(CC) -o res-test res-test.o $(LIB) $(YAZLIB)
25
26 passtest: passtest.o $(LIB) 
27         $(CC) -o passtest passtest.o $(LIB) $(YAZLIB) -lcrypt
28
29 $(LIB): $(PO)
30         rm -f $(LIB)
31         ar qc $(LIB) $(PO)
32         $(RANLIB) $(LIB)
33
34 .c.o:
35         $(CC) -c $(DEFS) $(CFLAGS) $<
36
37 clean:
38         rm -f *.[oa] res-test core mon.out gmon.out errlist
39
40 depend: depend2
41
42 depend1:
43         sed '/^#Depend/q' <Makefile >Makefile.tmp
44         $(CPP) $(DEFS) -M *.c >>Makefile.tmp
45         mv -f Makefile.tmp Makefile
46
47 depend2:
48         $(CPP) $(DEFS) -M *.c >.depend  
49
50 ifeq (.depend,$(wildcard .depend))
51 include .depend
52 endif
53
54 #Depend --- DOT NOT DELETE THIS LINE