1 #******************************************************************************
3 # Copyright (C) 1999-2014, International Business Machines
4 # Corporation and others. All Rights Reserved.
6 #******************************************************************************
7 ## Makefile.in for ICU - tools/toolutil
10 ## Source directory information
12 top_srcdir = @top_srcdir@
16 ## All the flags and other definitions are included here.
17 include $(top_builddir)/icudefs.mk
19 ## Build directory information
20 subdir = tools/toolutil
22 ## Extra files to remove for 'make clean'
23 CLEANFILES = *~ $(DEPS) $(IMPORT_LIB) $(MIDDLE_IMPORT_LIB) $(FINAL_IMPORT_LIB)
27 TARGET_STUBNAME=$(TOOLUTIL_STUBNAME)
29 ifneq ($(ENABLE_STATIC),)
30 TARGET = $(LIBDIR)/$(LIBSICU)$(TARGET_STUBNAME)$(ICULIBSUFFIX).$(A)
33 ifneq ($(ENABLE_SHARED),)
34 SO_TARGET = $(LIBDIR)/$(LIBICU)$(TARGET_STUBNAME)$(ICULIBSUFFIX).$(SO)
35 ALL_SO_TARGETS = $(SO_TARGET) $(MIDDLE_SO_TARGET) $(FINAL_SO_TARGET) $(SHARED_OBJECT)
38 ALL_TARGETS = $(TARGET) $(ALL_SO_TARGETS)
40 DYNAMICCPPFLAGS = $(SHAREDLIBCPPFLAGS)
41 DYNAMICCFLAGS = $(SHAREDLIBCFLAGS)
42 DYNAMICCXXFLAGS = $(SHAREDLIBCXXFLAGS)
43 CFLAGS += $(LIBCFLAGS)
44 CXXFLAGS += $(LIBCXXFLAGS)
46 CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n $(LIBCPPFLAGS)
49 CPPFLAGS+= "-DU_BUILD=\"@build@\"" "-DU_HOST=\"@host@\"" "-DU_CC=\"@CC@\"" "-DU_CXX=\"@CXX@\""
50 CPPFLAGS += -DUNISTR_FROM_CHAR_EXPLICIT=explicit -DUNISTR_FROM_STRING_EXPLICIT=explicit
52 DEFS += -DU_TOOLUTIL_IMPLEMENTATION
53 LDFLAGS += $(LDFLAGSICUTOOLUTIL)
54 LIBS = $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS)
56 OBJECTS = filestrm.o package.o pkgitems.o swapimpl.o toolutil.o unewdata.o \
57 collationinfo.o denseranges.o \
58 ucm.o ucmstate.o uoptions.o uparse.o \
59 ucbuf.o xmlparser.o writesrc.o \
60 pkg_icu.o pkg_genc.o pkg_gencmn.o ppucd.o flagparser.o filetools.o \
61 udbgutil.o dbgutil.o ucln_tu.o
63 STATIC_OBJECTS = $(OBJECTS:.o=.$(STATIC_O))
65 DEPS = $(OBJECTS:.o=.d)
67 -include Makefile.local
69 ## List of phony targets
70 .PHONY : all all-local install install-local clean clean-local \
71 distclean distclean-local install-library dist \
72 dist-local check check-local
77 ## List of standard targets
79 install: install-local
81 distclean : distclean-local
83 check: all check-local
85 all-local: $(ALL_TARGETS)
87 install-local: install-library
89 install-library: all-local
90 $(MKINSTALLDIRS) $(DESTDIR)$(libdir)
91 ifneq ($(ENABLE_STATIC),)
92 $(INSTALL-L) $(TARGET) $(DESTDIR)$(libdir)
94 ifneq ($(ENABLE_SHARED),)
95 $(INSTALL-L) $(FINAL_SO_TARGET) $(DESTDIR)$(libdir)
96 ifneq ($(FINAL_SO_TARGET),$(SO_TARGET))
97 cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(SO_TARGET)) && ln -s $(notdir $(FINAL_SO_TARGET)) $(notdir $(SO_TARGET))
98 ifneq ($(FINAL_SO_TARGET),$(MIDDLE_SO_TARGET))
99 cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(MIDDLE_SO_TARGET)) && ln -s $(notdir $(FINAL_SO_TARGET)) $(notdir $(MIDDLE_SO_TARGET))
102 ifneq ($(IMPORT_LIB_EXT),)
103 $(INSTALL-L) $(FINAL_IMPORT_LIB) $(DESTDIR)$(libdir)
104 ifneq ($(IMPORT_LIB),$(FINAL_IMPORT_LIB))
105 cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(IMPORT_LIB)) && ln -s $(notdir $(FINAL_IMPORT_LIB)) $(notdir $(IMPORT_LIB))
107 ifneq ($(MIDDLE_IMPORT_LIB),$(FINAL_IMPORT_LIB))
108 cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(MIDDLE_IMPORT_LIB)) && ln -s $(notdir $(FINAL_IMPORT_LIB)) $(notdir $(MIDDLE_IMPORT_LIB))
116 test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES)
117 $(RMV) $(OBJECTS) $(STATIC_OBJECTS) $(ALL_TARGETS)
119 distclean-local: clean-local
122 check-local: all-local
124 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
126 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
128 ifneq ($(ENABLE_STATIC),)
129 $(TARGET): $(STATIC_OBJECTS)
130 $(AR) $(ARFLAGS) $(AR_OUTOPT)$@ $^
134 ifneq ($(ENABLE_SHARED),)
135 $(SHARED_OBJECT): $(OBJECTS)
136 $(SHLIB.cc) $(LD_SONAME) $(OUTOPT)$@ $^ $(LIBS)
137 ifeq ($(ENABLE_RPATH),YES)
138 ifneq ($(wildcard $(libdir)/$(MIDDLE_SO_TARGET)),)
139 $(warning RPATH warning: --enable-rpath means test programs may use existing $(libdir)/$(MIDDLE_SO_TARGET))
144 ifeq (,$(MAKECMDGOALS))
147 ifneq ($(patsubst %clean,,$(MAKECMDGOALS)),)