michael@0: ## -*-makefile-*- michael@0: ## Cygwin-specific setup michael@0: ## Copyright (c) 2001-2010, International Business Machines Corporation and michael@0: ## others. All Rights Reserved. michael@0: michael@0: ## Commands to generate dependency files michael@0: GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS) michael@0: GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS) michael@0: michael@0: ## Flags to create/use a static library michael@0: ifneq ($(ENABLE_SHARED),YES) michael@0: ## Make sure that the static libraries can be built and used michael@0: CPPFLAGS += -DU_STATIC_IMPLEMENTATION michael@0: else michael@0: ## Make sure that the static libraries can be built michael@0: STATICCPPFLAGS = -DU_STATIC_IMPLEMENTATION michael@0: endif michael@0: michael@0: ## Flags for position independent code michael@0: SHAREDLIBCFLAGS = michael@0: SHAREDLIBCXXFLAGS = michael@0: SHAREDLIBCPPFLAGS = -DPIC michael@0: michael@0: ## Additional flags when building libraries and with threads michael@0: THREADSCPPFLAGS = -D_REENTRANT michael@0: LIBCPPFLAGS = michael@0: michael@0: # Commands to link. Link with C++ in case static libraries are used. michael@0: LINK.c= $(CXX) $(CXXFLAGS) $(LDFLAGS) michael@0: #LINK.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) michael@0: michael@0: ## Shared library options michael@0: LD_SOOPTIONS= -Wl,-Bsymbolic michael@0: michael@0: ## Commands to make a shared library michael@0: # $(subst) won't work in shell script. #M# at the end omits these michael@0: # lines from the shell script (Make only) michael@0: SHLIB.c= $(CC) $(CFLAGS) $(LDFLAGS) -shared $(LD_SOOPTIONS) -Wl,--enable-auto-import -Wl,--out-implib=$(subst cyg,lib,$@).$(A)#M# michael@0: SHLIB.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(LD_SOOPTIONS) -Wl,--enable-auto-import -Wl,--out-implib=$(subst cyg,lib,$@).$(A)#M# michael@0: # the #SH# lines don't go through further postprocessing. michael@0: # so, they must be valid shell script starting from column 4 michael@0: #SH#SHLIB_c="$(CC) $(CFLAGS) $(LDFLAGS) -shared " michael@0: #SH#SHLIB_cc="$(CXX) $(CXXFLAGS) $(LDFLAGS) -shared " michael@0: michael@0: michael@0: ## Compiler switch to embed a runtime search path michael@0: LD_RPATH= michael@0: LD_RPATH_PRE= -Wl,-rpath, michael@0: michael@0: ## Compiler switch to embed a library name michael@0: LD_SONAME = michael@0: michael@0: ## Shared object suffix michael@0: SO = dll michael@0: ## Non-shared intermediate object suffix michael@0: STATIC_O = ao michael@0: LIBICU = cyg$(ICUPREFIX) michael@0: ## To have an import library is better on Cygwin michael@0: IMPORT_LIB_EXT = .dll.a michael@0: michael@0: ## Compilation rules michael@0: %.$(STATIC_O): $(srcdir)/%.c michael@0: $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $< michael@0: %.o: $(srcdir)/%.c michael@0: $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $< michael@0: michael@0: %.$(STATIC_O): $(srcdir)/%.cpp michael@0: $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $< michael@0: %.o: $(srcdir)/%.cpp michael@0: $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $< michael@0: michael@0: michael@0: ## Dependency rules michael@0: %.d: $(srcdir)/%.c michael@0: @echo "generating dependency information for $<" michael@0: @echo -n "$@ " > $@ michael@0: @$(GEN_DEPS.c) $< >> $@ || (rm -f $@ && FALSE) michael@0: michael@0: %.d: $(srcdir)/%.cpp michael@0: @echo "generating dependency information for $<" michael@0: @echo -n "$@ " > $@ michael@0: @$(GEN_DEPS.cc) $< >> $@ || (rm -f $@ && FALSE) michael@0: michael@0: ## Versioned target for a shared library. michael@0: ## Since symbolic links don't work the same way on Windows, michael@0: ## we only use the version major number. michael@0: #FINAL_SO_TARGET=$(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO) michael@0: FINAL_SO_TARGET=$(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO) michael@0: MIDDLE_SO_TARGET=$(FINAL_SO_TARGET) michael@0: michael@0: IMPORT_LIB = $(subst cyg,lib,$(FINAL_SO_TARGET)).$(A)#M# michael@0: MIDDLE_IMPORT_LIB = $(subst cyg,lib,$(basename $(SO_TARGET)))$(SO_TARGET_VERSION_MAJOR).$(SO).$(A)#M# michael@0: FINAL_IMPORT_LIB = $(IMPORT_LIB)#M# michael@0: michael@0: # The following is for Makefile.inc's use. michael@0: ICULIBSUFFIX_VERSION = $(LIB_VERSION_MAJOR) michael@0: michael@0: ## Versioned libraries rules michael@0: #%$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO) michael@0: # $(RM) $@ && cp ${