scuffed-code/icu4c/source/config/mh-cygwin-msvc
2004-04-01 06:43:16 +00:00

170 lines
5.2 KiB
Makefile

## -*-makefile-*-
## Cygwin-specific setup
## Copyright (c) 2001-2004, International Business Machines Corporation and
## others. All Rights Reserved.
## Commands to generate dependency files
GEN_DEPS.c= :
GEN_DEPS.cc= :
#GEN_DEPS.c= $(COMPILE.c) /E
#GEN_DEPS.cc= $(COMPILE.cc) /E
## Flags for position independent code
SHAREDLIBCFLAGS =
SHAREDLIBCXXFLAGS =
SHAREDLIBCPPFLAGS =
## Additional flags when building libraries and with threads
LIBCPPFLAGS =
ifeq ($(ENABLE_DEBUG),1)
# /MDd means 'compiles and links a debugable multithreaded program with DLL'
THREADSCFLAGS += /MDd
THREADSCXXFLAGS += /MDd
else
# /MD means 'compiles and links a multithreaded program with DLL'
THREADSCFLAGS += /MD
THREADSCXXFLAGS += /MD
endif
# /GF pools strings and places them into read-only memory
# /GX enables exception handling
CFLAGS += /GF
CXXFLAGS += /GF /GX
CPPFLAGS+=/nologo
DEFS+=/D"WIN32"
LDFLAGS+=/nologo
# Commands to compile
COMPILE.c= $(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) /c
COMPILE.cc= $(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) /c
# Commands to link
LINK.c= LINK.EXE /subsystem:console $(LDFLAGS)
LINK.cc= LINK.EXE /subsystem:console $(LDFLAGS)
## Commands to make a shared library
SHLIB.c= LINK.EXE /DLL $(LDFLAGS)
SHLIB.cc= LINK.EXE /DLL $(LDFLAGS)
## Compiler switch to embed a runtime search path
LD_RPATH=
LD_RPATH_PRE=
## Compiler switch to embed a library name
LD_SONAME =
## Shared object suffix
SO = dll
## Non-shared intermediate object suffix
STATIC_O = o
# OUTOPT is for creating a specific output name
OUTOPT = /out:
# Static library prefix and file extension
LIBSICU = $(STATIC_PREFIX)$(ICUPREFIX)
A = lib
## An import library is needed for z/OS and MSVC
IMPORT_LIB_EXT = .lib
LIBICU = $(ICUPREFIX)
DEFAULT_LIBS = advapi32.lib
## Link commands to link to ICU libs
LIBICUDT= $(LIBDIR)/$(LIBICU)data$(ICULIBSUFFIX)$(SO_TARGET_VERSION_MAJOR).lib
LIBICUUC= $(LIBDIR)/$(LIBICU)uc$(ICULIBSUFFIX)$(SO_TARGET_VERSION_MAJOR).lib
LIBICUI18N= $(LIBDIR)/$(LIBICU)i18n$(ICULIBSUFFIX)$(SO_TARGET_VERSION_MAJOR).lib
LIBICULE= $(LIBDIR)/$(LIBICU)le$(ICULIBSUFFIX)$(SO_TARGET_VERSION_MAJOR).lib
LIBICULX= $(LIBDIR)/$(LIBICU)lx$(ICULIBSUFFIX)$(SO_TARGET_VERSION_MAJOR).lib
LIBCTESTFW= $(top_builddir)/tools/ctestfw/$(LIBICU)ctestfw$(ICULIBSUFFIX)$(SO_TARGET_VERSION_MAJOR).lib
LIBICUTOOLUTIL= $(LIBDIR)/$(LIBICU)tu$(ICULIBSUFFIX)$(SO_TARGET_VERSION_MAJOR).lib
LIBICUIO= $(LIBDIR)/$(LIBICU)io$(ICULIBSUFFIX)$(SO_TARGET_VERSION_MAJOR).lib
# Current full path directory.
CURR_FULL_DIR=$(shell cygpath -wma .)
# Current full path directory for use in source code in a -D compiler option.
CURR_SRCCODE_FULL_DIR=$(subst \,\\\\,$(shell cygpath -wa .))
## 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
## 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 \\
%.d : $(srcdir)/%.c
@echo "generating dependency information for $<"
@$(GEN_DEPS.c) $< > $@
# @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)'
%.d : $(srcdir)/%.cpp
@echo "generating dependency information for $<"
@$(GEN_DEPS.cc) $< > $@
# @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)'
## Compile a Windows resource file
%.res : $(srcdir)/%.rc
rc.exe /fo$@ $<
## Versioned target for a shared library.
FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO)
MIDDLE_SO_TARGET=$(SO_TARGET)
PKGDATA_VERSIONING = -r $(SO_TARGET_VERSION_MAJOR)
## Versioned import library names.
IMPORT_LIB = $(LIBICU)$(TARGET_STUBNAME)$(ICULIBSUFFIX)$(IMPORT_LIB_EXT)
MIDDLE_IMPORT_LIB = $(LIBICU)$(TARGET_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_MAJOR)$(IMPORT_LIB_EXT)
FINAL_IMPORT_LIB := $(MIDDLE_IMPORT_LIB)
## Versioned libraries rules
#%$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO)
# $(RM) $@ && cp ${<F} $@
%.$(SO): %$(SO_TARGET_VERSION_MAJOR).$(SO)
$(RM) $@ && ln -s ${<F} $@
## 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
# These are needed to allow the pkgdata nmake files to work
PKGDATA_OPTS = -v
PKGDATA_INVOKE_OPTS = MAKEFLAGS=
# Include the version information in the shared library
ENABLE_SO_VERSION_DATA=1
## End Cygwin-specific setup