Makefile 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. ifeq ($(SRCDIR),)
  2. updir = $(shell echo $(dir $(1)) | sed 's/.$$//')
  3. TOOLSDIR := $(call updir,$(CURDIR))
  4. SRCDIR := $(call updir,$(TOOLSDIR))
  5. BLDDIR := $(SRCDIR)
  6. endif
  7. SUBDIR := tools/xmlrpc
  8. default: all
  9. include $(BLDDIR)/config.mk
  10. PROGRAMS_TO_INSTALL = xmlrpc
  11. include $(SRCDIR)/tools/common.mk
  12. INCLUDES = \
  13. -I../lib/include \
  14. -Iblddir \
  15. -Iblddir/include \
  16. -Isrcdir/include \
  17. -Isrcdir/lib/util/include
  18. LDFLAGS = $(LADD)
  19. all: xmlrpc
  20. UTIL_OBJS = \
  21. casprintf.o \
  22. cmdline_parser.o \
  23. getoptx.o \
  24. stripcaseeq.o \
  25. string_parser.o \
  26. UTILS = $(UTIL_OBJS:%=$(UTIL_DIR)/%)
  27. DUMPVALUE = blddir/tools/lib/dumpvalue.o
  28. # Can we just use $(LIBS) in the link?
  29. LIBS = $(LIBXMLRPC_CLIENT) $(LIBXMLRPC) $(LIBXMLRPC_XML) $(LIBXMLRPC_UTIL)
  30. XMLRPC_OBJS = xmlrpc.o $(DUMPVALUE)
  31. xmlrpc: $(XMLRPC_OBJS) $(LIBS) $(UTILS)
  32. $(CCLD) -o $@ $(LDFLAGS) $(XMLRPC_OBJS) $(UTILS) $(CLIENT_LDLIBS)
  33. %.o:%.c $(BLDDIR)/include/xmlrpc-c/config.h
  34. $(CC) -c $(CFLAGS_ALL) $<
  35. # This common.mk dependency makes sure the symlinks get built before
  36. # this make file is used for anything.
  37. $(SRCDIR)/tools/common.mk: srcdir blddir
  38. include depend.mk
  39. .PHONY: dep
  40. dep: dep-common
  41. .PHONY: clean
  42. clean: clean-common
  43. rm -f xmlrpc
  44. .PHONY: distclean
  45. distclean: clean distclean-common