X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=Makefile;h=93d9fdb6584a6d0f632efa0a4da7a2152e36a9d9;hp=dfc8cb4b07e549bd754213e26b16cb031ef572b9;hb=ffb88e8bb97c6e24989b7f04b8bbf1a4203d2f72;hpb=61c0c42465b6886f6aff3c5cf6a94404b03a1fbd diff --git a/Makefile b/Makefile index dfc8cb4..93d9fdb 100644 --- a/Makefile +++ b/Makefile @@ -1,28 +1,50 @@ -# Copyright (C) 1994, Index Data I/S +# Copyright (C) 1995-1998, Index Data I/S # All rights reserved. # Sebastian Hammer, Adam Dickmeiss -# $Id: Makefile,v 1.6 1995-04-10 10:22:06 quinn Exp $ +# $Id: Makefile,v 1.36 1998-01-29 13:43:03 adam Exp $ -# Define -DUSE_XTIMOSI to enable the xtimosi functionality. Remeber to -# also modify the makefiles under yazlib/ and server/ (according the -# comments found there). Uncomment RFC1006. - -#DEFS=-DUSE_XTIMOSI +# Uncomment the lines below to enable mOSI communcation. +#ODEFS=-DUSE_XTIMOSI #RFC1006=rfc1006 +#LIBMOSI=../../xtimosi/src/libmosi.a ../lib/librfc.a +#XMOSI=xmosi.o +CDEFS=$(ODEFS) #CC= SHELL=/bin/sh MAKE=make -SUBDIR=util odr asn $(RFC1006) ccl yazlib server makelib +SUBDIR=util odr asn $(RFC1006) ccl comstack retrieval client server ztest makelib +# Add external libraries to the ELIBS macro +ELIBS= +CONTROL=RANLIB="ranlib" ELIBS="$(ELIBS)" + +# Installation directories, etc. +# Binaries +BINDIR=/usr/local/bin +# Public libraries and header files +LIBDIR=/usr/local/lib +INCDIR=/usr/local/include +# Misc tables, etc. +YAZDIR=/usr/local/lib/yaz all: - for i in $(SUBDIR); do cd $$i; if $(MAKE) CFLAGS="$(CFLAGS) $(DEFS)"; then cd ..; else exit 1; fi; done + for i in $(SUBDIR); do cd $$i; if $(MAKE) $(CONTROL) \ + 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) depend; then cd ..; else exit 1; fi; done + for i in $(SUBDIR); do cd $$i; if $(MAKE) 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 cleanup: rm -f `find $(SUBDIR) -name "*.[oa]" -print` @@ -30,29 +52,75 @@ cleanup: rm -f `find $(SUBDIR) -name "errlist" -print` rm -f `find $(SUBDIR) -name "a.out" -print` -distclean: cleanup clean +distclean: clean cleandepend + +cleandepend: for i in $(SUBDIR); do (cd $$i; \ - mv Makefile Makefile.old; \ - sed '/^#Depend/q' Makefile; \ - rm Makefile.old); done + if sed '/^#Depend/q' Makefile.tmp; then \ + mv -f Makefile.tmp Makefile; fi; rm -f .depend); done -usedepend1: +taildepend: for i in $(SUBDIR); do (cd $$i; \ - mv Makefile Makefile.tmp; \ - sed 's/^if/#if/' Makefile; \ - rm Makefile.tmp); done + sed 's/^depend: depend2/depend: depend1/g' | \ + sed '/^#Depend/q' >Makefile.tmp; then \ + mv -f Makefile.tmp Makefile; fi); done -usedepend2: +gnudepend: for i in $(SUBDIR); do (cd $$i; \ - mv Makefile Makefile.tmp; \ - sed '/^#Depend/q' Makefile; \ - rm Makefile.tmp); done + sed 's/^depend: depend1/depend: depend2/g' >Makefile.tmp;then \ + mv -f Makefile.tmp Makefile; fi); 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 + @if [ -f lib/librfc.a ]; then \ + echo "Installing librfc.a -> $(LIBDIR)"; \ + cp lib/librfc.a $(LIBDIR)/librfc.a; \ + chmod 644 $(LIBDIR)/librfc.a; \ + 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; \ + done + +install.misc: + @if [ ! -d $(YAZDIR) ]; then \ + echo "Making directory $(YAZDIR)"; \ + mkdir $(YAZDIR); \ + fi + @cd tab; for f in *; do \ + if [ -f $$f ]; then \ + echo "Installing $$f -> $(YAZDIR)"; \ + cp $$f $(YAZDIR)/$$f; chmod 644 $(YAZDIR)/$$f; \ + fi; \ + done wc: wc `find . -name '*.[ch]'` - +