Minor change.
[yaz-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.19 1996-02-20 16:41:36 adam Exp $
5
6 SHELL=/bin/sh
7 INCLUDE=-I../include -I.
8 LIBDIR=../lib
9 LIBINCLUDE=-L$(LIBDIR)
10 #CFLAGS=-g -Wall -pedantic -ansi
11 DEFS=$(INCLUDE)
12 #DEFS=$(INCLUDE) -DTRACE_XMALLOC=1
13 LIB=$(LIBDIR)/libutil.a
14 LIBS=
15 PO = options.o log.o marcdisp.o yaz-ccl.o pquery.o oid.o wrbuf.o \
16         xmalloc.o readconf.o tpath.o nmem.o yaz-util.o # dmalloc.o 
17 CPP=$(CC) -E
18 RANLIB=ranlib
19
20 all: $(LIBDIR) $(LIB) marcdump
21
22 #test: test.o $(LIB) ../odr/odr.a
23 #       $(CC) $(CFLAGS) $(INCLUDE) -o test test.o $(LIB) ../odr/odr.a
24
25 marcdump: marcdump.o $(LIB)
26         $(CC) $(CFLAGS) $(INCLUDE) -o marcdump marcdump.o $(LIB)
27
28 alll:
29
30 $(LIB): $(PO)
31         rm -f $(LIB)
32         ar qc $(LIB) $(PO)
33         $(RANLIB) $(LIB)
34
35 $(LIBDIR):
36         mkdir $(LIBDIR)
37
38 .c.o:
39         $(CC) -c $(DEFS) $(CFLAGS) $<
40
41 clean:
42         rm -f *.[oa] test marcdump core mon.out gmon.out errlist
43
44 depend: depend2
45
46 depend1:
47         sed '/^#Depend/q' <Makefile >Makefile.tmp
48         $(CPP) $(DEFS) -M *.c >>Makefile.tmp
49         mv -f Makefile.tmp Makefile
50
51 depend2:
52         $(CPP) $(INCLUDE) -M *.c >.depend       
53
54 ifeq (.depend,$(wildcard .depend))
55 include .depend
56 endif
57
58 #Depend --- DOT NOT DELETE THIS LINE