Updated information about YAZ.
[yaz-moved-to-github.git] / Makefile.in
index fcda7e6..83cc36f 100644 (file)
@@ -1,53 +1,52 @@
-# Copyright (C) 1995-1998, Index Data 
+# Copyright (C) 1995-1999, Index Data 
 # All rights reserved.
 # Sebastian Hammer, Adam Dickmeiss
-# $Id: Makefile.in,v 1.2 1998-08-25 16:19:37 adam Exp $
+# $Id: Makefile.in,v 1.13 1999-11-30 13:47:10 adam Exp $
 
 # Uncomment the lines below to enable mOSI communcation.
-#ODEFS=-DUSE_XTIMOSI
+#CDEFS=-DUSE_XTIMOSI
 #RFC1006=rfc1006
 #LIBMOSI=../../xtimosi/src/libmosi.a ../lib/librfc.a
 #XMOSI=xmosi.o
 
-CDEFS=@DEFS@ @ODEFS@
+CDEFS=@DEFS@
 
 # Standard include path and original protocol encoders.
 INCLUDE=-I. -I../include
-MOD=asn
-
-# Uncomment the two lines below if you want to try the ASN.1 compiler
-# (yc) for YAZ. Download yc separately and untar it along with YAZ:
-#  gunzip -c yaz.tar.gz | tar xvf -
-#  gunzip -c yc.tar.gz | tar xvf -
-#  cd yaz
-#  ln -s ../yc/z39.50 
-# You must run 'make depend' before 'make'.
-#INCLUDE=-I../z39.50 -I. -I../include
-#MOD=z39.50
+
+# The Module below is either asn (the original de/en-coders)
+# or z39.50 (the compiled de/en-coders).
+MOD=@ASNMODULE@
 
 CC=@CC@
 CPP=@CPP@
 SHELL=/bin/sh
 MAKE=make
-SUBDIR=$(MOD) util odr $(RFC1006) ccl comstack retrieval client server ztest makelib
+SUBDIR=util odr $(MOD) zutil $(RFC1006) ccl comstack client server ztest retrieval lib
 # Add external libraries to the LIBS macro
 LIBS=@LIBS@
 
 RANLIB=@RANLIB@
 
+INSTALL=@INSTALL@
+INSTALL_PROGRAM=@INSTALL_PROGRAM@
+INSTALL_DATA=@INSTALL_DATA@
+
 # Installation directories, etc.
 #  Binaries
 prefix=@prefix@
 exec_prefix=@exec_prefix@
 
+BUILD=@build_root@
 BINDIR=$(exec_prefix)/bin
 #  Public libraries and header files
 LIBDIR=$(exec_prefix)/lib
 INCDIR=$(prefix)/include
 #  Misc tables, etc.
 YAZDIR=$(prefix)/lib/yaz
+YAZTAB=$(prefix)/lib/yaz/tab
 
-all:
+all: yaz-config 
        for i in $(SUBDIR); do cd $$i; if $(MAKE) CC="$(CC)" \
                RANLIB="$(RANLIB)" LIBS="$(LIBS)" \
                INCLUDE="$(INCLUDE)" CFLAGS="$(CFLAGS)" \
@@ -57,75 +56,71 @@ all:
 
 dep depend:
        for i in $(SUBDIR); do cd $$i; if $(MAKE) CPP="$(CPP)" \
-               INCLUDE="$(INCLUDE)" CDEFS="$(CDEFS)" depend;\
-                then cd ..; else exit 1; fi; done
+               INCLUDE="$(INCLUDE)" CDEFS="$(CDEFS)" depend; \
+               then cd ..; else exit 1; fi; done
 
 clean:
        for i in $(SUBDIR); do (cd $$i; $(MAKE) clean); done
-       -rm lib/*.a
 
 oclean:
        for i in $(SUBDIR); do (cd $$i; rm -f *.o); done
        mv lib/libyaz.a .; rm -f lib/*.a; mv libyaz.a lib
        cd client; strip client
-       cd server; strip ztest
+       cd ztest; strip ztest
 
 cleanup:
-       rm -f `find $(SUBDIR) -name "*.[oa]" -print`
-       rm -f `find $(SUBDIR) -name "core" -print`
-       rm -f `find $(SUBDIR) -name "errlist" -print`
-       rm -f `find $(SUBDIR) -name "a.out" -print`
+       rm -f `find . -name "*.[oa]" -print`
+       rm -f `find . -name "core" -print`
+       rm -f `find . -name "errlist" -print`
+       rm -f `find . -name "a.out" -print`
+       rm -f `find . -name "yaz-config" -print`
 
 distclean: clean cleandepend
 
+comp:
+       cd z39.50; make comp
+
 cleandepend: 
        for i in $(SUBDIR); do (cd $$i; \
                if sed '/^#Depend/q' <Makefile >Makefile.tmp; then \
                mv -f Makefile.tmp Makefile; fi; rm -f .depend); done
 
-install: all install.misc install.lib install.bin
-
-install.bin:
-       @if [ ! -d $(BINDIR) ]; then \
-               echo "Making directory $(BINDIR)"; \
-               mkdir $(BINDIR); \
-       fi
-       @echo "Installing client -> $(BINDIR)"; \
-       cp client/client $(BINDIR)/client; chmod 755 $(BINDIR)/client
-       @echo "Installing ztest -> $(BINDIR)"; \
-       cp server/ztest $(BINDIR)/ztest; chmod 755 $(BINDIR)/ztest
-
-install.lib:
-       @if [ ! -d $(LIBDIR) ]; then \
-               echo "Making directory $(LIBDIR)"; \
-               mkdir $(LIBDIR); \
-       fi
-       @echo "Installing libyaz.a -> $(LIBDIR)"; \
-       cp lib/libyaz.a $(LIBDIR)/libyaz.a; \
-       chmod 644 $(LIBDIR)/libyaz.a
+yaz-config: Makefile
+       @echo "#!/bin/sh" >yaz-config
+       @echo "# YAZ settings for developers" >>yaz-config
+       @echo "YAZBIN=\"`pwd`/bin\"" >>yaz-config
+       @echo "YAZLIB=\"`pwd`/lib\"" >>yaz-config
+       @echo "YAZTAB=\"`pwd`/tab\"" >>yaz-config
+       @echo "YAZLIB=\"-L`pwd`/lib -lyaz $(LIBS)\"" >>yaz-config
+       @echo "YAZINC=\"-I`pwd`/include\"" >>yaz-config
+
+lib/yaz-config: Makefile
+       @echo "#!/bin/sh" >lib/yaz-config
+       @echo "# YAZ settings for developers" >>lib/yaz-config
+       @echo "YAZBIN='$(BINDIR)'" >>lib/yaz-config
+       @echo "YAZLIB='$(LIBDIR)'" >>lib/yaz-config
+       @echo "YAZTAB='$(YAZTAB)'" >>lib/yaz-config
+       @echo "YAZLIB='-L$(LIBDIR) -l yaz $(LIBS)'" >>lib/yaz-config
+       @echo "YAZINC='-I$(INCDIR)'" >>lib/yaz-config
+
+install: all lib/yaz-config
+       $(INSTALL) -d $(BUILD)$(BINDIR)
+       $(INSTALL_PROGRAM) client/yaz-client $(BUILD)$(BINDIR)
+       $(INSTALL_PROGRAM) ztest/yaz-ztest $(BUILD)$(BINDIR)
+       $(INSTALL_PROGRAM) lib/yaz-config $(BUILD)$(BINDIR)
+       $(INSTALL) -d $(BUILD)$(LIBDIR)
+       $(INSTALL_DATA) lib/libyaz.a $(BUILD)$(LIBDIR)
        @if [ -f lib/librfc.a ]; then \
-               echo "Installing librfc.a -> $(LIBDIR)"; \
-               cp lib/librfc.a $(LIBDIR)/librfc.a; \
-               chmod 644 $(LIBDIR)/librfc.a; \
+               $(INSTALL_DATA) lib/librfc.a $(BUILD)$(LIBDIR); \
         fi
-       @if [ ! -d $(INCDIR) ]; then \
-               echo "Making directory $(INCDIR)"; \
-               mkdir $(INCDIR); \
-       fi
-       @cd include; for f in *.h; do \
-               echo "Installing $$f -> $(INCDIR)"; \
-               cp $$f $(INCDIR)/$$f; chmod 644 $(INCDIR)/$$f; \
+       $(INSTALL) -d $(BUILD)$(INCDIR)/yaz
+       @cd include/yaz; for f in *.h; do \
+               $(INSTALL_DATA) $$f $(BUILD)$(INCDIR)/yaz; \
        done
-
-install.misc:
-       @if [ ! -d $(YAZDIR) ]; then \
-               echo "Making directory $(YAZDIR)"; \
-               mkdir $(YAZDIR); \
-       fi
+       $(INSTALL) -d $(BUILD)$(YAZTAB)
        @cd tab; for f in *; do \
                if [ -f $$f ]; then \
-                       echo "Installing $$f -> $(YAZDIR)"; \
-                       cp $$f $(YAZDIR)/$$f; chmod 644 $(YAZDIR)/$$f; \
+                       $(INSTALL_DATA) $$f $(BUILD)$(YAZTAB); \
                fi; \
        done