ossp-pkg/cfg/Makefile.in
##
## OSSP cfg - Configuration Parsing
## Copyright (c) 2002-2006 Ralf S. Engelschall <rse@engelschall.com>
## Copyright (c) 2002-2006 The OSSP Project <http://www.ossp.org/>
##
## This file is part of OSSP cfg, a configuration parsing library which
## can be found at http://www.ossp.org/pkg/lib/cfg/.
##
## 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 =
prefix = @prefix@
exec_prefix = @exec_prefix@
datarootdir = @datarootdir@
bindir = @bindir@
libdir = @libdir@
includedir = @includedir@
mandir = @mandir@
# build tools
CC = @CC@
CPPFLAGS = @CPPFLAGS@
CFLAGS = @DEFS@ @CFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
RM = rm -f
RMDIR = rmdir
SHTOOL = ./shtool
LIBTOOL = ./libtool
TRUE = true
POD2MAN = pod2man
FLEX = @FLEX@
BISON = @BISON@
PERL = @PERL@
# build objects
LIB_NAME = libcfg.la
LIB_OBJS = cfg_main.lo cfg_buf.lo cfg_grid.lo cfg_data.lo cfg_node.lo cfg_fmt.lo \
cfg_syn.lo cfg_syn_parse.lo cfg_syn_scan.lo cfg_util.lo cfg_vers.lo
TST_NAME = cfg_test
TST_OBJS = cfg_test.o
PERL_NAME = perl/blib/lib/OSSP/cfg.pm
PERL_OBJS = perl/cfg.pm
WITH_PERL = @WITH_PERL@
# recognized suffixes for implicit rules
.SUFFIXES:
.SUFFIXES: .c .o .lo
# default target
all: $(LIB_NAME) $(TST_NAME) @PERL_NAME@
# implicit rules for compilation
.c.o:
$(CC) $(CPPFLAGS) $(CFLAGS) -c $<
.c.lo:
$(LIBTOOL) --quiet --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) -c $<
# explicit rule for library linking
$(LIB_NAME): $(LIB_OBJS)
$(LIBTOOL) --quiet --mode=link $(CC) -o $(LIB_NAME) $(LIB_OBJS) -rpath $(libdir) \
-version-info `$(SHTOOL) version -l c -d libtool cfg_vers.c`
# explicit rule for test program linking
$(TST_NAME): $(TST_OBJS) $(LIB_NAME)
$(LIBTOOL) --quiet --mode=link $(CC) $(LDFLAGS) -o $(TST_NAME) $(TST_OBJS) $(LIB_NAME) $(LIBS)
# explicit rule for Perl API
$(PERL_NAME): $(PERL_OBJS) $(LIB_NAME)
@cd perl && $(PERL) Makefile.PL PREFIX=$(prefix) && $(MAKE) $(MFLAGS) all
@touch $(PERL_NAME)
# explicit rules for compiler construction tools
cfg_syn.c: cfg_syn.h cfg_syn_parse.h
cfg_syn_scan.o: cfg_syn_scan.c cfg_syn_parse.h
cfg_syn_scan.c: cfg_syn_scan.l
$(FLEX) -Pcfg_syn_ -s -8 -B -ocfg_syn_scan.c cfg_syn_scan.l
cfg_syn_parse.c cfg_syn_parse.h: cfg_syn_parse.y
$(BISON) -d -k -pcfg_syn_ -ocfg_syn_parse.c cfg_syn_parse.y
# explicit rule for manual page construction
man: cfg.3
cfg.3: cfg.pod
V1=`$(SHTOOL) version -l c -d short cfg_vers.c`; \
V2=`$(SHTOOL) version -l c -d long cfg_vers.c`; \
D=`$(SHTOOL) version -l c -d long cfg_vers.c | sed -e 's;.*(;;' -e 's;).*;;'`; \
$(POD2MAN) --quotes=none \
--section=3 --center="Configuration Parsing" \
--release="$$D" --date="OSSP cfg $$V1" cfg.pod | \
sed -e "s;CFG_VERSION_STR;$$V2;" >cfg.3
# running the test suite
test: check
check: $(TST_NAME)
@$(SHTOOL) echo -e "%BParsing cfg_test.cfg:%b"; \
./$(TST_NAME) cfg_test.cfg 2>&1 | tee cfg_test.try
-@diff -u3 cfg_test.out cfg_test.try >/dev/null 2>&1; \
if [ $$? -ne 0 ]; then \
$(SHTOOL) echo -e "%BATTENTION: Parsing Difference (cfg_test.cfg vs. cfg_test.out):%b"; \
diff -u3 cfg_test.out cfg_test.try; \
fi
-@if [ ".$(WITH_PERL)" = .yes ]; then \
(cd perl && $(MAKE) $(MFLAGS) test); \
fi
check-setup:
@./$(TST_NAME) cfg_test.cfg >cfg_test.out
# perform installation procedure
install:
$(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(prefix)
$(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(bindir)
$(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(includedir)
$(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(libdir)
$(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(mandir)/man3
$(SHTOOL) install -c -m 755 cfg-config $(DESTDIR)$(bindir)/
$(SHTOOL) install -c -m 644 cfg.h $(DESTDIR)$(includedir)/
$(SHTOOL) install -c -m 644 cfg.3 $(DESTDIR)$(mandir)/man3/
$(LIBTOOL) --quiet --mode=install $(SHTOOL) install -c -m 644 libcfg.la $(DESTDIR)$(libdir)/
-@if [ ".$(WITH_PERL)" = .yes ]; then \
(cd perl && $(MAKE) $(MFLAGS) install); \
fi
# perform uninstallation procedure
uninstall:
$(LIBTOOL) --quiet --mode=uninstall $(RM) $(DESTDIR)$(libdir)/libcfg.la
-$(RM) $(DESTDIR)$(mandir)/man3/cfg.3
-$(RM) $(DESTDIR)$(includedir)/cfg.h
-$(RM) $(DESTDIR)$(bindir)/cfg-config
-$(RMDIR) $(DESTDIR)$(mandir)/man3 >/dev/null 2>&1 || $(TRUE)
-$(RMDIR) $(DESTDIR)$(mandir) >/dev/null 2>&1 || $(TRUE)
-$(RMDIR) $(DESTDIR)$(libdir) >/dev/null 2>&1 || $(TRUE)
-$(RMDIR) $(DESTDIR)$(includedir) >/dev/null 2>&1 || $(TRUE)
-$(RMDIR) $(DESTDIR)$(bindir) >/dev/null 2>&1 || $(TRUE)
-$(RMDIR) $(DESTDIR)$(prefix) >/dev/null 2>&1 || $(TRUE)
# perform build clean up procedure
clean:
-$(RM) $(LIB_NAME) $(LIB_OBJS)
-$(RM) $(TST_NAME) $(TST_OBJS)
-$(RM) cfg_test.try
-$(RM) -r .libs >/dev/null 2>&1 || $(TRUE)
-$(RM) *.o *.lo
-@if [ ".$(WITH_PERL)" = .yes ]; then \
(cd perl && $(MAKE) $(MFLAGS) clean); \
fi
# perform distribution clean up procedure
distclean: clean
-$(RM) config.log config.status config.cache
-$(RM) Makefile config.h cfg-config
-$(RM) libtool
-@if [ ".$(WITH_PERL)" = .yes ]; then \
(cd perl && $(MAKE) $(MFLAGS) distclean || true; rm -f Makefile.old); \
fi
# perform developer clean up procedure
realclean: distclean
-$(RM) cfg.3
-$(RM) configure config.h.in
-$(RM) shtool
-$(RM) ltmain.sh libtool.m4 config.guess config.sub
-$(RM) cfg_syn_parse.c cfg_syn_parse.h
-$(RM) cfg_syn_scan.c