Makefile 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. ###############################################################################
  2. # This directory builds object modules that provide utility functions that
  3. # programs can use. Not libraries, though -- just programs. The reason
  4. # we don't want any library to use object modules in here is that they'll
  5. # probably pollute the name space when users link those libraries to their
  6. # programs. In fact, if more than one Xmlrpc-c library includes one of these
  7. # modules, the libraries will conflict with each other.
  8. #
  9. # So a utility function that is to be used by libraries (and, optionally,
  10. # programs) should go in libxmlrpc_util. libxmlrpc_util is a prerequisite
  11. # for many Xmlrpc-c libraries, gets included in a program link only once,
  12. # and uses external symbol names that have the "xmlrpc_" prefix to avoid
  13. # collision with users' code.
  14. #
  15. # If we knew a portable way to link multiple object modules into one and
  16. # restrict the symbols exported by the whole, we could avoid this mess and
  17. # just link utility object modules into each Xmlrpc-c library.
  18. ##############################################################################
  19. ifeq ($(SRCDIR),)
  20. updir = $(shell echo $(dir $(1)) | sed 's/.$$//')
  21. LIBDIR := $(call updir,$(CURDIR))
  22. SRCDIR := $(call updir,$(LIBDIR))
  23. BLDDIR := $(SRCDIR)
  24. endif
  25. SUBDIR := lib/util
  26. default: all
  27. include $(BLDDIR)/config.mk
  28. OMIT_UTILS_RULE = Y
  29. include $(SRCDIR)/common.mk
  30. # This 'common.mk' dependency makes sure the symlinks get built before
  31. # this make file is used for anything.
  32. $(SRCDIR)/common.mk: srcdir blddir
  33. LIBOBJS = \
  34. casprintf.o \
  35. cmdline_parser.o \
  36. cmdline_parser_cpp.o \
  37. getoptx.o \
  38. string_parser.o \
  39. stripcaseeq.o \
  40. .PHONY: all
  41. all: $(LIBOBJS)
  42. INCLUDES = -Isrcdir/$(SUBDIR)/include -I$(BLDDIR)
  43. %.o:%.c
  44. $(CC) -c $(CFLAGS_ALL) $<
  45. %.o:%.cpp
  46. $(CXX) -c $(CXXFLAGS_ALL) $<
  47. include depend.mk
  48. .PHONY: clean distclean
  49. clean: clean-common
  50. distclean: clean distclean-common
  51. .PHONY: dep
  52. dep: dep-common
  53. install: