2003-02-11 00:13:48 +00:00
|
|
|
## Cygwin-specific setup
|
2004-03-26 01:22:25 +00:00
|
|
|
## Copyright (c) 2001-2004, International Business Machines Corporation and
|
2003-02-11 00:13:48 +00:00
|
|
|
## others. All Rights Reserved.
|
|
|
|
|
2004-05-05 17:55:08 +00:00
|
|
|
# We install sbin tools into the same bin directory because
|
|
|
|
# pkgdata needs some of the tools in sbin, and we can't always depend on
|
|
|
|
# icu-config working on Windows.
|
|
|
|
sbindir := $(bindir)
|
|
|
|
|
2003-02-11 00:13:48 +00:00
|
|
|
## Commands to generate dependency files
|
|
|
|
GEN_DEPS.c= :
|
|
|
|
GEN_DEPS.cc= :
|
2003-10-17 07:22:14 +00:00
|
|
|
#GEN_DEPS.c= $(COMPILE.c) /E
|
|
|
|
#GEN_DEPS.cc= $(COMPILE.cc) /E
|
2003-02-11 00:13:48 +00:00
|
|
|
|
2004-04-28 03:09:32 +00:00
|
|
|
## Flags to create a static library
|
|
|
|
STATICCPPFLAGS = -DU_STATIC_IMPLEMENTATION
|
|
|
|
|
2003-02-11 00:13:48 +00:00
|
|
|
## Flags for position independent code
|
|
|
|
SHAREDLIBCFLAGS =
|
|
|
|
SHAREDLIBCXXFLAGS =
|
|
|
|
SHAREDLIBCPPFLAGS =
|
|
|
|
|
|
|
|
## Additional flags when building libraries and with threads
|
|
|
|
LIBCPPFLAGS =
|
2004-04-01 00:21:58 +00:00
|
|
|
|
|
|
|
ifeq ($(ENABLE_DEBUG),1)
|
2003-09-13 08:46:41 +00:00
|
|
|
# /MDd means 'compiles and links a debugable multithreaded program with DLL'
|
2004-04-01 00:21:58 +00:00
|
|
|
THREADSCFLAGS += /MDd
|
|
|
|
THREADSCXXFLAGS += /MDd
|
2004-05-04 04:18:01 +00:00
|
|
|
# The debug flags are defined here because configure can't handle them.
|
|
|
|
CFLAGS+=/Zi
|
|
|
|
CXXFLAGS+=/Zi
|
|
|
|
LDFLAGS+=/DEBUG
|
2004-04-01 00:21:58 +00:00
|
|
|
else
|
2003-09-13 08:46:41 +00:00
|
|
|
# /MD means 'compiles and links a multithreaded program with DLL'
|
|
|
|
THREADSCFLAGS += /MD
|
|
|
|
THREADSCXXFLAGS += /MD
|
2004-04-01 00:21:58 +00:00
|
|
|
endif
|
2003-02-11 00:13:48 +00:00
|
|
|
|
2003-09-13 08:46:41 +00:00
|
|
|
# /GF pools strings and places them into read-only memory
|
2004-03-29 22:31:23 +00:00
|
|
|
# /GX enables exception handling
|
2003-09-15 22:31:59 +00:00
|
|
|
CFLAGS += /GF
|
2004-03-29 22:31:23 +00:00
|
|
|
CXXFLAGS += /GF /GX
|
2003-02-11 00:13:48 +00:00
|
|
|
CPPFLAGS+=/nologo
|
2004-04-28 03:09:32 +00:00
|
|
|
DEFS+=-DWIN32
|
2003-02-11 00:13:48 +00:00
|
|
|
LDFLAGS+=/nologo
|
|
|
|
|
|
|
|
# Commands to compile
|
2003-09-13 08:46:41 +00:00
|
|
|
COMPILE.c= $(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) /c
|
|
|
|
COMPILE.cc= $(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) /c
|
2003-02-11 00:13:48 +00:00
|
|
|
|
|
|
|
# Commands to link
|
2003-02-17 17:48:50 +00:00
|
|
|
LINK.c= LINK.EXE /subsystem:console $(LDFLAGS)
|
|
|
|
LINK.cc= LINK.EXE /subsystem:console $(LDFLAGS)
|
2003-02-11 00:13:48 +00:00
|
|
|
|
|
|
|
## Commands to make a shared library
|
2004-05-06 05:56:22 +00:00
|
|
|
SHLIB.c= LINK.EXE /subsystem:console /DLL $(LDFLAGS)
|
|
|
|
SHLIB.cc= LINK.EXE /subsystem:console /DLL $(LDFLAGS)
|
2003-02-11 00:13:48 +00:00
|
|
|
|
|
|
|
## Compiler switch to embed a runtime search path
|
|
|
|
LD_RPATH=
|
|
|
|
LD_RPATH_PRE=
|
|
|
|
|
|
|
|
## Compiler switch to embed a library name
|
2004-04-05 21:26:57 +00:00
|
|
|
LD_SONAME = /IMPLIB:$(SO_TARGET:.dll=.lib)
|
2003-02-11 00:13:48 +00:00
|
|
|
|
|
|
|
## Shared object suffix
|
|
|
|
SO = dll
|
|
|
|
## Non-shared intermediate object suffix
|
2004-04-28 03:09:32 +00:00
|
|
|
STATIC_O = ao
|
2003-02-11 00:13:48 +00:00
|
|
|
# OUTOPT is for creating a specific output name
|
|
|
|
OUTOPT = /out:
|
|
|
|
|
2004-03-29 22:48:08 +00:00
|
|
|
# Static library prefix and file extension
|
|
|
|
LIBSICU = $(STATIC_PREFIX)$(ICUPREFIX)
|
|
|
|
A = lib
|
|
|
|
|
2003-03-19 01:56:39 +00:00
|
|
|
## An import library is needed for z/OS and MSVC
|
|
|
|
IMPORT_LIB_EXT = .lib
|
|
|
|
|
2004-04-05 21:26:57 +00:00
|
|
|
LIBPREFIX=
|
2003-09-13 08:46:41 +00:00
|
|
|
DEFAULT_LIBS = advapi32.lib
|
2003-02-11 00:13:48 +00:00
|
|
|
|
2004-04-19 17:32:30 +00:00
|
|
|
# Change the stubnames so that poorly working FAT disks and installation programs can work.
|
|
|
|
# This is also for backwards compatibility.
|
|
|
|
DATA_STUBNAME = dt
|
|
|
|
I18N_STUBNAME = in
|
|
|
|
|
2003-02-11 00:13:48 +00:00
|
|
|
## Link commands to link to ICU libs
|
2004-05-12 01:07:29 +00:00
|
|
|
LIBICUDT= $(top_builddir)/stubdata/$(LIBICU)$(DATA_STUBNAME)$(ICULIBSUFFIX).lib
|
2004-04-28 05:35:58 +00:00
|
|
|
LIBICUUC= $(LIBDIR)/$(LIBICU)$(COMMON_STUBNAME)$(ICULIBSUFFIX).lib $(LIBICUDT)
|
2004-04-19 17:32:30 +00:00
|
|
|
LIBICUI18N= $(LIBDIR)/$(LIBICU)$(I18N_STUBNAME)$(ICULIBSUFFIX).lib
|
|
|
|
LIBICULE= $(LIBDIR)/$(LIBICU)$(LAYOUT_STUBNAME)$(ICULIBSUFFIX).lib
|
|
|
|
LIBICULX= $(LIBDIR)/$(LIBICU)$(LAYOUTEX_STUBNAME)$(ICULIBSUFFIX).lib
|
2004-05-06 05:56:22 +00:00
|
|
|
LIBICUIO= $(LIBDIR)/$(LIBICU)$(IO_STUBNAME)$(ICULIBSUFFIX).lib
|
2004-04-19 17:32:30 +00:00
|
|
|
LIBCTESTFW= $(top_builddir)/tools/ctestfw/$(LIBICU)$(CTESTFW_STUBNAME)$(ICULIBSUFFIX).lib
|
|
|
|
LIBICUTOOLUTIL= $(LIBDIR)/$(LIBICU)$(TOOLUTIL_STUBNAME)$(ICULIBSUFFIX).lib
|
2004-05-06 05:56:22 +00:00
|
|
|
|
|
|
|
## These are the library specific LDFLAGS
|
2004-05-14 20:08:13 +00:00
|
|
|
LDFLAGSICUDT=# Unused for now.
|
2004-05-06 05:56:22 +00:00
|
|
|
LDFLAGSICUUC= /base:"0x4a800000"# in-uc = 1MB
|
|
|
|
LDFLAGSICUI18N= /base:"0x4a900000"# io-in = 2MB
|
|
|
|
LDFLAGSICUIO= /base:"0x4ab00000"# le-io = 1MB
|
|
|
|
LDFLAGSICULE= /base:"0x4ac00000"# lx-le = 512KB
|
|
|
|
LDFLAGSICULX= /base:"0x4ac80000"
|
2004-05-14 20:08:13 +00:00
|
|
|
LDFLAGSCTESTFW=# Unused for now.
|
2004-05-06 05:56:22 +00:00
|
|
|
LDFLAGSICUTOOLUTIL= /base:"0x4ac00000"# Same as layout. Layout and tools probably won't mix.
|
2003-02-11 00:13:48 +00:00
|
|
|
|
2004-04-28 06:34:25 +00:00
|
|
|
## If we can't use the shared libraries, use the static libraries
|
|
|
|
ifneq ($(ENABLE_SHARED),YES)
|
|
|
|
LIBICU=$(LIBSICU)
|
|
|
|
endif
|
|
|
|
|
2004-03-31 22:33:46 +00:00
|
|
|
# Current full path directory.
|
2004-05-14 20:08:13 +00:00
|
|
|
CURR_FULL_DIR=$(shell cygpath -ma .)
|
|
|
|
# Convert the specified directory to the native directory format.
|
|
|
|
# e.g. /cygdrive/c/temp -> C:/temp
|
|
|
|
native_dir=$(shell cygpath -ma $(1))
|
2004-03-31 22:33:46 +00:00
|
|
|
# Current full path directory for use in source code in a -D compiler option.
|
|
|
|
CURR_SRCCODE_FULL_DIR=$(subst \,\\\\,$(shell cygpath -wa .))
|
2003-02-11 00:13:48 +00:00
|
|
|
|
|
|
|
## Compilation rules
|
|
|
|
%.$(STATIC_O): $(srcdir)/%.c
|
|
|
|
$(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) /Fo$@ $<
|
|
|
|
%.o: $(srcdir)/%.c
|
|
|
|
$(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) /Fo$@ $<
|
|
|
|
|
|
|
|
%.$(STATIC_O): $(srcdir)/%.cpp
|
|
|
|
$(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) /Fo$@ $<
|
|
|
|
%.o: $(srcdir)/%.cpp
|
|
|
|
$(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) /Fo$@ $<
|
|
|
|
|
|
|
|
|
|
|
|
## Dependency rules
|
2003-10-17 07:22:14 +00:00
|
|
|
## This is a start to how depdendencies could work
|
|
|
|
# The commented out rules may not properly delete the file when ^C is pressed
|
|
|
|
# or the compiler fails.
|
|
|
|
# make currently doesn't like rules with C:\\PROGRA~1\\.. in the depedency.
|
|
|
|
# So system headers are ignored by ignoring \\
|
2003-02-11 00:13:48 +00:00
|
|
|
%.d : $(srcdir)/%.c
|
|
|
|
@echo "generating dependency information for $<"
|
|
|
|
@$(GEN_DEPS.c) $< > $@
|
2003-10-17 07:22:14 +00:00
|
|
|
# @echo -n "generating dependency information for "
|
|
|
|
# @echo -n "$@ $(basename $<).o : " > $@
|
|
|
|
# @$(SHELL) -ec '$(GEN_DEPS.c) $< \
|
|
|
|
# | grep "#line 1 " | grep -v \\\\ | cut -d " " -f 3 \
|
|
|
|
# | /usr/bin/sort -u | sed s/\"$$/\\\\/ | sed s/^\"/\ / >> $@ \
|
|
|
|
# || (rm -f $@ && echo $@ && false)'
|
2003-02-11 00:13:48 +00:00
|
|
|
|
|
|
|
%.d : $(srcdir)/%.cpp
|
|
|
|
@echo "generating dependency information for $<"
|
|
|
|
@$(GEN_DEPS.cc) $< > $@
|
2003-10-17 07:22:14 +00:00
|
|
|
# @echo -n "generating dependency information for "
|
|
|
|
# @echo -n "$@ $(basename $<).o : " > $@
|
|
|
|
# @$(SHELL) -ec '$(GEN_DEPS.cc) $< \
|
|
|
|
# | grep "#line 1 " | grep -v \\\\ | cut -d " " -f 3 \
|
|
|
|
# | /usr/bin/sort -u | sed s/\"$$/\\\\/ | sed s/^\"/\ / >> $@ \
|
|
|
|
# || (rm -f $@ && echo $@ && false)'
|
2003-02-11 00:13:48 +00:00
|
|
|
|
2003-02-17 17:48:50 +00:00
|
|
|
## Compile a Windows resource file
|
|
|
|
%.res : $(srcdir)/%.rc
|
2003-09-26 00:14:25 +00:00
|
|
|
rc.exe /fo$@ $<
|
2003-02-17 17:48:50 +00:00
|
|
|
|
2003-02-11 00:13:48 +00:00
|
|
|
## Versioned target for a shared library.
|
2003-09-15 22:31:59 +00:00
|
|
|
FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO)
|
2003-03-19 01:56:39 +00:00
|
|
|
MIDDLE_SO_TARGET=$(SO_TARGET)
|
2004-03-31 22:33:46 +00:00
|
|
|
PKGDATA_VERSIONING = -r $(SO_TARGET_VERSION_MAJOR)
|
2003-03-19 01:56:39 +00:00
|
|
|
|
2004-04-07 16:54:33 +00:00
|
|
|
## Versioned import library names. The library names are versioned,
|
|
|
|
## but the import libraries do not need versioning.
|
2004-04-05 21:26:57 +00:00
|
|
|
IMPORT_LIB = $(LIBDIR)/$(LIBICU)$(TARGET_STUBNAME)$(ICULIBSUFFIX)$(IMPORT_LIB_EXT)
|
2004-04-07 16:54:33 +00:00
|
|
|
MIDDLE_IMPORT_LIB = $(IMPORT_LIB)
|
2004-04-05 21:26:57 +00:00
|
|
|
FINAL_IMPORT_LIB = $(MIDDLE_IMPORT_LIB)
|
2003-02-11 00:13:48 +00:00
|
|
|
|
|
|
|
## Versioned libraries rules
|
2003-03-21 01:12:29 +00:00
|
|
|
#%$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO)
|
2004-03-29 22:58:46 +00:00
|
|
|
# $(RM) $@ && cp ${<F} $@
|
2003-03-21 01:12:29 +00:00
|
|
|
%.$(SO): %$(SO_TARGET_VERSION_MAJOR).$(SO)
|
2004-03-29 22:58:46 +00:00
|
|
|
$(RM) $@ && ln -s ${<F} $@
|
2003-02-11 00:13:48 +00:00
|
|
|
|
|
|
|
## Bind internal references
|
|
|
|
|
|
|
|
# LDflags that pkgdata will use
|
|
|
|
BIR_LDFLAGS= -Wl,-Bsymbolic
|
|
|
|
|
|
|
|
# CPPflags for genccode/gencmn
|
|
|
|
BIR_CPPFLAGS= -DU_HAVE_BIND_INTERNAL_REFERENCES
|
|
|
|
|
|
|
|
# Dependencies [i.e. map files] for the final library
|
|
|
|
BIR_DEPS=
|
|
|
|
|
|
|
|
# Environment variable to set a runtime search path
|
|
|
|
LDLIBRARYPATH_ENVVAR = PATH
|
|
|
|
|
2003-09-26 00:14:25 +00:00
|
|
|
# These are needed to allow the pkgdata nmake files to work
|
2003-09-23 00:29:28 +00:00
|
|
|
PKGDATA_OPTS = -v
|
|
|
|
PKGDATA_INVOKE_OPTS = MAKEFLAGS=
|
|
|
|
|
2003-09-26 00:14:25 +00:00
|
|
|
# Include the version information in the shared library
|
|
|
|
ENABLE_SO_VERSION_DATA=1
|
|
|
|
|
2003-02-11 00:13:48 +00:00
|
|
|
## End Cygwin-specific setup
|
|
|
|
|