Various cleanup. YAZ util used instead.
[idzebra-moved-to-github.git] / util / 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-09-04 12:34:05 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 TPROG=opt-test
12 #CFLAGS=-g -Wall -pedantic -ansi
13 DEFS=$(INCLUDE)
14 CPP=cc -E
15 LIB=../lib/alexutil.a
16 PO = xmalloc.o res.o alexpath.o common.o
17
18 all: $(LIB)
19
20 alll: res-test all
21
22 res-test: res-test.o $(LIB) $(YAZLIB)
23         $(CC) -o res-test res-test.o $(LIB) $(YAZLIB)
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] res-test core mon.out gmon.out errlist
35
36 depend: depend2
37
38 depend1:
39         sed '/^#Depend/q' <Makefile >Makefile.tmp
40         $(CPP) $(DEFS) -M *.c >>Makefile.tmp
41         mv -f Makefile.tmp Makefile
42
43 depend2:
44         $(CPP) $(DEFS) -M *.c >.depend  
45
46 ifeq (.depend,$(wildcard .depend))
47 include .depend
48 endif
49
50 #Depend --- DOT NOT DELETE THIS LINE