1 #****************************************************************************** 2 # 3 # Copyright (C) 1999-2009, International Business Machines 4 # Corporation and others. All Rights Reserved. 5 # 6 #****************************************************************************** 7 ## Makefile.in for ICU - tools/toolutil 8 ## Steven R. Loomis 9 10 ## Source directory information 11 srcdir = @srcdir@ 12 top_srcdir = @top_srcdir@ 13 14 top_builddir = ../.. 15 16 ## All the flags and other definitions are included here. 17 include $(top_builddir)/icudefs.mk 18 19 ## Build directory information 20 subdir = tools/toolutil 21 22 ## Extra files to remove for 'make clean' 23 CLEANFILES = *~ $(DEPS) $(IMPORT_LIB) $(MIDDLE_IMPORT_LIB) $(FINAL_IMPORT_LIB) 24 25 ## Target information 26 27 TARGET_STUBNAME=$(TOOLUTIL_STUBNAME) 28 29 ifneq ($(ENABLE_STATIC),) 30 TARGET = $(LIBDIR)/$(LIBSICU)$(TARGET_STUBNAME)$(ICULIBSUFFIX).$(A) 31 endif 32 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) 36 endif 37 38 ALL_TARGETS = $(TARGET) $(ALL_SO_TARGETS) 39 40 DYNAMICCPPFLAGS = $(SHAREDLIBCPPFLAGS) 41 DYNAMICCFLAGS = $(SHAREDLIBCFLAGS) 42 DYNAMICCXXFLAGS = $(SHAREDLIBCXXFLAGS) 43 CFLAGS += $(LIBCFLAGS) 44 CXXFLAGS += $(LIBCXXFLAGS) 45 46 ifneq ($(top_builddir),$(top_srcdir)) 47 CPPFLAGS += -I$(top_builddir)/common 48 endif 49 CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n $(LIBCPPFLAGS) 50 DEFS += -DU_TOOLUTIL_IMPLEMENTATION 51 LDFLAGS += $(LDFLAGSICUTOOLUTIL) 52 LIBS = $(LIBICUI18N) $(LIBICUUC) $(DEFAULT_LIBS) 53 54 OBJECTS = filestrm.o package.o pkgitems.o swapimpl.o toolutil.o unewdata.o \ 55 ucm.o ucmstate.o uoptions.o uparse.o \ 56 ucbuf.o xmlparser.o writesrc.o \ 57 pkg_icu.o pkg_genc.o pkg_gencmn.o flagparser.o filetools.o 58 59 STATIC_OBJECTS = $(OBJECTS:.o=.$(STATIC_O)) 60 61 DEPS = $(OBJECTS:.o=.d) 62 63 -include Makefile.local 64 65 ## List of phony targets 66 .PHONY : all all-local install install-local clean clean-local \ 67 distclean distclean-local install-library dist \ 68 dist-local check check-local 69 70 ## Clear suffix list 71 .SUFFIXES : 72 73 ## List of standard targets 74 all: all-local 75 install: install-local 76 clean: clean-local 77 distclean : distclean-local 78 dist: dist-local 79 check: all check-local 80 81 all-local: $(ALL_TARGETS) 82 83 install-local: install-library 84 85 install-library: all-local 86 $(MKINSTALLDIRS) $(DESTDIR)$(libdir) 87 ifneq ($(ENABLE_STATIC),) 88 $(INSTALL-L) $(TARGET) $(DESTDIR)$(libdir) 89 endif 90 ifneq ($(ENABLE_SHARED),) 91 $(INSTALL-L) $(FINAL_SO_TARGET) $(DESTDIR)$(libdir) 92 ifneq ($(FINAL_SO_TARGET),$(SO_TARGET)) 93 cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(SO_TARGET)) && ln -s $(notdir $(FINAL_SO_TARGET)) $(notdir $(SO_TARGET)) 94 ifneq ($(FINAL_SO_TARGET),$(MIDDLE_SO_TARGET)) 95 cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(MIDDLE_SO_TARGET)) && ln -s $(notdir $(FINAL_SO_TARGET)) $(notdir $(MIDDLE_SO_TARGET)) 96 endif 97 endif 98 ifneq ($(IMPORT_LIB_EXT),) 99 $(INSTALL-L) $(FINAL_IMPORT_LIB) $(DESTDIR)$(libdir) 100 ifneq ($(IMPORT_LIB),$(FINAL_IMPORT_LIB)) 101 cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(IMPORT_LIB)) && ln -s $(notdir $(FINAL_IMPORT_LIB)) $(notdir $(IMPORT_LIB)) 102 endif 103 ifneq ($(MIDDLE_IMPORT_LIB),$(FINAL_IMPORT_LIB)) 104 cd $(DESTDIR)$(libdir) && $(RM) $(notdir $(MIDDLE_IMPORT_LIB)) && ln -s $(notdir $(FINAL_IMPORT_LIB)) $(notdir $(MIDDLE_IMPORT_LIB)) 105 endif 106 endif 107 endif 108 109 dist-local: 110 111 clean-local: 112 test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES) 113 $(RMV) $(OBJECTS) $(STATIC_OBJECTS) $(ALL_TARGETS) 114 115 distclean-local: clean-local 116 $(RMV) Makefile 117 118 check-local: all-local 119 120 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 121 cd $(top_builddir) \ 122 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status 123 124 ifneq ($(ENABLE_STATIC),) 125 $(TARGET): $(STATIC_OBJECTS) 126 $(AR) $(ARFLAGS) $(AR_OUTOPT)$@ $^ 127 $(RANLIB) $@ 128 endif 129 130 ifneq ($(ENABLE_SHARED),) 131 $(SHARED_OBJECT): $(OBJECTS) 132 $(SHLIB.cc) $(LD_SONAME) $(OUTOPT)$@ $^ $(LIBS) 133 endif 134 135 ifeq (,$(MAKECMDGOALS)) 136 -include $(DEPS) 137 else 138 ifneq ($(patsubst %clean,,$(MAKECMDGOALS)),) 139 -include $(DEPS) 140 endif 141 endif 142 143