################################################################
# This Makefile is created from Makefile.in by the main Prolog
# configuration in .../pl/src/configure.
#
# It can be used to configure and make the add-on packages.
################################################################
.EXPORT_ALL_VARIABLES:
# Define the packages you wish to build. Please note that xpce requires
# libXPM and libjpeg to compile. This variable is normally overruled
# from the configure script. MUST be on one line
PKG= clib cpp odbc table xpce sgml RDF semweb http chr clpqr nlp ssl tipc pldoc plunit jpl zlib R protobufs windows PDT utf8proc archive
# Define additional config options shared by all packages here.
CNFG=@CNFG@
################################################################
# Normally, all should be fine below here
################################################################
# Values filled from the main SWI-Prolog configure
MAKE=@MAKE@
prefix=@prefix@
exec_prefix=@exec_prefix@
bindir=@bindir@
PL=@PL@
PLVERSION=@PLVERSION@
PLBASE=@PLBASE@
PKGDOC=$(PLBASE)/doc/packages
PLLIBS=@LIBS@
PLARCH=@PLARCH@
PLLDFLAGS=@LDFLAGS@
PLDIR=$(shell dirname `pwd`)
PLINCL=$(PLDIR)/include
LIBDIR=$(PLDIR)/lib/$(PLARCH)
PLSHARED=@PLSHARED@
PLTHREADS=@PLTHREADS@
INSTALL=@INSTALL@
INSTALL_DATA=@INSTALL_DATA@
SO=@SO_EXT@
BUILDDIR=@BUILDDIR@
PLLIB=$(PLBASE)/library
# These programs should use prolog from the (already installed) $(bindir)
PATH=$(bindir):$(shell echo $$PATH)
# How to run configure. We pass the information required from SWI-Prolog
# in the environment. All configure scripts in the packages are designed
# to trust the environment if they find $PLINCL. Otherwise they run Prolog
# to find the required parameters.
#
# BUILDDIR passes the relative location of the directory SWI-Prolog was
# build (i.e. linux, solaris, ...) This means packages can find information
# on the installed Prolog using ../../$BUILDDIR
CONFIG= env PL="$(PL)" PLBASE="$(PLBASE)" PLARCH="$(PLARCH)" \
PLLIBS="$(PLLIBS)" PLLDFLAGS="$(PLLDFLAGS)" \
PLINCL="$(PLINCL)" PLSHARED="$(PLSHARED)" \
PLTHREADS="$(PLSHARED)" \
PLSOEXT="$(SO)" BUILDDIR="$(BUILDDIR)" \
LD_LIBRARY_PATH="$(LIBDIR):$$LD_LIBRARY_PATH" \
MAKE="$(MAKE)" \
./configure $(CNFG) $(CNFGPASSED) --prefix=$(prefix)
define FORCE_MKINDEX
@echo "*** Forcing update of library index ***"
rm -f $(DESTDIR)$(PLLIB)/INDEX.pl
./swipl.sh -C "$(DESTDIR)$(PLLIB)" -f none -F none \
-g "make_library_index(.)" -t halt
./swipl.sh -C "$(DESTDIR)$(PLBASE)" --home=. -f none -g make -t halt
endef
all: objects
objects::
for p in $(PKG); do \
if [ -r $$p/Makefile ]; then $(MAKE) -C $$p || exit 1; fi; \
done
html::
for p in $(PKG); do \
if [ -r $$p/Makefile ]; then $(MAKE) -C $$p $@ || exit 1; fi; \
done
install::
for p in $(PKG); do \
if [ -r $$p/Makefile ]; then $(MAKE) -C $$p $@ || exit 1; fi; \
done
$(FORCE_MKINDEX)
rpm-install: html-install
for p in $(PKG); do \
if [ -r $$p/Makefile ]; then $(MAKE) -C $$p $@ || exit 1; fi; \
done
$(FORCE_MKINDEX)
pdf-install::
mkdir -p $(DESTDIR)$(PKGDOC)
for p in $(PKG); do \
if [ -r $$p/Makefile ]; then $(MAKE) -C $$p $@ || exit 1; fi; \
done
html-install::
mkdir -p $(DESTDIR)$(PKGDOC)
for p in $(PKG); do \
if [ -r $$p/Makefile ]; then $(MAKE) -C $$p $@ || exit 1; fi; \
done
$(INSTALL_DATA) index.html $(DESTDIR)$(PKGDOC)
ln-install::
for p in $(PKG); do \
if [ -r $$p/Makefile ]; then $(MAKE) -C $$p $@ || exit 1; fi; \
done
$(FORCE_MKINDEX)
configure::
@echo "**********************"
@echo "* Configuring packages $(PKG)"
@echo "**********************"
@for p in $(PKG); do \
if [ -r $$p/configure ]; then \
echo "**********************"; \
echo "* Package $$p"; \
echo "**********************"; \
if [ ! -r $$p/config.status -o $$p/config.status -ot $$p/configure ]; then \
( cd $$p && $(CONFIG) ) || exit 1; \
else \
( cd $$p && ./config.status ) || exit 1; \
fi; \
fi; \
done
doc::
for p in $(PKG); do \
if [ -r $$p/Makefile ]; then $(MAKE) -C $$p pdf html || exit 1; fi; \
done
distclean::
for p in $(PKG); do \
if [ -r $$p/Makefile ]; then $(MAKE) -C $$p $@ || true; fi; \
done
rm -f swipl.sh swipl-ld.sh
rm -f Makefile configure Dialect.defs Makefile.defs
clean::
for p in $(PKG); do \
if [ -r $$p/Makefile ]; then $(MAKE) -C $$p $@ || true; fi; \
done
check::
@rm -f .FAILED_TESTS
for p in $(PKG); do \
if [ -r $$p/Makefile ]; then $(MAKE) -C $$p $@ || echo $$p > .FAILED_TESTS; fi; \
done
@if [ -f .FAILED_TESTS ]; then echo "Tests in `cat .FAILED_TESTS` failed" && exit 1; fi
# test environment
printenv::
printenv