1 ## -*-makefile-*- 2 ## Cygwin-specific setup 3 ## Copyright (c) 2001-2008, International Business Machines Corporation and 4 ## others. All Rights Reserved. 5 6 ## Commands to generate dependency files 7 GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS) 8 GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS) 9 10 ## Flags to create/use a static library 11 ifneq ($(ENABLE_SHARED),YES) 12 ## Make sure that the static libraries can be built and used 13 CPPFLAGS += -DU_STATIC_IMPLEMENTATION 14 else 15 ## Make sure that the static libraries can be built 16 STATICCPPFLAGS = -DU_STATIC_IMPLEMENTATION 17 endif 18 19 ## Flags for position independent code 20 SHAREDLIBCFLAGS = 21 SHAREDLIBCXXFLAGS = 22 SHAREDLIBCPPFLAGS = -DPIC 23 24 ## Additional flags when building libraries and with threads 25 THREADSCPPFLAGS = -D_REENTRANT 26 LIBCPPFLAGS = 27 28 # Commands to link. Link with C++ in case static libraries are used. 29 LINK.c= $(CXX) $(CXXFLAGS) $(LDFLAGS) 30 #LINK.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) 31 32 ## Commands to make a shared library 33 # $(subst) won't work in shell script. #M# at the end omits these 34 # lines from the shell script (Make only) 35 SHLIB.c= $(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,--enable-auto-import -Wl,--out-implib=$(subst cyg,lib,$@).$(A)#M# 36 SHLIB.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -Wl,--enable-auto-import -Wl,--out-implib=$(subst cyg,lib,$@).$(A)#M# 37 # the #SH# lines don't go through further postprocessing. 38 # so, they must be valid shell script starting from column 4 39 #SH#SHLIB_c="$(CC) $(CFLAGS) $(LDFLAGS) -shared " 40 #SH#SHLIB_cc="$(CXX) $(CXXFLAGS) $(LDFLAGS) -shared " 41 42 43 ## Compiler switch to embed a runtime search path 44 LD_RPATH= 45 LD_RPATH_PRE= -Wl,-rpath, 46 47 ## Compiler switch to embed a library name 48 LD_SONAME = 49 50 ## Shared object suffix 51 SO = dll 52 ## Non-shared intermediate object suffix 53 STATIC_O = ao 54 LIBICU = cyg$(ICUPREFIX) 55 ## To have an import library is better on Cygwin 56 IMPORT_LIB_EXT = .dll.a 57 58 # Change the stubnames so that poorly working FAT disks and installation programs can work. 59 # This is also for backwards compatibility. 60 DATA_STUBNAME = dt 61 I18N_STUBNAME = in 62 63 ## Compilation rules 64 %.$(STATIC_O): $(srcdir)/%.c 65 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $< 66 %.o: $(srcdir)/%.c 67 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $< 68 69 %.$(STATIC_O): $(srcdir)/%.cpp 70 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $< 71 %.o: $(srcdir)/%.cpp 72 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $< 73 74 75 ## Dependency rules 76 %.d: $(srcdir)/%.c 77 @echo "generating dependency information for $<" 78 @echo -n "$@ " > $@ 79 @$(GEN_DEPS.c) $< >> $@ || (rm -f $@ && FALSE) 80 81 %.d: $(srcdir)/%.cpp 82 @echo "generating dependency information for $<" 83 @echo -n "$@ " > $@ 84 @$(GEN_DEPS.cc) $< >> $@ || (rm -f $@ && FALSE) 85 86 ## Versioned target for a shared library. 87 ## Since symbolic links don't work the same way on Windows, 88 ## we only use the version major number. 89 #FINAL_SO_TARGET=$(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO) 90 FINAL_SO_TARGET=$(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO) 91 MIDDLE_SO_TARGET=$(FINAL_SO_TARGET) 92 93 IMPORT_LIB = $(subst cyg,lib,$(FINAL_SO_TARGET)).$(A)#M# 94 MIDDLE_IMPORT_LIB = $(subst cyg,lib,$(basename $(SO_TARGET)))$(SO_TARGET_VERSION_MAJOR).$(SO).$(A)#M# 95 FINAL_IMPORT_LIB = $(IMPORT_LIB)#M# 96 97 # The following is for Makefile.inc's use. 98 ICULIBSUFFIX_VERSION = $(LIB_VERSION_MAJOR) 99 100 ## Versioned libraries rules 101 #%$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO) 102 # $(RM) $@ && cp ${<F} $@ 103 %.$(SO): %$(SO_TARGET_VERSION_MAJOR).$(SO) 104 $(RM) $(subst cyg,lib,$@).$(A) && ln -s $(subst cyg,lib,${<F}).$(A) $(subst cyg,lib,$@).$(A) 105 106 ## Install libraries as executable 107 INSTALL-L=$(INSTALL_PROGRAM) 108 109 ## Bind internal references 110 111 # LDflags that pkgdata will use 112 BIR_LDFLAGS= -Wl,-Bsymbolic 113 114 # Dependencies [i.e. map files] for the final library 115 BIR_DEPS= 116 117 # Environment variable to set a runtime search path 118 LDLIBRARYPATH_ENVVAR = PATH 119 120 # The type of assembly to write for generating an object file 121 GENCCODE_ASSEMBLY=-a gcc-cygwin 122 123 # put this here again so it gets cyguc... 124 125 #SH#ICULIBS_COMMON_LIB_NAME="${LIBICU}uc${ICULIBSUFFIX}${ICULIBSUFFIX_VERSION}.${SO}" 126 127 # for icu-config 128 129 #SH### copied from Makefile.inc 130 #SH#ICULIBS_COMMON="-l${LIBICU}uc${ICULIBSUFFIX}${ICULIBSUFFIX_VERSION}" 131 #SH#ICULIBS_DATA="-l${LIBICU}${DATA_STUBNAME}${ICULIBSUFFIX}${ICULIBSUFFIX_VERSION}" 132 #SH#ICULIBS_I18N="-l${LIBICU}${I18N_STUBNAME}${ICULIBSUFFIX}${ICULIBSUFFIX_VERSION}" 133 #SH#ICULIBS_TOOLUTIL="-l${LIBICU}tu${ICULIBSUFFIX}${ICULIBSUFFIX_VERSION}" 134 #SH#ICULIBS_CTESTFW="-l${LIBICU}ctestfw${ICULIBSUFFIX}${ICULIBSUFFIX_VERSION}" 135 #SH#ICULIBS_ICUIO="-l${LIBICU}io${ICULIBSUFFIX}${ICULIBSUFFIX_VERSION}" 136 #SH#ICULIBS_OBSOLETE="-l${LIBICU}obsolete${ICULIBSUFFIX}${ICULIBSUFFIX_VERSION}" 137 #SH#ICULIBS_LAYOUT="-l${LIBICU}le${ICULIBSUFFIX}${ICULIBSUFFIX_VERSION}" 138 #SH#ICULIBS_LAYOUTEX="-l${LIBICU}lx${ICULIBSUFFIX}${ICULIBSUFFIX_VERSION}" 139 #SH#ICULIBS_BASE="${LIBS} -L${libdir}" 140 #SH#ICULIBS="${ICULIBS_BASE} ${ICULIBS_I18N} ${ICULIBS_COMMON} ${ICULIBS_DATA}" 141 142 ## End Cygwin-specific setup 143 144