initial load of upstream version 1.06.32
[xmlrpc-c] / tools / xmlrpc_transport / 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_transport
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_transport
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_transport:%:%.o $(LIBS) $(UTILS)
39         $(CCLD) -o $@ $(LDFLAGS) $< $(CLIENT_LDLIBS) $(UTILS)
40
41 %.o:%.c
42         $(CC) -c $(CFLAGS) $<
43
44 *.c: config.h
45
46 config.h:
47         $(LN_S) $(BLDDIR)/xmlrpc_config.h $@
48
49 # This Makefile.config dependency makes sure the symlinks get built before
50 # this make file is used for anything.
51
52 $(BLDDIR)/Makefile.config: blddir srcdir
53
54 include Makefile.depend
55
56 .PHONY: dep
57 dep: dep-common
58
59 .PHONY: clean
60 clean: clean-common
61         rm -f xmlrpc_transport config.h
62
63 .PHONY: distclean
64 distclean: clean distclean-common