2003-02-11 00:13:48 +00:00
|
|
|
## -*-makefile-*-
|
|
|
|
## Cygwin-specific setup
|
2003-06-03 20:58:22 +00:00
|
|
|
## Copyright (c) 2001-2003, International Business Machines Corporation and
|
2003-02-11 00:13:48 +00:00
|
|
|
## others. All Rights Reserved.
|
|
|
|
##
|
2003-10-17 07:22:14 +00:00
|
|
|
## $Id: mh-cygwin-msvc,v 1.16 2003/10/17 07:22:14 grhoten-oss Exp $
|
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
|
|
|
|
|
|
|
## Flags for position independent code
|
|
|
|
SHAREDLIBCFLAGS =
|
|
|
|
SHAREDLIBCXXFLAGS =
|
|
|
|
SHAREDLIBCPPFLAGS =
|
|
|
|
|
|
|
|
## Additional flags when building libraries and with threads
|
|
|
|
LIBCPPFLAGS =
|
2003-09-13 08:46:41 +00:00
|
|
|
# /MDd means 'compiles and links a debugable multithreaded program with DLL'
|
|
|
|
#THREADSCFLAGS += /MDd
|
|
|
|
#THREADSCXXFLAGS += /MDd
|
|
|
|
# /MD means 'compiles and links a multithreaded program with DLL'
|
|
|
|
THREADSCFLAGS += /MD
|
|
|
|
THREADSCXXFLAGS += /MD
|
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
|
2003-09-15 22:31:59 +00:00
|
|
|
CFLAGS += /GF
|
|
|
|
CXXFLAGS += /GF
|
2003-02-11 00:13:48 +00:00
|
|
|
CPPFLAGS+=/nologo
|
2003-09-13 09:06:09 +00:00
|
|
|
DEFS+=/D"WIN32"
|
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
|
2003-02-17 17:48:50 +00:00
|
|
|
SHLIB.c= LINK.EXE /DLL $(LDFLAGS)
|
|
|
|
SHLIB.cc= LINK.EXE /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
|
|
|
|
LD_SONAME =
|
|
|
|
|
|
|
|
## Shared object suffix
|
|
|
|
SO = dll
|
|
|
|
## Non-shared intermediate object suffix
|
2003-02-17 17:48:50 +00:00
|
|
|
STATIC_O = o
|
2003-02-11 00:13:48 +00:00
|
|
|
# OUTOPT is for creating a specific output name
|
|
|
|
OUTOPT = /out:
|
|
|
|
|
2003-03-19 01:56:39 +00:00
|
|
|
## An import library is needed for z/OS and MSVC
|
|
|
|
IMPORT_LIB_EXT = .lib
|
|
|
|
|
2003-02-11 00:13:48 +00:00
|
|
|
LIBICU = $(ICUPREFIX)
|
2003-09-13 08:46:41 +00:00
|
|
|
DEFAULT_LIBS = advapi32.lib
|
2003-02-11 00:13:48 +00:00
|
|
|
|
|
|
|
## Link commands to link to ICU libs
|
|
|
|
LIBICUDT= $(top_builddir)/stubdata/$(LIBICU)data$(ICULIBSUFFIX)$(SO_TARGET_VERSION_MAJOR).lib
|
|
|
|
LIBICUUC= $(top_builddir)/common/$(LIBICU)uc$(ICULIBSUFFIX)$(SO_TARGET_VERSION_MAJOR).lib
|
|
|
|
LIBICUI18N= $(top_builddir)/i18n/$(LIBICU)i18n$(ICULIBSUFFIX)$(SO_TARGET_VERSION_MAJOR).lib
|
|
|
|
LIBICULE= $(top_builddir)/layout/$(LIBICU)le$(ICULIBSUFFIX)$(SO_TARGET_VERSION_MAJOR).lib
|
2003-04-24 21:00:36 +00:00
|
|
|
LIBICULX= $(top_builddir)/layoutex/$(LIBICU)lx$(ICULIBSUFFIX)$(SO_TARGET_VERSION_MAJOR).lib
|
2003-02-11 00:13:48 +00:00
|
|
|
LIBCTESTFW= $(top_builddir)/tools/ctestfw/$(LIBICU)ctestfw$(ICULIBSUFFIX)$(SO_TARGET_VERSION_MAJOR).lib
|
|
|
|
LIBICUTOOLUTIL= $(top_builddir)/tools/toolutil/$(LIBICU)toolutil$(ICULIBSUFFIX)$(SO_TARGET_VERSION_MAJOR).lib
|
2003-05-30 23:00:07 +00:00
|
|
|
LIBUSTDIO= $(top_builddir)/extra/ustdio/$(LIBICU)io$(ICULIBSUFFIX)$(SO_TARGET_VERSION_MAJOR).lib
|
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)
|
|
|
|
|
|
|
|
## Versioned import library names.
|
|
|
|
IMPORT_LIB = $(LIBICU)$(TARGET_STUBNAME)$(ICULIBSUFFIX)$(IMPORT_LIB_EXT)
|
2003-04-10 17:42:21 +00:00
|
|
|
MIDDLE_IMPORT_LIB = $(LIBICU)$(TARGET_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_MAJOR)$(IMPORT_LIB_EXT)
|
|
|
|
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)
|
2003-02-11 00:13:48 +00:00
|
|
|
# $(RM) $@ && cp $< $@
|
2003-03-21 01:12:29 +00:00
|
|
|
%.$(SO): %$(SO_TARGET_VERSION_MAJOR).$(SO)
|
2003-02-11 00:13:48 +00:00
|
|
|
$(RM) $@ && ln -s $< $@
|
|
|
|
|
|
|
|
## 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
|
|
|
|
|