]> git.saurik.com Git - apple/icu.git/blame_incremental - icuSources/config/mh-cygwin-msvc
ICU-6.2.4.tar.gz
[apple/icu.git] / icuSources / config / mh-cygwin-msvc
... / ...
CommitLineData
1## Cygwin-specific setup
2## Copyright (c) 2001-2004, International Business Machines Corporation and
3## others. All Rights Reserved.
4
5# We install sbin tools into the same bin directory because
6# pkgdata needs some of the tools in sbin, and we can't always depend on
7# icu-config working on Windows.
8sbindir=$(bindir)
9
10## Commands to generate dependency files
11GEN_DEPS.c= :
12GEN_DEPS.cc= :
13#GEN_DEPS.c= $(COMPILE.c) /E
14#GEN_DEPS.cc= $(COMPILE.cc) /E
15
16## Flags to create/use a static library
17ifneq ($(ENABLE_SHARED),YES)
18## Make sure that the static libraries can be built and used
19CPPFLAGS += -DU_STATIC_IMPLEMENTATION
20else
21## Make sure that the static libraries can be built
22STATICCPPFLAGS = -DU_STATIC_IMPLEMENTATION
23endif
24
25## Flags for position independent code
26SHAREDLIBCFLAGS =
27SHAREDLIBCXXFLAGS =
28SHAREDLIBCPPFLAGS =
29
30## Additional flags when building libraries and with threads
31LIBCPPFLAGS =
32
33ifeq ($(ENABLE_DEBUG),1)
34# /MDd means 'compiles and links a debugable multithreaded program with DLL'
35THREADSCFLAGS += /MDd
36THREADSCXXFLAGS += /MDd
37# The debug flags are defined here because configure can't handle them.
38CFLAGS+=/Zi
39CXXFLAGS+=/Zi
40LDFLAGS+=/DEBUG
41else
42# /MD means 'compiles and links a multithreaded program with DLL'
43THREADSCFLAGS += /MD
44THREADSCXXFLAGS += /MD
45endif
46
47ifeq ($(ENABLE_RELEASE),1)
48# Make sure that assertions are disabled
49CPPFLAGS+=-DU_RELEASE=1
50endif
51
52# /GF pools strings and places them into read-only memory
53# /GX enables exception handling
54CFLAGS += /GF
55CXXFLAGS += /GF /GX
56CPPFLAGS+=/nologo
57DEFS+=-DWIN32
58LDFLAGS+=/nologo
59
60# Commands to compile
61COMPILE.c= $(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) /c
62COMPILE.cc= $(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) /c
63
64# Commands to link
65LINK.c= LINK.EXE /subsystem:console $(LDFLAGS)
66LINK.cc= LINK.EXE /subsystem:console $(LDFLAGS)
67
68## Commands to make a shared library
69SHLIB.c= LINK.EXE /subsystem:console /DLL $(LDFLAGS)
70SHLIB.cc= LINK.EXE /subsystem:console /DLL $(LDFLAGS)
71
72## Compiler switch to embed a runtime search path
73LD_RPATH=
74LD_RPATH_PRE=
75
76## Compiler switch to embed a library name
77LD_SONAME = /IMPLIB:$(SO_TARGET:.dll=.lib)
78
79## Shared object suffix
80SO = dll
81## Non-shared intermediate object suffix
82STATIC_O = ao
83# OUTOPT is for creating a specific output name
84OUTOPT = /out:
85
86# Static library prefix and file extension
87LIBSICU = $(STATIC_PREFIX)$(ICUPREFIX)
88A = lib
89
90## An import library is needed for z/OS and MSVC
91IMPORT_LIB_EXT = .lib
92
93LIBPREFIX=
94DEFAULT_LIBS = advapi32.lib
95
96# Change the stubnames so that poorly working FAT disks and installation programs can work.
97# This is also for backwards compatibility.
98DATA_STUBNAME = dt
99I18N_STUBNAME = in
100LIBICU = $(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)
101
102## Link commands to link to ICU libs
103LIBICUDT= $(top_builddir)/stubdata/$(LIBICU)$(DATA_STUBNAME)$(ICULIBSUFFIX).lib
104LIBICUUC= $(LIBDIR)/$(LIBICU)$(COMMON_STUBNAME)$(ICULIBSUFFIX).lib $(LIBICUDT)
105LIBICUI18N= $(LIBDIR)/$(LIBICU)$(I18N_STUBNAME)$(ICULIBSUFFIX).lib
106LIBICULE= $(LIBDIR)/$(LIBICU)$(LAYOUT_STUBNAME)$(ICULIBSUFFIX).lib
107LIBICULX= $(LIBDIR)/$(LIBICU)$(LAYOUTEX_STUBNAME)$(ICULIBSUFFIX).lib
108LIBICUIO= $(LIBDIR)/$(LIBICU)$(IO_STUBNAME)$(ICULIBSUFFIX).lib
109LIBCTESTFW= $(top_builddir)/tools/ctestfw/$(LIBICU)$(CTESTFW_STUBNAME)$(ICULIBSUFFIX).lib
110LIBICUTOOLUTIL= $(LIBDIR)/$(LIBICU)$(TOOLUTIL_STUBNAME)$(ICULIBSUFFIX).lib
111
112## These are the library specific LDFLAGS
113LDFLAGSICUDT=# Unused for now.
114LDFLAGSICUUC= /base:"0x4a800000"# in-uc = 1MB
115LDFLAGSICUI18N= /base:"0x4a900000"# io-in = 2MB
116LDFLAGSICUIO= /base:"0x4ab00000"# le-io = 1MB
117LDFLAGSICULE= /base:"0x4ac00000"# lx-le = 512KB
118LDFLAGSICULX= /base:"0x4ac80000"
119LDFLAGSCTESTFW=# Unused for now.
120LDFLAGSICUTOOLUTIL= /base:"0x4ac00000"# Same as layout. Layout and tools probably won't mix.
121
122# The #M# is used to delete lines for icu-config
123# Current full path directory.
124CURR_FULL_DIR=$(shell cygpath -dma .)#M#
125# Current full path directory for use in source code in a -D compiler option.
126CURR_SRCCODE_FULL_DIR=$(subst \,\\\\,$(shell cygpath -da .))#M#
127
128ifeq ($(srcdir),.)
129SOURCE_FILE=$<
130else
131SOURCE_FILE=$(shell cygpath -dma $<)#M#
132endif
133
134## Compilation rules
135%.$(STATIC_O): $(srcdir)/%.c
136 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) /Fo$@ $(SOURCE_FILE)
137%.o: $(srcdir)/%.c
138 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) /Fo$@ $(SOURCE_FILE)
139
140%.$(STATIC_O): $(srcdir)/%.cpp
141 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) /Fo$@ $(SOURCE_FILE)
142%.o: $(srcdir)/%.cpp
143 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) /Fo$@ $(SOURCE_FILE)
144
145
146## Dependency rules
147## This is a start to how depdendencies could work
148# The commented out rules may not properly delete the file when ^C is pressed
149# or the compiler fails.
150# make currently doesn't like rules with C:\\PROGRA~1\\.. in the depedency.
151# So system headers are ignored by ignoring \\
152%.d : $(srcdir)/%.c
153 @echo "generating dependency information for $<"
154 @$(GEN_DEPS.c) $< > $@
155# @echo -n "generating dependency information for "
156# @echo -n "$@ $(basename $<).o : " > $@
157# @$(SHELL) -ec '$(GEN_DEPS.c) $< \
158# | grep "#line 1 " | grep -v \\\\ | cut -d " " -f 3 \
159# | /usr/bin/sort -u | sed s/\"$$/\\\\/ | sed s/^\"/\ / >> $@ \
160# || (rm -f $@ && echo $@ && false)'
161
162%.d : $(srcdir)/%.cpp
163 @echo "generating dependency information for $<"
164 @$(GEN_DEPS.cc) $< > $@
165# @echo -n "generating dependency information for "
166# @echo -n "$@ $(basename $<).o : " > $@
167# @$(SHELL) -ec '$(GEN_DEPS.cc) $< \
168# | grep "#line 1 " | grep -v \\\\ | cut -d " " -f 3 \
169# | /usr/bin/sort -u | sed s/\"$$/\\\\/ | sed s/^\"/\ / >> $@ \
170# || (rm -f $@ && echo $@ && false)'
171
172## Compile a Windows resource file
173%.res : $(srcdir)/%.rc
174 rc.exe /fo$@ $(SOURCE_FILE)
175
176## Versioned target for a shared library.
177FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO)
178MIDDLE_SO_TARGET=$(FINAL_SO_TARGET)
179
180## Special pkgdata information that is needed
181PKGDATA_VERSIONING = -r $(SO_TARGET_VERSION_MAJOR)
182ICUPKGDATA_INSTALL_DIR = $(shell cygpath -dma $(DESTDIR)$(ICUPKGDATA_DIR))#M#
183ICUPKGDATA_INSTALL_LIBDIR = $(shell cygpath -dma $(DESTDIR)$(libdir))#M#
184
185## Versioned import library names. The library names are versioned,
186## but the import libraries do not need versioning.
187IMPORT_LIB = $(basename $(SO_TARGET))$(IMPORT_LIB_EXT)
188MIDDLE_IMPORT_LIB = $(IMPORT_LIB)
189FINAL_IMPORT_LIB = $(MIDDLE_IMPORT_LIB)
190
191## Versioned libraries rules
192#%$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO)
193# $(RM) $@ && cp ${<F} $@
194# The following rule is a no op. We don't want symbolic links
195%.$(SO): %$(SO_TARGET_VERSION_MAJOR).$(SO)
196 @echo -n
197# $(RM) $@ && ln -s ${<F} $@
198
199## Install libraries as executable
200INSTALL-L=$(INSTALL_PROGRAM)
201
202# Environment variable to set a runtime search path
203LDLIBRARYPATH_ENVVAR = PATH
204
205# These are needed to allow the pkgdata nmake files to work
206PKGDATA_OPTS = -v
207PKGDATA_INVOKE_OPTS = MAKEFLAGS=
208
209# Include the version information in the shared library
210ENABLE_SO_VERSION_DATA=1
211
212## End Cygwin-specific setup
213