-# Copyright (C) 1995-1998, Index Data
+# Copyright (C) 1995-1999, Index Data
# All rights reserved.
# Sebastian Hammer, Adam Dickmeiss
-# $Id: Makefile.in,v 1.5 1998-10-28 15:09:59 adam Exp $
+# $Id: Makefile.in,v 1.13 1999-11-30 13:47:10 adam Exp $
# Uncomment the lines below to enable mOSI communcation.
#CDEFS=-DUSE_XTIMOSI
CDEFS=@DEFS@
# Standard include path and original protocol encoders.
-INCLUDE=-I. -I../z39.50 -I../include
+INCLUDE=-I. -I../include
# The Module below is either asn (the original de/en-coders)
# or z39.50 (the compiled de/en-coders).
CPP=@CPP@
SHELL=/bin/sh
MAKE=make
-SUBDIR=$(MOD) util odr $(RFC1006) ccl comstack retrieval client server ztest lib
+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)" \
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
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