Fixed Makefile(s).
[yaz-moved-to-github.git] / comstack / Makefile
1 # Copyright (C) 1994, Index Data I/S 
2 # All rights reserved.
3 # Sebastian Hammer, Adam Dickmeiss
4 # $Id: Makefile,v 1.6 1997-09-17 12:10:30 adam Exp $
5
6
7 LIBDIR=../lib
8
9 #LIBOSI=../../xtimosi/src/libmosi.a $(LIBDIR)/librfc.a
10 #XMOSI=xmosi.o
11
12 SHELL=/bin/sh
13 INCLUDE=-I../include -I. -I../../xtimosi/src
14 LIBINCLUDE=-L$(LIBDIR) -L../../xtimosi/src
15 DEFS=$(INCLUDE) $(CDEFS) # -DTRACE_TCPIP
16 LIB= $(LIBDIR)/libcomstack.a 
17 LIBS=$(LIBDIR)/libasn.a $(LIBDIR)/libodr.a $(LIBDIR)/libcomstack.a \
18          ../lib/ccl.a $(LIBDIR)/libutil.a $(LIBMOSI)
19 PO = comstack.o tcpip.o waislen.o $(XMOSI)
20 CPP=$(CC) -E
21 #CC=checkergcc
22 RANLIB=ranlib
23
24 all: $(LIBDIR) $(LIB)
25
26 cli: tst.o $(LIB)
27         $(CC) $(CFLAGS) $(LIBINCLUDE) -o cli tst.o $(LIBINCLUDE) $(LIBS)
28
29 alll:
30
31 $(LIB): $(PO)
32         rm -f $(LIB)
33         ar qc $(LIB) $(PO)
34         $(RANLIB) $(LIB)
35
36 $(LIBDIR):
37         mkdir $(LIBDIR)
38 .c.o:
39         $(CC) -c $(DEFS) $(CFLAGS) $<
40
41 clean:
42         rm -f *.[oa] test core mon.out gmon.out errlist tst cli
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) $(DEFS) -M *.c >.depend  
53
54 ifeq (.depend,$(wildcard .depend))
55 include .depend
56 endif
57
58 #Depend --- DOT NOT DELETE THIS LINE