1 # Copyright (C) 1994, Index Data I/S
3 # Sebastian Hammer, Adam Dickmeiss
4 # $Id: Makefile,v 1.27 1995-11-17 11:08:57 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 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
31 for i in $(SUBDIR); do cd $$i; if $(MAKE) $(CONTROL)\
32 CFLAGS="$(CFLAGS) $(CDEFS)" LIBMOSI="$(LIBMOSI)" XMOSI="$(XMOSI)";\
33 then cd ..; else exit 1; fi; done
36 for i in $(SUBDIR); do cd $$i; if $(MAKE) depend; then cd ..; else exit 1; fi; done
39 for i in $(SUBDIR); do (cd $$i; $(MAKE) clean); done
43 rm -f `find $(SUBDIR) -name "*.[oa]" -print`
44 rm -f `find $(SUBDIR) -name "core" -print`
45 rm -f `find $(SUBDIR) -name "errlist" -print`
46 rm -f `find $(SUBDIR) -name "a.out" -print`
48 distclean: clean cleandepend
51 for i in $(SUBDIR); do (cd $$i; \
52 if sed '/^#Depend/q' <Makefile >Makefile.tmp; then \
53 mv -f Makefile.tmp Makefile; fi; rm -f .depend); done
56 for i in $(SUBDIR); do (cd $$i; \
57 if sed 's/^if/#if/' <Makefile|sed 's/^include/#include/'| \
58 sed 's/^endif/#endif/' | \
59 sed 's/^depend: depend2/depend: depend1/g' | \
60 sed '/^#Depend/q' >Makefile.tmp; then \
61 mv -f Makefile.tmp Makefile; fi); done
64 for i in $(SUBDIR); do (cd $$i; \
65 if sed '/^#Depend/q' <Makefile| \
66 sed 's/^#if/if/' |sed 's/^#include/include/'| \
67 sed 's/^#endif/endif/' | \
68 sed 's/^depend: depend1/depend: depend2/g' >Makefile.tmp;then \
69 mv -f Makefile.tmp Makefile; fi); done
71 install: all install.misc install.lib install.bin
74 @if [ ! -d $(BINDIR) ]; then \
75 echo "Making directory $(BINDIR)"; \
78 @echo "Installing client -> $(BINDIR)"; \
79 cp client/client $(BINDIR)/client; chmod 755 $(BINDIR)/client
80 @echo "Installing ztest -> $(BINDIR)"; \
81 cp server/ztest $(BINDIR)/ztest; chmod 755 $(BINDIR)/ztest
84 @if [ ! -d $(LIBDIR) ]; then \
85 echo "Making directory $(LIBDIR)"; \
88 @echo "Installing libyaz.a -> $(LIBDIR)"; \
89 cp lib/libyaz.a $(LIBDIR)/libyaz.a; \
90 chmod 644 $(LIBDIR)/libyaz.a
91 @if [ -f lib/librfc.a ]; then \
92 echo "Installing librfc.a -> $(LIBDIR)"; \
93 cp lib/librfc.a $(LIBDIR)/librfc.a; \
94 chmod 644 $(LIBDIR)/librfc.a; \
96 @if [ ! -d $(INCDIR) ]; then \
97 echo "Making directory $(INCDIR)"; \
100 @cd include; for f in *.h; do \
101 echo "Installing $$f -> $(INCDIR)"; \
102 cp $$f $(INCDIR)/$$f; chmod 644 $(INCDIR)/$$f; \
106 @if [ ! -d $(YAZDIR) ]; then \
107 echo "Making directory $(YAZDIR)"; \
110 @cd tab; for f in *; do \
111 if [ -f $$f ]; then \
112 echo "Installing $$f -> $(YAZDIR)"; \
113 cp $$f $(YAZDIR)/$$f; chmod 644 $(YAZDIR)/$$f; \
118 wc `find . -name '*.[ch]'`