Home | History | Annotate | Download | only in config
      1 ## -*-makefile-*-
      2 ## Cygwin/MinGW specific setup
      3 ## Copyright (c) 2001-2009, International Business Machines Corporation and
      4 ## others. All Rights Reserved.
      5 
      6 # TODO: Finish the rest of this port. This platform port is incomplete.
      7 
      8 # We install sbin tools into the same bin directory because
      9 # pkgdata needs some of the tools in sbin, and we can't always depend on
     10 # icu-config working on Windows.
     11 sbindir=$(bindir)
     12 
     13 ## Commands to generate dependency files
     14 GEN_DEPS.c=	$(CC) -E -MM $(DEFS) $(CPPFLAGS)
     15 GEN_DEPS.cc=	$(CXX) -E -MM $(DEFS) $(CPPFLAGS)
     16 
     17 ## Flags to create/use a static library
     18 ifneq ($(ENABLE_SHARED),YES)
     19 ## Make sure that the static libraries can be built and used
     20 CPPFLAGS += -DU_STATIC_IMPLEMENTATION
     21 else
     22 ## Make sure that the static libraries can be built
     23 STATICCPPFLAGS = -DU_STATIC_IMPLEMENTATION
     24 endif
     25 
     26 ## Flags for position independent code
     27 SHAREDLIBCFLAGS = 
     28 SHAREDLIBCXXFLAGS = 
     29 SHAREDLIBCPPFLAGS = -DPIC
     30 
     31 ## Additional flags when building libraries and with threads
     32 THREADSCFLAGS = -mthreads
     33 THREADSCXXFLAGS = -mthreads
     34 LIBCPPFLAGS =
     35 
     36 # Commands to link. Link with C++ in case static libraries are used.
     37 LINK.c=       $(CXX) $(CXXFLAGS) $(LDFLAGS)
     38 #LINK.cc=      $(CXX) $(CXXFLAGS) $(LDFLAGS)
     39 
     40 ## Commands to make a shared library
     41 SHLIB.c=	$(CC) $(CFLAGS) $(LDFLAGS) -shared
     42 SHLIB.cc=	$(CXX) $(CXXFLAGS) $(LDFLAGS) -shared
     43 
     44 ## Compiler switch to embed a runtime search path
     45 LD_RPATH=	
     46 LD_RPATH_PRE=	-Wl,-rpath,
     47 
     48 ## Compiler switch to embed a library name
     49 LD_SONAME = 
     50 
     51 ## Shared object suffix
     52 SO = dll
     53 ## Non-shared intermediate object suffix
     54 STATIC_O = ao
     55 SO_TARGET_VERSION_SUFFIX = $(SO_TARGET_VERSION_MAJOR)
     56 
     57 # Static library prefix and file extension
     58 LIBSICU = $(STATIC_PREFIX)$(ICUPREFIX)
     59 A = lib
     60 
     61 ## An import library is needed for z/OS and MSVC
     62 #IMPORT_LIB_EXT = .lib
     63 
     64 LIBPREFIX=
     65 
     66 # Change the stubnames so that poorly working FAT disks and installation programs can work.
     67 # This is also for backwards compatibility.
     68 DATA_STUBNAME = dt
     69 I18N_STUBNAME = in
     70 LIBICU = $(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)
     71 
     72 # The #M# is used to delete lines for icu-config
     73 # Current full path directory.
     74 #CURR_FULL_DIR=$(shell pwd -W)#M# for MSYS
     75 CURR_FULL_DIR=$(subst \,/,$(shell cmd /c cd))#M# for Cygwin shell
     76 # Current full path directory for use in source code in a -D compiler option.
     77 #CURR_SRCCODE_FULL_DIR=$(subst /,\\\\,$(shell pwd -W))#M# for MSYS
     78 CURR_SRCCODE_FULL_DIR=$(subst \,/,$(shell cmd /c cd))#M# for Cygwin shell
     79 
     80 ## Compilation rules
     81 %.$(STATIC_O): $(srcdir)/%.c
     82 	$(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
     83 %.o: $(srcdir)/%.c
     84 	$(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
     85 
     86 %.$(STATIC_O): $(srcdir)/%.cpp
     87 	$(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
     88 %.o: $(srcdir)/%.cpp
     89 	$(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
     90 
     91 
     92 ## Dependency rules
     93 %.d: $(srcdir)/%.c
     94 	@echo "generating dependency information for $<"
     95 	@echo -n "$@ " > $@
     96 	@$(GEN_DEPS.c) $< >> $@ || (rm -f $@ && FALSE)
     97 
     98 %.d: $(srcdir)/%.cpp
     99 	@echo "generating dependency information for $<"
    100 	@echo -n "$@ " > $@
    101 	@$(GEN_DEPS.cc) $< >> $@ || (rm -f $@ && FALSE)
    102 
    103 ## Versioned target for a shared library.
    104 ## Since symbolic links don't work the same way on Windows,
    105 ## we only use the version major number.
    106 #FINAL_SO_TARGET=$(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO)
    107 FINAL_SO_TARGET=$(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO)
    108 MIDDLE_SO_TARGET=$(FINAL_SO_TARGET)
    109 
    110 ## Special pkgdata information that is needed
    111 PKGDATA_VERSIONING = -r $(SO_TARGET_VERSION_MAJOR)
    112 #ICUPKGDATA_INSTALL_DIR = $(shell cygpath -dma $(DESTDIR)$(ICUPKGDATA_DIR))#M#
    113 #ICUPKGDATA_INSTALL_LIBDIR = $(shell cygpath -dma $(DESTDIR)$(libdir))#M#
    114 
    115 ## Versioned libraries rules
    116 #%$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO)
    117 #	$(RM) $@ && cp ${<F} $@
    118 %.$(SO): %$(SO_TARGET_VERSION_MAJOR).$(SO)
    119 	@echo -n
    120 
    121 # Environment variable to set a runtime search path
    122 LDLIBRARYPATH_ENVVAR = PATH
    123 
    124 # The type of assembly to write for generating an object file
    125 GENCCODE_ASSEMBLY=-a gcc-cygwin
    126 
    127 # These are needed to allow the pkgdata GNU make files to work
    128 PKGDATA_DEFS = -DU_MAKE=\"$(MAKE)\"
    129 
    130 ## End Cygwin/MinGW specific setup
    131 
    132