1 # Copyright (C) 1995-1998, Index Data I/S
3 # Sebastian Hammer, Adam Dickmeiss
4 # $Id: Makefile,v 1.36 1998-01-29 13:43:03 adam Exp $
6 # Uncomment the lines below to enable mOSI communcation.
9 #LIBMOSI=../../xtimosi/src/libmosi.a ../lib/librfc.a
16 SUBDIR=util odr asn $(RFC1006) ccl comstack retrieval client server ztest makelib
17 # Add external libraries to the ELIBS macro
19 CONTROL=RANLIB="ranlib" ELIBS="$(ELIBS)"
21 # Installation directories, etc.
24 # Public libraries and header files
26 INCDIR=/usr/local/include
28 YAZDIR=/usr/local/lib/yaz
31 for i in $(SUBDIR); do cd $$i; if $(MAKE) $(CONTROL) \
32 CFLAGS="$(CFLAGS)" CDEFS="$(CDEFS)" LIBMOSI="$(LIBMOSI)" XMOSI="$(XMOSI)";\
33 then cd ..; else exit 1; fi; done
36 for i in $(SUBDIR); do cd $$i; if $(MAKE) CDEFS="$(CDEFS)" depend;\
37 then cd ..; else exit 1; fi; done
40 for i in $(SUBDIR); do (cd $$i; $(MAKE) clean); done
44 for i in $(SUBDIR); do (cd $$i; rm -f *.o); done
45 mv lib/libyaz.a .; rm -f lib/*.a; mv libyaz.a lib
46 cd client; strip client
47 cd server; strip ztest
50 rm -f `find $(SUBDIR) -name "*.[oa]" -print`
51 rm -f `find $(SUBDIR) -name "core" -print`
52 rm -f `find $(SUBDIR) -name "errlist" -print`
53 rm -f `find $(SUBDIR) -name "a.out" -print`
55 distclean: clean cleandepend
58 for i in $(SUBDIR); do (cd $$i; \
59 if sed '/^#Depend/q' <Makefile >Makefile.tmp; then \
60 mv -f Makefile.tmp Makefile; fi; rm -f .depend); done
63 for i in $(SUBDIR); do (cd $$i; \
64 if sed 's/^if/#if/' <Makefile|sed 's/^include/#include/'| \
65 sed 's/^endif/#endif/' | \
66 sed 's/^depend: depend2/depend: depend1/g' | \
67 sed '/^#Depend/q' >Makefile.tmp; then \
68 mv -f Makefile.tmp Makefile; fi); done
71 for i in $(SUBDIR); do (cd $$i; \
72 if sed '/^#Depend/q' <Makefile| \
73 sed 's/^#if/if/' |sed 's/^#include/include/'| \
74 sed 's/^#endif/endif/' | \
75 sed 's/^depend: depend1/depend: depend2/g' >Makefile.tmp;then \
76 mv -f Makefile.tmp Makefile; fi); done
78 install: all install.misc install.lib install.bin
81 @if [ ! -d $(BINDIR) ]; then \
82 echo "Making directory $(BINDIR)"; \
85 @echo "Installing client -> $(BINDIR)"; \
86 cp client/client $(BINDIR)/client; chmod 755 $(BINDIR)/client
87 @echo "Installing ztest -> $(BINDIR)"; \
88 cp server/ztest $(BINDIR)/ztest; chmod 755 $(BINDIR)/ztest
91 @if [ ! -d $(LIBDIR) ]; then \
92 echo "Making directory $(LIBDIR)"; \
95 @echo "Installing libyaz.a -> $(LIBDIR)"; \
96 cp lib/libyaz.a $(LIBDIR)/libyaz.a; \
97 chmod 644 $(LIBDIR)/libyaz.a
98 @if [ -f lib/librfc.a ]; then \
99 echo "Installing librfc.a -> $(LIBDIR)"; \
100 cp lib/librfc.a $(LIBDIR)/librfc.a; \
101 chmod 644 $(LIBDIR)/librfc.a; \
103 @if [ ! -d $(INCDIR) ]; then \
104 echo "Making directory $(INCDIR)"; \
107 @cd include; for f in *.h; do \
108 echo "Installing $$f -> $(INCDIR)"; \
109 cp $$f $(INCDIR)/$$f; chmod 644 $(INCDIR)/$$f; \
113 @if [ ! -d $(YAZDIR) ]; then \
114 echo "Making directory $(YAZDIR)"; \
117 @cd tab; for f in *; do \
118 if [ -f $$f ]; then \
119 echo "Installing $$f -> $(YAZDIR)"; \
120 cp $$f $(YAZDIR)/$$f; chmod 644 $(YAZDIR)/$$f; \
125 wc `find . -name '*.[ch]'`