OSSP CVS Repository

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

ossp-pkg/xds/Makefile.in 1.27
##
##  XDS - OSSP Extensible Data Serialization Library
##  Copyright (c) 2001 The OSSP Project (http://www.ossp.org/)
##  Copyright (c) 2001 Cable & Wireless Deutschland (http://www.cw.com/de/)
##  
##  This file is part of OSSP XDS, an extensible data serialization
##  library which can be found at http://www.ossp.org/pkg/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@ -D_GNU_SOURCE
CFLAGS      = @CFLAGS@
LDFLAGS     = @LDFLAGS@
LIBS        = @LIBS@
POD2MAN     = @POD2MAN@

#   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_OBJS)
	-$(RM) ./.*.t ./.*.l
	-$(RM) $(LIB_NAME)
	-$(RM) xds.3

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

realclean: distclean
	-$(RM) configure

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)

#   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)

#   roll a distribution tarball
dist: distclean
	@$(SHTOOL) fixperm -v .; \
	V=`$(SHTOOL) version -l c -d short xds_version.c`; \
	$(SHTOOL) tarball -o xds-$${V}.tar.gz -d str-$${V} -u ossp -g ossp \
	                  -e 'CVS,\.cvsignore,\.[ao],^\.' -c 'gzip --best' .

#   increase or update version information
new-version:
	@V="$(VERSION)"; \
	if [ ".$$V" != . ]; then \
		OPT="-s$$V"; \
	else \
		OPT="-e"; \
	fi; \
	$(_VERSION)
update-version:
	@OPT="-s`$(SHTOOL) version -lc -dshort $(_VERSION_FILE)`" && $(_VERSION)

# Dependencies

$(LIB_OBJS):			xds_p.h xds.h


CVSTrac 2.0.1