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.
|
2004-10-02 06:53:24 +00:00
|
|
|
sbindir=$(bindir)
|
2004-05-05 17:55:08 +00:00
|
|
|
|
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-09-12 22:30:29 +00:00
|
|
|
## Flags to create/use a static library
|
|
|
|
ifneq ($(ENABLE_SHARED),YES)
|
|
|
|
## Make sure that the static libraries can be built and used
|
|
|
|
CPPFLAGS += -DU_STATIC_IMPLEMENTATION
|
|
|
|
else
|
|
|
|
## Make sure that the static libraries can be built
|
2004-04-28 03:09:32 +00:00
|
|
|
STATICCPPFLAGS = -DU_STATIC_IMPLEMENTATION
|
2004-09-12 22:30:29 +00:00
|
|
|
endif
|
2004-04-28 03:09:32 +00:00
|
|
|
|
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
|
|
|
|
2004-08-27 03:56:13 +00:00
|
|
|
ifeq ($(ENABLE_RELEASE),1)
|
|
|
|
# Make sure that assertions are disabled
|
|
|
|
CPPFLAGS+=-DU_RELEASE=1
|
|
|
|
endif
|
|
|
|
|
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
|
2004-09-12 22:30:29 +00:00
|
|
|
LIBICU = $(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)
|
2004-04-19 17:32:30 +00:00
|
|
|
|
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-10-02 06:53:24 +00:00
|
|
|
# The #M# is used to delete lines for icu-config
|
2004-03-31 22:33:46 +00:00
|
|
|
# Current full path directory.
|
2004-10-02 06:53:24 +00:00
|
|
|
CURR_FULL_DIR=$(shell cygpath -dma .)#M#
|
2004-03-31 22:33:46 +00:00
|
|
|
# Current full path directory for use in source code in a -D compiler option.
|
2004-10-02 06:53:24 +00:00
|
|
|
CURR_SRCCODE_FULL_DIR=$(subst \,\\\\,$(shell cygpath -da .))#M#
|
2003-02-11 00:13:48 +00:00
|
|
|
|
2004-06-07 04:41:08 +00:00
|
|
|
ifeq ($(srcdir),.)
|
|
|
|
SOURCE_FILE=$<
|
|
|
|
else
|
2004-10-02 06:53:24 +00:00
|
|
|
SOURCE_FILE=$(shell cygpath -dma $<)#M#
|
2004-06-07 04:41:08 +00:00
|
|
|
endif
|
|
|
|
|
2003-02-11 00:13:48 +00:00
|
|
|
## Compilation rules
|
|
|
|
%.$(STATIC_O): $(srcdir)/%.c
|
2004-06-07 04:41:08 +00:00
|
|
|
$(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) /Fo$@ $(SOURCE_FILE)
|
2003-02-11 00:13:48 +00:00
|
|
|
%.o: $(srcdir)/%.c
|
2004-06-07 04:41:08 +00:00
|
|
|
$(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) /Fo$@ $(SOURCE_FILE)
|
2003-02-11 00:13:48 +00:00
|
|
|
|
|
|
|
%.$(STATIC_O): $(srcdir)/%.cpp
|
2004-06-07 04:41:08 +00:00
|
|
|
$(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) /Fo$@ $(SOURCE_FILE)
|
2003-02-11 00:13:48 +00:00
|
|
|
%.o: $(srcdir)/%.cpp
|
2004-06-07 04:41:08 +00:00
|
|
|
$(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) /Fo$@ $(SOURCE_FILE)
|
2003-02-11 00:13:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
## 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
|
2004-06-07 04:41:08 +00:00
|
|
|
rc.exe /fo$@ $(SOURCE_FILE)
|
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)
|
2004-10-21 16:22:07 +00:00
|
|
|
MIDDLE_SO_TARGET=$(FINAL_SO_TARGET)
|
2004-06-17 18:14:07 +00:00
|
|
|
|
|
|
|
## Special pkgdata information that is needed
|
2004-03-31 22:33:46 +00:00
|
|
|
PKGDATA_VERSIONING = -r $(SO_TARGET_VERSION_MAJOR)
|
2004-10-02 06:53:24 +00:00
|
|
|
ICUPKGDATA_INSTALL_DIR = $(shell cygpath -dma $(DESTDIR)$(ICUPKGDATA_DIR))#M#
|
|
|
|
ICUPKGDATA_INSTALL_LIBDIR = $(shell cygpath -dma $(DESTDIR)$(libdir))#M#
|
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-05-17 06:37:28 +00:00
|
|
|
IMPORT_LIB = $(basename $(SO_TARGET))$(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} $@
|
2004-10-21 16:22:07 +00:00
|
|
|
# The following rule is a no op. We don't want symbolic links
|
2003-03-21 01:12:29 +00:00
|
|
|
%.$(SO): %$(SO_TARGET_VERSION_MAJOR).$(SO)
|
2004-10-21 16:22:07 +00:00
|
|
|
@echo -n
|
|
|
|
# $(RM) $@ && ln -s ${<F} $@
|
2003-02-11 00:13:48 +00:00
|
|
|
|
2004-11-17 20:41:21 +00:00
|
|
|
## Install libraries as executable
|
|
|
|
INSTALL-L=$(INSTALL_PROGRAM)
|
|
|
|
|
2003-02-11 00:13:48 +00:00
|
|
|
# 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
|
|
|
|
|