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 20ifeq ($(SRCDIR),) 21 updir = $(shell echo $(dir $(1)) | sed 's/.$$//') 22 LIBDIR := $(call updir,$(CURDIR)) 23 SRCDIR := $(call updir,$(LIBDIR)) 24 BLDDIR := $(SRCDIR) 25endif 26SUBDIR := lib/util 27 28default: all 29 30include $(BLDDIR)/config.mk 31 32OMIT_UTILS_RULE = Y 33 34include $(SRCDIR)/common.mk 35 36# This 'common.mk' dependency makes sure the symlinks get built before 37# this make file is used for anything. 38 39$(SRCDIR)/common.mk: srcdir blddir 40 41LIBOBJS = \ 42 casprintf.o \ 43 cmdline_parser.o \ 44 cmdline_parser_cpp.o \ 45 getoptx.o \ 46 string_parser.o \ 47 stripcaseeq.o \ 48 49.PHONY: all 50all: $(LIBOBJS) 51 52INCLUDES = -Isrcdir/$(SUBDIR)/include -I$(BLDDIR) 53 54%.o:%.c 55 $(CC) -c $(CFLAGS_ALL) $< 56 57%.o:%.cpp 58 $(CXX) -c $(CXXFLAGS_ALL) $< 59 60include depend.mk 61 62.PHONY: clean distclean 63clean: clean-common 64 65distclean: clean distclean-common 66 67.PHONY: dep 68dep: dep-common 69 70install: