2012-10-13 12:37:25 -04:00
|
|
|
# Since the programs in this directory are examples for the user, this make
|
|
|
|
# file should be as ordinary as possible. It should not rely heavily on
|
|
|
|
# included make files or configuration parameters. Also, we don't try to
|
|
|
|
# build or rebuild the libraries on which these programs depend or even
|
|
|
|
# recognize that they've changed on their own.
|
2006-12-20 22:57:49 -05:00
|
|
|
|
|
|
|
|
2008-05-23 16:56:24 -04:00
|
|
|
ifeq ($(SRCDIR),)
|
2006-12-20 22:57:49 -05:00
|
|
|
SRCDIR = $(CURDIR)/..
|
2008-05-23 16:56:24 -04:00
|
|
|
BLDDIR = $(SRCDIR)
|
2006-12-20 22:57:49 -05:00
|
|
|
endif
|
2008-05-23 16:56:24 -04:00
|
|
|
SUBDIR = examples
|
2006-12-20 22:57:49 -05:00
|
|
|
|
2008-05-23 16:56:24 -04:00
|
|
|
include $(BLDDIR)/config.mk
|
2006-12-20 22:57:49 -05:00
|
|
|
|
2008-05-23 16:56:24 -04:00
|
|
|
default: all
|
2006-12-20 22:57:49 -05:00
|
|
|
|
2012-10-13 12:37:25 -04:00
|
|
|
CFLAGS = $(CFLAGS_PERSONAL) $(CADD)
|
|
|
|
LDFLAGS += $(LADD)
|
2006-12-20 22:57:49 -05:00
|
|
|
|
|
|
|
# If this were a real application, working from an installed copy of
|
|
|
|
# Xmlrpc-c, XMLRPC_C_CONFIG would just be 'xmlrpc-c-config'. It would be
|
|
|
|
# found in the user's PATH.
|
2008-05-23 16:56:24 -04:00
|
|
|
XMLRPC_C_CONFIG = $(BLDDIR)/xmlrpc-c-config.test
|
2006-12-20 22:57:49 -05:00
|
|
|
|
|
|
|
CLIENTPROGS = \
|
|
|
|
auth_client \
|
2012-10-13 12:37:25 -04:00
|
|
|
compound_value_client \
|
2006-12-20 22:57:49 -05:00
|
|
|
synch_client \
|
|
|
|
xmlrpc_sample_add_client \
|
|
|
|
xmlrpc_asynch_client \
|
|
|
|
|
2008-05-23 16:56:24 -04:00
|
|
|
ifeq ($(MUST_BUILD_CURL_CLIENT),yes)
|
|
|
|
CLIENTPROGS += interrupted_client
|
|
|
|
endif
|
|
|
|
|
2006-12-20 22:57:49 -05:00
|
|
|
SERVERPROGS_CGI = \
|
|
|
|
xmlrpc_sample_add_server.cgi
|
|
|
|
|
|
|
|
SERVERPROGS_ABYSS = \
|
2012-10-13 12:37:25 -04:00
|
|
|
compound_value_server \
|
2008-05-23 16:56:24 -04:00
|
|
|
interrupted_server \
|
|
|
|
xmlrpc_inetd_server \
|
|
|
|
xmlrpc_socket_server \
|
2006-12-20 22:57:49 -05:00
|
|
|
xmlrpc_loop_server \
|
|
|
|
xmlrpc_sample_add_server \
|
|
|
|
xmlrpc_server_validatee \
|
|
|
|
|
2012-10-13 12:37:25 -04:00
|
|
|
BASIC_PROGS = \
|
|
|
|
json \
|
|
|
|
gen_sample_add_xml \
|
|
|
|
|
2006-12-20 22:57:49 -05:00
|
|
|
# Build up PROGS:
|
|
|
|
PROGS =
|
|
|
|
|
2012-10-13 12:37:25 -04:00
|
|
|
PROGS += $(BASIC_PROGS)
|
|
|
|
|
2006-12-20 22:57:49 -05:00
|
|
|
ifeq ($(ENABLE_ABYSS_SERVER),yes)
|
|
|
|
PROGS += $(SERVERPROGS_ABYSS)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(MUST_BUILD_CLIENT),yes)
|
|
|
|
PROGS += $(CLIENTPROGS)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(ENABLE_CGI_SERVER),yes)
|
|
|
|
PROGS += $(SERVERPROGS_CGI)
|
|
|
|
endif
|
|
|
|
|
2008-05-23 16:56:24 -04:00
|
|
|
INCLUDES = -I. $(shell $(XMLRPC_C_CONFIG) client abyss-server --cflags)
|
2006-12-20 22:57:49 -05:00
|
|
|
|
2012-10-13 12:37:25 -04:00
|
|
|
LIBS_CLIENT = \
|
|
|
|
$(shell $(XMLRPC_C_CONFIG) client --libs)
|
2006-12-20 22:57:49 -05:00
|
|
|
|
2012-10-13 12:37:25 -04:00
|
|
|
LIBS_SERVER_ABYSS = \
|
|
|
|
$(shell $(XMLRPC_C_CONFIG) abyss-server --libs)
|
2006-12-20 22:57:49 -05:00
|
|
|
|
2012-10-13 12:37:25 -04:00
|
|
|
LIBS_SERVER_CGI = \
|
|
|
|
$(shell $(XMLRPC_C_CONFIG) cgi-server --libs)
|
2006-12-20 22:57:49 -05:00
|
|
|
|
2012-10-13 12:37:25 -04:00
|
|
|
LIBS_BASE = \
|
|
|
|
$(shell $(XMLRPC_C_CONFIG) --libs)
|
2006-12-20 22:57:49 -05:00
|
|
|
|
|
|
|
all: $(PROGS)
|
|
|
|
|
|
|
|
ifeq ($(ENABLE_CPLUSPLUS),yes)
|
|
|
|
all: cpp/all
|
|
|
|
endif
|
|
|
|
|
|
|
|
.PHONY: cpp/all
|
2008-05-23 16:56:24 -04:00
|
|
|
cpp/all: $(BLDDIR)/examples/cpp
|
|
|
|
$(MAKE) -C cpp -f $(SRCDIR)/examples/cpp/Makefile all
|
|
|
|
|
|
|
|
# When building in separate tree, directory won't exist yet
|
|
|
|
$(BLDDIR)/examples/cpp:
|
|
|
|
mkdir $@
|
2006-12-20 22:57:49 -05:00
|
|
|
|
|
|
|
$(CLIENTPROGS):%:%.o
|
2012-10-13 12:37:25 -04:00
|
|
|
$(CCLD) -o $@ $^ $(LIBS_CLIENT) $(LDFLAGS)
|
2006-12-20 22:57:49 -05:00
|
|
|
|
|
|
|
$(SERVERPROGS_CGI):%.cgi:%_cgi.o
|
2012-10-13 12:37:25 -04:00
|
|
|
$(CCLD) -o $@ $^ $(LIBS_SERVER_CGI) $(LDFLAGS)
|
2006-12-20 22:57:49 -05:00
|
|
|
|
|
|
|
$(SERVERPROGS_ABYSS):%:%.o
|
2012-10-13 12:37:25 -04:00
|
|
|
$(CCLD) -o $@ $^ $(LIBS_SERVER_ABYSS) $(LDFLAGS)
|
|
|
|
|
|
|
|
$(BASIC_PROGS):%:%.o
|
|
|
|
$(CCLD) -o $@ $^ $(LIBS_BASE) $(LDFLAGS)
|
2006-12-20 22:57:49 -05:00
|
|
|
|
|
|
|
|
2008-05-23 16:56:24 -04:00
|
|
|
OBJECTS = $(patsubst %,%.o,$(patsubst %.cgi,%_cgi,$(PROGS)))
|
|
|
|
|
|
|
|
$(OBJECTS):%.o:%.c
|
2006-12-20 22:57:49 -05:00
|
|
|
$(CC) -c $(INCLUDES) $(CFLAGS) $<
|
|
|
|
|
2008-05-23 16:56:24 -04:00
|
|
|
# config.h and xmlrpc_amconfig.h just describe the build environment.
|
|
|
|
# We use them so that the example programs will build in users'
|
|
|
|
# various environments. If you're copying these examples, you can
|
|
|
|
# just remove these headers from the programs and hardcode whatever is
|
|
|
|
# right for your build environment.
|
|
|
|
|
|
|
|
$(OBJECTS): config.h xmlrpc_amconfig.h
|
2006-12-20 22:57:49 -05:00
|
|
|
|
|
|
|
config.h:
|
2008-05-23 16:56:24 -04:00
|
|
|
$(LN_S) $(BLDDIR)/xmlrpc_config.h $@
|
2006-12-20 22:57:49 -05:00
|
|
|
xmlrpc_amconfig.h:
|
2008-05-23 16:56:24 -04:00
|
|
|
$(LN_S) $(BLDDIR)/$@ .
|
2006-12-20 22:57:49 -05:00
|
|
|
|
|
|
|
.PHONY: clean
|
2012-10-13 12:37:25 -04:00
|
|
|
clean:
|
|
|
|
rm -f $(PROGS) *.o config.h xmlrpc_amconfig.h
|
2006-12-20 22:57:49 -05:00
|
|
|
$(MAKE) -C cpp clean
|
|
|
|
|
|
|
|
.PHONY: distclean
|
|
|
|
distclean: clean
|
|
|
|
|
|
|
|
BINDIR=$(DESTDIR)$(bindir)
|
|
|
|
|
|
|
|
FILENAME_GENERATOR = "echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'"
|
|
|
|
|
|
|
|
INSTCMD = "$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p \
|
|
|
|
$(BINDIR)/`$(FILENAME_GENERATOR)`"
|
|
|
|
|
|
|
|
.PHONY: install
|
|
|
|
install: $(PROGS)
|
|
|
|
@$(NORMAL_INSTALL)
|
|
|
|
$(MKINSTALLDIRS) $(BINDIR)
|
|
|
|
@list='$(bin_PROGRAMS)'; for p in $$list; do \
|
|
|
|
if test -f $$p; then \
|
|
|
|
echo "$(INSTCMD)"; $(INSTCMD); \
|
|
|
|
else :; \
|
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
|
|
|
|
.PHONY: check
|
|
|
|
check:
|
|
|
|
|
|
|
|
.PHONY: dep depend
|
|
|
|
dep depend:
|
|
|
|
# We don't do dependencies in this directory, because it's supposed to be
|
|
|
|
# an example of what a program outside this package would do, so we can't
|
|
|
|
# go weaving it into the rest of the package. Ergo, a developer must
|
|
|
|
# carefully clean and remake examples as he updates other parts of the tree.
|