initial load of upstream version 1.06.32
[xmlrpc-c] / tools / xmlrpc / Makefile
1 ifeq ($(SRCDIR)x,x)
2 SRCDIR = $(CURDIR)/../..
3 endif
4 # BLDDIR is for use in places where a symbolic link won't work.
5 # BUILDDIR is for places in Makefile.common that can use the 'blddir'
6 # symbolic link (but in other directories, doesn't).
7 BLDDIR = $(SRCDIR)
8 BUILDDIR = blddir
9
10 default: all
11
12 include $(BLDDIR)/Makefile.config
13
14 PROGRAMS_TO_INSTALL = xmlrpc
15
16 include ../Makefile.common
17
18 INCLUDES = -I$(SRCDIR) -I$(SRCDIR)/include -I$(SRCDIR)/lib/util/include
19
20 CFLAGS = $(CFLAGS_COMMON) $(INCLUDES) $(CFLAGS_PERSONAL) $(CADD)
21
22 LDFLAGS = $(LADD)
23
24 all: xmlrpc
25
26 UTIL_OBJS = cmdline_parser.o getoptx.o casprintf.o
27 UTILS = $(UTIL_OBJS:%=$(UTIL_DIR)/%)
28
29 # These are the Libtool .la files.  We use them only for make dependencies.
30 # We'd like to use these in the link rule, by using libtool --link, but
31 # Libtool adds -l options to the link to cover the dependencies that are
32 # recorded inside the shared libraries.  And it doesn't add the necessary
33 # -L options (it can't), so we end up with a messy mixture of the two
34 # forms of specifying libraries.
35
36 LIBS = $(LIBXMLRPC_CLIENT) $(LIBXMLRPC) $(LIBXMLRPC_XML) $(LIBXMLRPC_UTIL)
37
38 XMLRPC_OBJS = xmlrpc.o dumpvalue.o
39
40 xmlrpc: $(XMLRPC_OBJS) $(LIBS) $(UTILS)
41         $(CCLD) -o $@ $(LDFLAGS) $(XMLRPC_OBJS) $(UTILS) $(CLIENT_LDLIBS)
42
43 %.o:%.c
44         $(CC) -c $(CFLAGS) $<
45
46 *.c: config.h
47
48 config.h:
49         $(LN_S) $(BLDDIR)/xmlrpc_config.h $@
50
51 # This Makefile.config dependency makes sure the symlinks get built before
52 # this make file is used for anything.
53
54 $(BLDDIR)/Makefile.config: blddir srcdir
55
56 include Makefile.depend
57
58 .PHONY: dep
59 dep: dep-common
60
61 .PHONY: clean
62 clean: clean-common
63         rm -f xmlrpc config.h
64
65 .PHONY: distclean
66 distclean: clean distclean-common