Updated.
[yaz-moved-to-github.git] / odr / Makefile
1 # Copyright (C) 1995-1998, Index Data I/S 
2 # All rights reserved.
3 # Sebastian Hammer, Adam Dickmeiss
4 # $Id: Makefile,v 1.27 1998-01-29 13:18:29 adam Exp $
5
6 SHELL=/bin/sh
7 INCLUDE=-I../include -I.
8 LIBDIR=../lib
9 LIBINCLUDE=-L$(LIBDIR)
10 DEFS=$(INCLUDE) $(CDEFS) # -DODR_DEBUG
11 LIB=$(LIBDIR)/libodr.a
12 LIBS=-lodr
13 PO = odr_bool.o ber_bool.o ber_len.o ber_tag.o odr_util.o odr_null.o \
14         ber_null.o odr_int.o ber_int.o odr_tag.o odr_cons.o odr_seq.o\
15         odr_oct.o ber_oct.o odr_bit.o ber_bit.o odr_oid.o ber_oid.o odr_use.o \
16         odr_choice.o odr_any.o ber_any.o odr.o odr_mem.o dumpber.o
17 CPP=$(CC) -E
18 RANLIB=ranlib
19
20 all: $(LIBDIR) $(INCDIR) $(LIB)
21
22 test: test.o $(LIB)
23         $(CC) $(CFLAGS) $(LIBINCLUDE) -o test test.o $(LIBS)
24
25 alll:
26
27 $(LIB): $(PO)
28         rm -f $(LIB)
29         ar qc $(LIB) $(PO)
30         $(RANLIB) $(LIB)
31
32 $(LIBDIR):
33         mkdir $(LIBDIR)
34
35 .c.o:
36         $(CC) -c $(DEFS) $(CFLAGS) $<
37
38 clean:
39         rm -f *.[oa] test core mon.out gmon.out errlist
40
41 depend: depend2
42
43 depend1:
44         sed '/^#Depend/q' <Makefile >Makefile.tmp
45         $(CPP) $(DEFS) -M *.c >>Makefile.tmp
46         mv -f Makefile.tmp Makefile
47
48 depend2:
49         $(CPP) $(DEFS) -M *.c >.depend  
50
51 ifeq (.depend,$(wildcard .depend))
52 include .depend
53 endif
54
55 #Depend --- DOT NOT DELETE THIS LINE