1 # Copyright (C) 1995-1999, Index Data
3 # Sebastian Hammer, Adam Dickmeiss
4 # $Id: Makefile.in,v 1.14 1999-12-16 23:36:19 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
21 SUBDIR=util odr @ASNMODULE@ @ILLMODULE@ zutil $(RFC1006) ccl comstack server retrieval lib client ztest
22 # Add external libraries to the LIBS macro
28 INSTALL_PROGRAM=@INSTALL_PROGRAM@
29 INSTALL_DATA=@INSTALL_DATA@
31 # Installation directories, etc.
34 exec_prefix=@exec_prefix@
37 BINDIR=$(exec_prefix)/bin
38 # Public libraries and header files
39 LIBDIR=$(exec_prefix)/lib
40 INCDIR=$(prefix)/include
42 YAZDIR=$(prefix)/lib/yaz
43 YAZTAB=$(prefix)/lib/yaz/tab
46 for i in $(SUBDIR); do cd $$i; if $(MAKE) CC="$(CC)" \
47 RANLIB="$(RANLIB)" LIBS="$(LIBS)" \
48 INCLUDE="$(INCLUDE)" CFLAGS="$(CFLAGS)" \
50 LIBMOSI="$(LIBMOSI)" XMOSI="$(XMOSI)";\
51 then cd ..; else exit 1; fi; done
54 for i in $(SUBDIR); do cd $$i; if $(MAKE) CPP="$(CPP)" \
55 INCLUDE="$(INCLUDE)" CDEFS="$(CDEFS)" depend; \
56 then cd ..; else exit 1; fi; done
59 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
68 rm -f `find . -name "*.[oa]" -print`
69 rm -f `find . -name "core" -print`
70 rm -f `find . -name "errlist" -print`
71 rm -f `find . -name "a.out" -print`
72 rm -f `find . -name "yaz-config" -print`
74 distclean: clean cleandepend
80 for i in $(SUBDIR); do (cd $$i; \
81 if sed '/^#Depend/q' <Makefile >Makefile.tmp; then \
82 mv -f Makefile.tmp Makefile; fi; rm -f .depend); done
85 @echo "#!/bin/sh" >yaz-config
86 @echo "# YAZ settings for developers" >>yaz-config
87 @echo "YAZBIN=\"`pwd`/bin\"" >>yaz-config
88 @echo "YAZLIB=\"`pwd`/lib\"" >>yaz-config
89 @echo "YAZTAB=\"`pwd`/tab\"" >>yaz-config
90 @echo "YAZLIB=\"-L`pwd`/lib -lyaz $(LIBS)\"" >>yaz-config
91 @echo "YAZINC=\"-I`pwd`/include\"" >>yaz-config
93 lib/yaz-config: Makefile
94 @echo "#!/bin/sh" >lib/yaz-config
95 @echo "# YAZ settings for developers" >>lib/yaz-config
96 @echo "YAZBIN='$(BINDIR)'" >>lib/yaz-config
97 @echo "YAZLIB='$(LIBDIR)'" >>lib/yaz-config
98 @echo "YAZTAB='$(YAZTAB)'" >>lib/yaz-config
99 @echo "YAZLIB='-L$(LIBDIR) -l yaz $(LIBS)'" >>lib/yaz-config
100 @echo "YAZINC='-I$(INCDIR)'" >>lib/yaz-config
102 install: all lib/yaz-config
103 $(INSTALL) -d $(BUILD)$(BINDIR)
104 $(INSTALL_PROGRAM) client/yaz-client $(BUILD)$(BINDIR)
105 $(INSTALL_PROGRAM) ztest/yaz-ztest $(BUILD)$(BINDIR)
106 $(INSTALL_PROGRAM) lib/yaz-config $(BUILD)$(BINDIR)
107 $(INSTALL) -d $(BUILD)$(LIBDIR)
108 $(INSTALL_DATA) lib/libyaz.a $(BUILD)$(LIBDIR)
109 @if [ -f lib/librfc.a ]; then \
110 $(INSTALL_DATA) lib/librfc.a $(BUILD)$(LIBDIR); \
112 $(INSTALL) -d $(BUILD)$(INCDIR)/yaz
113 @cd include/yaz; for f in *.h; do \
114 $(INSTALL_DATA) $$f $(BUILD)$(INCDIR)/yaz; \
116 $(INSTALL) -d $(BUILD)$(YAZTAB)
117 @cd tab; for f in *; do \
118 if [ -f $$f ]; then \
119 $(INSTALL_DATA) $$f $(BUILD)$(YAZTAB); \
124 wc `find . -name '*.[ch]'`