# Copyright (C) 1995-1999, Index Data # All rights reserved. # Sebastian Hammer, Adam Dickmeiss # $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 #RFC1006=rfc1006 #LIBMOSI=../../xtimosi/src/libmosi.a ../lib/librfc.a #XMOSI=xmosi.o CDEFS=@DEFS@ # Standard include path and original protocol encoders. INCLUDE=-I. -I../include # 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=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: yaz-config for i in $(SUBDIR); do cd $$i; if $(MAKE) CC="$(CC)" \ RANLIB="$(RANLIB)" LIBS="$(LIBS)" \ INCLUDE="$(INCLUDE)" CFLAGS="$(CFLAGS)" \ CDEFS="$(CDEFS)" \ LIBMOSI="$(LIBMOSI)" XMOSI="$(XMOSI)";\ then cd ..; else exit 1; fi; done 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 clean: for i in $(SUBDIR); do (cd $$i; $(MAKE) clean); done 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 ztest; strip ztest cleanup: 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.tmp; then \ mv -f Makefile.tmp Makefile; fi; rm -f .depend); done 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 \ $(INSTALL_DATA) lib/librfc.a $(BUILD)$(LIBDIR); \ fi $(INSTALL) -d $(BUILD)$(INCDIR)/yaz @cd include/yaz; for f in *.h; do \ $(INSTALL_DATA) $$f $(BUILD)$(INCDIR)/yaz; \ done $(INSTALL) -d $(BUILD)$(YAZTAB) @cd tab; for f in *; do \ if [ -f $$f ]; then \ $(INSTALL_DATA) $$f $(BUILD)$(YAZTAB); \ fi; \ done wc: wc `find . -name '*.[ch]'`