1 # Copyright (C) 1995-1999, Index Data
3 # Sebastian Hammer, Adam Dickmeiss
4 # $Id: Makefile.in,v 1.13 1999-11-30 13:47:10 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
17 # The Module below is either asn (the original de/en-coders)
18 # or z39.50 (the compiled de/en-coders).
25 SUBDIR=util odr $(MOD) zutil $(RFC1006) ccl comstack client server ztest retrieval lib
26 # Add external libraries to the LIBS macro
32 INSTALL_PROGRAM=@INSTALL_PROGRAM@
33 INSTALL_DATA=@INSTALL_DATA@
35 # Installation directories, etc.
38 exec_prefix=@exec_prefix@
41 BINDIR=$(exec_prefix)/bin
42 # Public libraries and header files
43 LIBDIR=$(exec_prefix)/lib
44 INCDIR=$(prefix)/include
46 YAZDIR=$(prefix)/lib/yaz
47 YAZTAB=$(prefix)/lib/yaz/tab
50 for i in $(SUBDIR); do cd $$i; if $(MAKE) CC="$(CC)" \
51 RANLIB="$(RANLIB)" LIBS="$(LIBS)" \
52 INCLUDE="$(INCLUDE)" CFLAGS="$(CFLAGS)" \
54 LIBMOSI="$(LIBMOSI)" XMOSI="$(XMOSI)";\
55 then cd ..; else exit 1; fi; done
58 for i in $(SUBDIR); do cd $$i; if $(MAKE) CPP="$(CPP)" \
59 INCLUDE="$(INCLUDE)" CDEFS="$(CDEFS)" depend; \
60 then cd ..; else exit 1; fi; done
63 for i in $(SUBDIR); do (cd $$i; $(MAKE) clean); done
66 for i in $(SUBDIR); do (cd $$i; rm -f *.o); done
67 mv lib/libyaz.a .; rm -f lib/*.a; mv libyaz.a lib
68 cd client; strip client
72 rm -f `find . -name "*.[oa]" -print`
73 rm -f `find . -name "core" -print`
74 rm -f `find . -name "errlist" -print`
75 rm -f `find . -name "a.out" -print`
76 rm -f `find . -name "yaz-config" -print`
78 distclean: clean cleandepend
84 for i in $(SUBDIR); do (cd $$i; \
85 if sed '/^#Depend/q' <Makefile >Makefile.tmp; then \
86 mv -f Makefile.tmp Makefile; fi; rm -f .depend); done
89 @echo "#!/bin/sh" >yaz-config
90 @echo "# YAZ settings for developers" >>yaz-config
91 @echo "YAZBIN=\"`pwd`/bin\"" >>yaz-config
92 @echo "YAZLIB=\"`pwd`/lib\"" >>yaz-config
93 @echo "YAZTAB=\"`pwd`/tab\"" >>yaz-config
94 @echo "YAZLIB=\"-L`pwd`/lib -lyaz $(LIBS)\"" >>yaz-config
95 @echo "YAZINC=\"-I`pwd`/include\"" >>yaz-config
97 lib/yaz-config: Makefile
98 @echo "#!/bin/sh" >lib/yaz-config
99 @echo "# YAZ settings for developers" >>lib/yaz-config
100 @echo "YAZBIN='$(BINDIR)'" >>lib/yaz-config
101 @echo "YAZLIB='$(LIBDIR)'" >>lib/yaz-config
102 @echo "YAZTAB='$(YAZTAB)'" >>lib/yaz-config
103 @echo "YAZLIB='-L$(LIBDIR) -l yaz $(LIBS)'" >>lib/yaz-config
104 @echo "YAZINC='-I$(INCDIR)'" >>lib/yaz-config
106 install: all lib/yaz-config
107 $(INSTALL) -d $(BUILD)$(BINDIR)
108 $(INSTALL_PROGRAM) client/yaz-client $(BUILD)$(BINDIR)
109 $(INSTALL_PROGRAM) ztest/yaz-ztest $(BUILD)$(BINDIR)
110 $(INSTALL_PROGRAM) lib/yaz-config $(BUILD)$(BINDIR)
111 $(INSTALL) -d $(BUILD)$(LIBDIR)
112 $(INSTALL_DATA) lib/libyaz.a $(BUILD)$(LIBDIR)
113 @if [ -f lib/librfc.a ]; then \
114 $(INSTALL_DATA) lib/librfc.a $(BUILD)$(LIBDIR); \
116 $(INSTALL) -d $(BUILD)$(INCDIR)/yaz
117 @cd include/yaz; for f in *.h; do \
118 $(INSTALL_DATA) $$f $(BUILD)$(INCDIR)/yaz; \
120 $(INSTALL) -d $(BUILD)$(YAZTAB)
121 @cd tab; for f in *; do \
122 if [ -f $$f ]; then \
123 $(INSTALL_DATA) $$f $(BUILD)$(YAZTAB); \
128 wc `find . -name '*.[ch]'`