1 # Copyright (C) 1995-1998, Index Data I/S
3 # Sebastian Hammer, Adam Dickmeiss
4 # $Id: Makefile,v 1.40 1998-06-02 10:23:07 adam Exp $
6 # Uncomment the lines below to enable mOSI communcation.
9 #LIBMOSI=../../xtimosi/src/libmosi.a ../lib/librfc.a
14 # Standard include path and original protocol encoders.
15 INCLUDE=-I. -I../include
18 # Uncomment the two lines below if you want to try the ASN.1 compiler
19 # (yc) for YAZ. Download yc separately and untar it along with YAZ:
20 # gunzip -c yaz.tar.gz | tar xvf -
21 # gunzip -c yc.tar.gz | tar xvf -
24 # You must run 'make depend' before 'make'.
25 #INCLUDE=-I../z39.50 -I. -I../include
31 SUBDIR=$(MOD) util odr $(RFC1006) ccl comstack retrieval client server ztest makelib
32 # Add external libraries to the ELIBS macro
37 CONTROL=RANLIB="ranlib" ELIBS="$(ELIBS)"
39 # Installation directories, etc.
42 # Public libraries and header files
44 INCDIR=/usr/local/include
46 YAZDIR=/usr/local/lib/yaz
49 for i in $(SUBDIR); do cd $$i; if $(MAKE) $(CONTROL) \
50 INCLUDE="$(INCLUDE)" CFLAGS="$(CFLAGS)" CDEFS="$(CDEFS)" LIBMOSI="$(LIBMOSI)" XMOSI="$(XMOSI)";\
51 then cd ..; else exit 1; fi; done
54 for i in $(SUBDIR); do cd $$i; if $(MAKE) INCLUDE="$(INCLUDE)" CDEFS="$(CDEFS)" depend;\
55 then cd ..; else exit 1; fi; done
58 for i in $(SUBDIR); do (cd $$i; $(MAKE) clean); done
62 for i in $(SUBDIR); do (cd $$i; rm -f *.o); done
63 mv lib/libyaz.a .; rm -f lib/*.a; mv libyaz.a lib
64 cd client; strip client
65 cd server; strip ztest
68 rm -f `find $(SUBDIR) -name "*.[oa]" -print`
69 rm -f `find $(SUBDIR) -name "core" -print`
70 rm -f `find $(SUBDIR) -name "errlist" -print`
71 rm -f `find $(SUBDIR) -name "a.out" -print`
73 distclean: clean cleandepend
76 for i in $(SUBDIR); do (cd $$i; \
77 if sed '/^#Depend/q' <Makefile >Makefile.tmp; then \
78 mv -f Makefile.tmp Makefile; fi; rm -f .depend); done
81 for i in $(SUBDIR); do (cd $$i; \
82 if sed 's/^if/#if/' <Makefile|sed 's/^include/#include/'| \
83 sed 's/^endif/#endif/' | \
84 sed 's/^depend: depend2/depend: depend1/g' | \
85 sed '/^#Depend/q' >Makefile.tmp; then \
86 mv -f Makefile.tmp Makefile; fi); done
89 for i in $(SUBDIR); do (cd $$i; \
90 if sed '/^#Depend/q' <Makefile| \
91 sed 's/^#if/if/' |sed 's/^#include/include/'| \
92 sed 's/^#endif/endif/' | \
93 sed 's/^depend: depend1/depend: depend2/g' >Makefile.tmp;then \
94 mv -f Makefile.tmp Makefile; fi); done
96 install: all install.misc install.lib install.bin
99 @if [ ! -d $(BINDIR) ]; then \
100 echo "Making directory $(BINDIR)"; \
103 @echo "Installing client -> $(BINDIR)"; \
104 cp client/client $(BINDIR)/client; chmod 755 $(BINDIR)/client
105 @echo "Installing ztest -> $(BINDIR)"; \
106 cp server/ztest $(BINDIR)/ztest; chmod 755 $(BINDIR)/ztest
109 @if [ ! -d $(LIBDIR) ]; then \
110 echo "Making directory $(LIBDIR)"; \
113 @echo "Installing libyaz.a -> $(LIBDIR)"; \
114 cp lib/libyaz.a $(LIBDIR)/libyaz.a; \
115 chmod 644 $(LIBDIR)/libyaz.a
116 @if [ -f lib/librfc.a ]; then \
117 echo "Installing librfc.a -> $(LIBDIR)"; \
118 cp lib/librfc.a $(LIBDIR)/librfc.a; \
119 chmod 644 $(LIBDIR)/librfc.a; \
121 @if [ ! -d $(INCDIR) ]; then \
122 echo "Making directory $(INCDIR)"; \
125 @cd include; for f in *.h; do \
126 echo "Installing $$f -> $(INCDIR)"; \
127 cp $$f $(INCDIR)/$$f; chmod 644 $(INCDIR)/$$f; \
131 @if [ ! -d $(YAZDIR) ]; then \
132 echo "Making directory $(YAZDIR)"; \
135 @cd tab; for f in *; do \
136 if [ -f $$f ]; then \
137 echo "Installing $$f -> $(YAZDIR)"; \
138 cp $$f $(YAZDIR)/$$f; chmod 644 $(YAZDIR)/$$f; \
143 wc `find . -name '*.[ch]'`