2012-10-13 12:37:25 -04:00
|
|
|
include srcdir.mk
|
2006-12-20 22:57:49 -05:00
|
|
|
|
2008-05-23 16:56:24 -04:00
|
|
|
BLDDIR = $(CURDIR)
|
|
|
|
SUBDIR =
|
2006-12-20 22:57:49 -05:00
|
|
|
|
2008-05-23 16:56:24 -04:00
|
|
|
export SRCDIR
|
|
|
|
export BLDDIR
|
2006-12-20 22:57:49 -05:00
|
|
|
|
2008-05-23 16:56:24 -04:00
|
|
|
include $(BLDDIR)/config.mk
|
|
|
|
|
|
|
|
SUBDIRS = include lib src tools examples
|
|
|
|
|
|
|
|
# The reason we don't build tools and examples by default is that they
|
|
|
|
# contain executables, which require significantly more from the
|
|
|
|
# environment to build than libraries. Ergo, they are signficantly
|
|
|
|
# more likely to fail to build. Indeed, when 'tools' was built by
|
|
|
|
# default, the majority of the reported build problems were with that.
|
|
|
|
# Since they are ancillary to the package, building them by default is
|
|
|
|
# not worth causing the whole build to fail.
|
|
|
|
|
|
|
|
# As with any subdirectory, to build 'tools' or 'examples', cd to the
|
|
|
|
# subdirectory and make there.
|
|
|
|
|
|
|
|
DEFAULT_SUBDIRS = include lib src
|
2006-12-20 22:57:49 -05:00
|
|
|
|
2012-10-13 12:37:25 -04:00
|
|
|
ifeq ($(BUILD_TOOLS),yes)
|
|
|
|
DEFAULT_SUBDIRS += tools
|
|
|
|
endif
|
|
|
|
|
2008-05-23 16:56:24 -04:00
|
|
|
PROGRAMS_TO_INSTALL = xmlrpc-c-config
|
2006-12-20 22:57:49 -05:00
|
|
|
|
2008-05-23 16:56:24 -04:00
|
|
|
default: xmlrpc-c-config xmlrpc-c-config.test $(DEFAULT_SUBDIRS:%=%/all)
|
2006-12-20 22:57:49 -05:00
|
|
|
|
2012-10-13 12:37:25 -04:00
|
|
|
# We don't want common.mk's rule for version.h
|
|
|
|
OMIT_VERSION_H = Y
|
|
|
|
|
|
|
|
# We don't want common.mk's rule for transport_config.h
|
|
|
|
OMIT_TRANSPORT_CONFIG_H = Y
|
|
|
|
|
|
|
|
# We don't want common.mk's rule for xmlrpc-c-config.test:
|
|
|
|
OMIT_XMLRPC_C_CONFIG_TEST = Y
|
|
|
|
|
|
|
|
include $(SRCDIR)/common.mk
|
|
|
|
|
2006-12-20 22:57:49 -05:00
|
|
|
.PHONY: all
|
|
|
|
all: xmlrpc-c-config xmlrpc-c-config.test $(SUBDIRS:%=%/all)
|
|
|
|
|
2008-05-23 16:56:24 -04:00
|
|
|
# The examples subdirectory is special, because even the make file in there
|
|
|
|
# is designed to be an example. So it has to be simple and as close as
|
|
|
|
# possible to something a person could use outside of the Xmlrpc-c source
|
|
|
|
# tree. One ramification of that is that it does not specify dependencies
|
|
|
|
# on other parts of the Xmlrpc-c build. That means we must separately
|
|
|
|
# ensure that the Xmlrpc-c libraries are built before making the example
|
|
|
|
# programs.
|
|
|
|
#
|
|
|
|
# It also means that you have to manually clean the examples directory
|
|
|
|
# in order to get the examples rebuilt after you modify the Xmlrpc-c
|
|
|
|
# libraries.
|
|
|
|
|
|
|
|
examples/all: xmlrpc-c-config.test lib/all src/all include/all
|
|
|
|
|
|
|
|
# Parallel make (make --jobs) is not smart enough to coordinate builds
|
|
|
|
# between submakes, so a naive parallel make would cause certain
|
|
|
|
# targets to get built multiple times simultaneously. That is usually
|
|
|
|
# unacceptable. So we introduce extra dependencies here just to make
|
|
|
|
# sure such targets are already up to date before the submake starts,
|
|
|
|
# for the benefit of parallel make. Note that we ensure that parallel
|
|
|
|
# make works for 'make all' in the top directory, but it may still fail
|
|
|
|
# for the aforementioned reason for other invocations.
|
|
|
|
|
|
|
|
tools/all: include/all lib/all src/all
|
|
|
|
src/all lib/all: include/all
|
|
|
|
src/all: lib/all
|
|
|
|
|
|
|
|
MAJOR := $(XMLRPC_MAJOR_RELEASE)
|
|
|
|
MINOR := $(XMLRPC_MINOR_RELEASE)
|
|
|
|
POINT := $(XMLRPC_POINT_RELEASE)
|
2012-10-13 12:37:25 -04:00
|
|
|
version.h: $(SRCDIR)/version.mk
|
2008-05-23 16:56:24 -04:00
|
|
|
rm -f $@
|
|
|
|
echo "/* Generated by make file rule */" >>$@
|
2012-10-13 12:37:25 -04:00
|
|
|
echo "#define XMLRPC_C_VERSION" \"$(MAJOR).$(MINOR).$(POINT)"\"" >>$@
|
2008-05-23 16:56:24 -04:00
|
|
|
echo "#define XMLRPC_VERSION_MAJOR $(MAJOR)" >>$@
|
|
|
|
echo "#define XMLRPC_VERSION_MINOR $(MINOR)" >>$@
|
|
|
|
echo "#define XMLRPC_VERSION_POINT $(POINT)" >>$@
|
|
|
|
|
2012-10-13 12:37:25 -04:00
|
|
|
include transport_config.mk
|
2008-05-23 16:56:24 -04:00
|
|
|
|
|
|
|
# shell_config is a fragment to place inside a Bourne shell program that
|
|
|
|
# sets variables that tell how the build is configured.
|
|
|
|
|
|
|
|
shell_config: $(BLDDIR)/config.mk
|
|
|
|
rm -f $@
|
|
|
|
@echo "Lots of echoes to '$@' suppressed here ..."
|
|
|
|
@echo '#' >>$@
|
|
|
|
@echo '#######################################################' >>$@
|
|
|
|
@echo "# From '$@'" >>$@
|
|
|
|
@echo '#######################################################' >>$@
|
|
|
|
@echo 'ENABLE_ABYSS_THREADS="$(ENABLE_ABYSS_THREADS)"' >>$@
|
|
|
|
@echo 'ENABLE_LIBXML2_BACKEND="$(ENABLE_LIBXML2_BACKEND)"' >>$@
|
|
|
|
@echo 'MUST_BUILD_WININET_CLIENT="$(MUST_BUILD_WININET_CLIENT)"'>>$@
|
|
|
|
@echo 'MUST_BUILD_CURL_CLIENT="$(MUST_BUILD_CURL_CLIENT)"' >>$@
|
|
|
|
@echo 'MUST_BUILD_LIBWWW_CLIENT="$(MUST_BUILD_LIBWWW_CLIENT)"' >>$@
|
|
|
|
@echo 'NEED_RPATH="$(NEED_RPATH)"' >>$@
|
2012-10-13 12:37:25 -04:00
|
|
|
@echo 'NEED_WL_RPATH="$(NEED_WL_RPATH)"' >>$@
|
|
|
|
@echo 'LIBXMLRPCPP_NAME="$(LIBXMLRPCPP_NAME)"' >>$@
|
2008-05-23 16:56:24 -04:00
|
|
|
@echo 'LSOCKET="$(LSOCKET)"' >>$@
|
|
|
|
@echo 'WININET_LDADD="$(WININET_LDADD)"' >>$@
|
2012-10-13 12:37:25 -04:00
|
|
|
@echo 'WININET_LIBDIR="$(WININET_LIBDIR)"' >>$@
|
2008-05-23 16:56:24 -04:00
|
|
|
@echo 'CURL_LDADD="$(CURL_LDADD)"' >>$@
|
2012-10-13 12:37:25 -04:00
|
|
|
@echo 'CURL_LIBDIR="$(CURL_LIBDIR)"' >>$@
|
2008-05-23 16:56:24 -04:00
|
|
|
@echo 'LIBWWW_LDADD="$(LIBWWW_LDADD)"' >>$@
|
2012-10-13 12:37:25 -04:00
|
|
|
@echo 'LIBWWW_LIBDIR="$(LIBWWW_LIBDIR)"' >>$@
|
2008-05-23 16:56:24 -04:00
|
|
|
@echo 'XMLRPC_MAJOR_RELEASE="$(XMLRPC_MAJOR_RELEASE)"' >>$@
|
|
|
|
@echo 'XMLRPC_MINOR_RELEASE="$(XMLRPC_MINOR_RELEASE)"' >>$@
|
|
|
|
@echo 'XMLRPC_POINT_RELEASE="$(XMLRPC_POINT_RELEASE)"' >>$@
|
|
|
|
@echo 'FEATURE_LIST="$(FEATURE_LIST)"' >>$@
|
|
|
|
@echo 'PREFIX="$(PREFIX)"' >>$@
|
|
|
|
@echo 'HEADERINST_DIR="$(HEADERINST_DIR)"' >>$@
|
|
|
|
@echo 'LIBINST_DIR="$(LIBINST_DIR)"' >>$@
|
|
|
|
@echo 'BLDDIR="$(BLDDIR)"' >>$@
|
|
|
|
@echo 'ABS_SRCDIR="$(ABS_SRCDIR)"' >>$@
|
|
|
|
@echo '#######################################################' >>$@
|
|
|
|
|
|
|
|
xmlrpc-c-config xmlrpc-c-config.test:%: %.main shell_config
|
2006-12-20 22:57:49 -05:00
|
|
|
rm -f $@
|
2008-05-23 16:56:24 -04:00
|
|
|
@echo "Echoes to '$@' suppressed here ..."
|
|
|
|
@echo '#! /bin/sh' >>$@
|
|
|
|
@echo '#' >>$@
|
|
|
|
@echo '# This file was generated by a make rule' >>$@
|
|
|
|
@echo '#' >>$@
|
|
|
|
cat shell_config >>$@
|
|
|
|
cat $< >>$@
|
|
|
|
chmod a+rx $@
|
2006-12-20 22:57:49 -05:00
|
|
|
|
|
|
|
.PHONY: clean clean-local
|
|
|
|
clean: $(SUBDIRS:%=%/clean) clean-common clean-local
|
|
|
|
|
|
|
|
clean-local:
|
2008-05-23 16:56:24 -04:00
|
|
|
rm -f transport_config.h version.h
|
2006-12-20 22:57:49 -05:00
|
|
|
|
|
|
|
.PHONY: distclean distclean-local
|
|
|
|
distclean: $(SUBDIRS:%=%/distclean) distclean-common distclean-local
|
|
|
|
|
|
|
|
distclean-local: clean-local
|
2012-10-13 12:37:25 -04:00
|
|
|
rm -f config.log config.status config.mk srcdir.mk
|
2008-05-23 16:56:24 -04:00
|
|
|
rm -f xmlrpc_config.h xmlrpc_amconfig.h stamp-h
|
|
|
|
rm -f shell_config xmlrpc-c-config xmlrpc-c-config.test
|
|
|
|
rm -f TAGS
|
2006-12-20 22:57:49 -05:00
|
|
|
|
2008-05-23 16:56:24 -04:00
|
|
|
check: $(SUBDIRS:%=%/check)
|
2006-12-20 22:57:49 -05:00
|
|
|
|
|
|
|
DISTFILES =
|
|
|
|
|
|
|
|
.PHONY: distdir
|
|
|
|
distdir: distdir-common
|
|
|
|
|
|
|
|
.PHONY: install
|
2008-05-23 16:56:24 -04:00
|
|
|
install: $(DEFAULT_SUBDIRS:%=%/install) install-common
|
2006-12-20 22:57:49 -05:00
|
|
|
|
|
|
|
.PHONY: dep
|
2008-05-23 16:56:24 -04:00
|
|
|
dep: version.h $(BLDDIR)/include/xmlrpc-c/config.h $(SUBDIRS:%=%/dep)
|
2006-12-20 22:57:49 -05:00
|
|
|
|
2008-05-23 16:56:24 -04:00
|
|
|
xmlrpc_config.h xmlrpc_amconfig.h \
|
2006-12-20 22:57:49 -05:00
|
|
|
:%:%.in $(SRCDIR)/configure
|
|
|
|
$(SRCDIR)/configure
|
|
|
|
|
2008-05-23 16:56:24 -04:00
|
|
|
# A trick to catch a common user error. When you don't run 'configure',
|
2012-10-13 12:37:25 -04:00
|
|
|
# you don't have a srcdir.mk, which means $(SRCDIR) is null.
|
2008-05-23 16:56:24 -04:00
|
|
|
|
|
|
|
/common.mk:
|
|
|
|
@echo =======================================
|
|
|
|
@echo = You must run Configure before Make. =
|
|
|
|
@echo =======================================
|
|
|
|
false
|
|
|
|
|
|
|
|
# 'tags' generates/updates an Emacs tags file, anmed TAGS, in the current
|
|
|
|
# directory. Use with Emacs command 'find-tag'.
|
|
|
|
|
|
|
|
.PHONY: tags
|
|
|
|
tags:
|
|
|
|
find . -name "*.c" -o -name "*.h" -o -name "*.cpp" -o -name "*.hpp" | \
|
|
|
|
etags -
|