OSSP CVS Repository

ossp - ossp-pkg/xds/Makefile.in 1.41
Not logged in
[Honeypot]  [Browse]  [Directory]  [Home]  [Login
[Reports]  [Search]  [Ticket]  [Timeline
  [Raw

ossp-pkg/xds/Makefile.in 1.41
##
##  OSSP xds - Extensible Data Serialization
##  Copyright (c) 2001-2005 Ralf S. Engelschall <rse@engelschall.com>
##  Copyright (c) 2001-2005 The OSSP Project <http://www.ossp.org/>
##  Copyright (c) 2001-2005 Cable & Wireless <http://www.cw.com/>
##
##  This file is part of OSSP xds, an extensible data serialization
##  library which can be found at http://www.ossp.org/pkg/lib/xds/.
##
##  Permission to use, copy, modify, and distribute this software for
##  any purpose with or without fee is hereby granted, provided that
##  the above copyright notice and this permission notice appear in all
##  copies.
##
##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
##  SUCH DAMAGE.
##
##  Makefile.in: make(1) build procedure
##

@SET_MAKE@

#   installation paths
DESTDIR     =
TOP         = .
prefix      = @prefix@
exec_prefix = @exec_prefix@
bindir      = @bindir@
libdir      = @libdir@
includedir  = @includedir@
mandir      = @mandir@

#   build tools
CC          = @CC@
LIBTOOL     = ./libtool
SHTOOL      = ./shtool
CPPFLAGS    = @CPPFLAGS@ @DEFS@
CFLAGS      = @CFLAGS@
LDFLAGS     = @LDFLAGS@
LIBS        = @xdr_lib@ @LIBS@
POD2MAN     = @POD2MAN@
RM          = rm -f
RMDIR       = rmdir

#   list of objects
LIB_NAME    = libxds.la
LIB_OBJS    = xds.lo xds_engine_xdr.lo xds_engine_xml.lo
TST_SRCS    = xds_test_lib.c xds_test_xdr.c xds_test_xml.c

#   file containing the official version information
_VERSION_FILE = \
    xds_version.c

#   helper macro for updating version information
_VERSION = \
    $(SHTOOL) version -lc -nXDS -pxds_ $$OPT $(_VERSION_FILE);\
    V=`$(SHTOOL) version -lc -dlong $(_VERSION_FILE)`;\
    sed -e "s/Version .*(.*)/Version $$V/g" <README >README.n && mv README.n README

#   helper macro for generating a Unix manual page
_MANPAGE = \
    V1=`$(SHTOOL) version -lc -dshort $(_VERSION_FILE)`; \
    V2=`$(SHTOOL) version -lc -dlong $(_VERSION_FILE)`; \
    D=`$(SHTOOL) version -lc -dlong $(_VERSION_FILE) |\
       sed -e 's;.*(;;' -e 's;).*;;'`; \
    $(POD2MAN) --section=$${SEC} --center="$${ONELINE}" \
               --release="$$D" --date="$${NAME} $$V1" $(S)$${BASENAME}.pod |\
    sed -e "s;XDS_VERSION_STR;$$V2;" >$${BASENAME}.$${SEC}

.SUFFIXES:
.SUFFIXES: .c .lo

.PHONY:	clean distclean realclean check

.c.lo:
	$(LIBTOOL) --mode=compile --quiet $(CC) -c $(CPPFLAGS) $(CFLAGS) $<

all: $(LIB_NAME) xds.3 xds-config.1

$(LIB_NAME): $(LIB_OBJS)
	$(LIBTOOL) --mode=link --quiet $(CC) -o $(LIB_NAME) $(LIB_OBJS) -rpath $(libdir) \
	    -version-info `$(SHTOOL) version -l c -d libtool xds_version.c`

clean:
	-$(RM) $(LIB_NAME)
	-$(RM) *.lo *.o
	-$(RM) ./.*.t ./.*.l
	-$(RM) xds.3
	-$(RM) xds-config.1
	-$(RM) xds-config

distclean: clean
	-$(RM) config.log config.status Makefile libtool config.h
	-$(RM) -r .libs >/dev/null 2>&1 || true
	-$(RM) xds.h

realclean: distclean
	-$(RM) config.guess config.sub ltmain.sh libtool.m4
	-$(RM) configure config.h.in
	-$(RM) shtool

check:		$(LIB_NAME) $(TST_SRCS)
	-@for filename in $(TST_SRCS); do \
	    for testname in `grep "#ifdef XDS_TEST_" $$filename | sed -e 's;^#ifdef ;;'`; do \
            filebase=`echo $$filename | sed -e 's;\.c;;'`; \
            testbase=`echo $$testname | sed -e 's;^XDS_TEST_;;'`; \
	        if [ ! -f ".$$testbase.t" ]; then \
	            echo "$(LIBTOOL) --mode=link --quiet $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -D$$testname -o .$$testbase.t $$filebase.c $(LIB_NAME) $(LIBS)"; \
	            $(LIBTOOL) --mode=link --quiet $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -D$$testname -o .$$testbase.t $$filebase.c $(LIB_NAME) $(LIBS); \
            fi; \
        done; \
    done; \
    sh ./xds_test.sh "$(LIBTOOL) --mode=execute" ./.*.t

#   build Unix manual pages
xds-config.1: xds-config.pod $(_VERSION_FILE)
	BASENAME="xds-config"; SEC=1; \
	NAME="XDS"; ONELINE="Extensible Data Serialization"; \
	$(_MANPAGE)
xds.3: xds.pod $(_VERSION_FILE)
	BASENAME="xds"; SEC=3; \
	NAME="XDS"; ONELINE="Extensible Data Serialization"; \
	$(_MANPAGE)

#   build GNU style ChangeLog
ChangeLog::
	cvs2cl --revisions --branches --tags --no-wrap --separate-header --gmt
	-$(RM) ChangeLog.bak

#   perform standard installation procedure
install: all
	$(SHTOOL) mkdir -p -f -m 755 $(DESTDIR)$(bindir)
	$(SHTOOL) mkdir -p -f -m 755 $(DESTDIR)$(includedir)
	$(SHTOOL) mkdir -p -f -m 755 $(DESTDIR)$(libdir)
	$(SHTOOL) mkdir -p -f -m 755 $(DESTDIR)$(mandir)/man1
	$(SHTOOL) mkdir -p -f -m 755 $(DESTDIR)$(mandir)/man3
	$(SHTOOL) install -c -m 755 xds-config $(DESTDIR)$(bindir)/xds-config
	$(SHTOOL) install -c -m 644 xds-config.1 $(DESTDIR)$(mandir)/man1/xds-config.1
	$(SHTOOL) install -c -m 644 xds.3 $(DESTDIR)$(mandir)/man3/xds.3
	$(SHTOOL) install -c -m 644 xds.h $(DESTDIR)$(includedir)/xds.h
	@$(LIBTOOL) --mode=install $(SHTOOL) install -c -m 644 \
	    libxds.la $(DESTDIR)$(libdir)/libxds.la

#   perform standard uninstallation procedure
uninstall:
	-@$(LIBTOOL) --mode=uninstall $(RM) $(DESTDIR)$(libdir)/libxds.la
	-$(RM) $(DESTDIR)$(includedir)/xds.h
	-$(RM) $(DESTDIR)$(mandir)/man3/xds.3
	-$(RM) $(DESTDIR)$(mandir)/man1/xds-config.1
	-$(RM) $(DESTDIR)$(bindir)/xds-config
	-$(RMDIR) $(DESTDIR)$(mandir)/man3
	-$(RMDIR) $(DESTDIR)$(mandir)/man1
	-$(RMDIR) $(DESTDIR)$(mandir)
	-$(RMDIR) $(DESTDIR)$(libdir)
	-$(RMDIR) $(DESTDIR)$(includedir)
	-$(RMDIR) $(DESTDIR)$(bindir)

# Dependencies

$(LIB_OBJS):			xds_p.h xds.h


CVSTrac 2.0.1