]>
Commit | Line | Data |
---|---|---|
1 | ## -*-makefile-*- | |
2 | ## Cygwin/MinGW specific setup | |
3 | ## Copyright (c) 2001-2004, 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 | LIBCPPFLAGS = -D_REENTRANT | |
33 | THREADSCPPFLAGS = -D_REENTRANT | |
34 | ||
35 | # Commands to link. Link with C++ in case static libraries are used. | |
36 | LINK.c= $(CXX) $(CXXFLAGS) $(LDFLAGS) | |
37 | #LINK.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) | |
38 | ||
39 | ## Commands to make a shared library | |
40 | SHLIB.c= $(CC) $(CFLAGS) $(LDFLAGS) -shared | |
41 | SHLIB.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared | |
42 | ||
43 | ## Compiler switch to embed a runtime search path | |
44 | LD_RPATH= | |
45 | LD_RPATH_PRE= -Wl,-rpath, | |
46 | ||
47 | ## Compiler switch to embed a library name | |
48 | LD_SONAME = | |
49 | ||
50 | ## Shared object suffix | |
51 | SO = dll | |
52 | ## Non-shared intermediate object suffix | |
53 | STATIC_O = ao | |
54 | SO_TARGET_VERSION_SUFFIX = $(SO_TARGET_VERSION_MAJOR) | |
55 | ||
56 | # Static library prefix and file extension | |
57 | LIBSICU = $(STATIC_PREFIX)$(ICUPREFIX) | |
58 | A = lib | |
59 | ||
60 | ## An import library is needed for z/OS and MSVC | |
61 | IMPORT_LIB_EXT = .lib | |
62 | ||
63 | LIBPREFIX= | |
64 | ||
65 | # Change the stubnames so that poorly working FAT disks and installation programs can work. | |
66 | # This is also for backwards compatibility. | |
67 | DATA_STUBNAME = dt | |
68 | I18N_STUBNAME = in | |
69 | LIBICU = $(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX) | |
70 | ||
71 | # The #M# is used to delete lines for icu-config | |
72 | # Current full path directory. | |
73 | CURR_FULL_DIR=$(shell cygpath -dma .)#M# | |
74 | # Current full path directory for use in source code in a -D compiler option. | |
75 | CURR_SRCCODE_FULL_DIR=$(subst \,\\\\,$(shell cygpath -da .))#M# | |
76 | ||
77 | ## Compilation rules | |
78 | %.$(STATIC_O): $(srcdir)/%.c | |
79 | $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $< | |
80 | %.o: $(srcdir)/%.c | |
81 | $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $< | |
82 | ||
83 | %.$(STATIC_O): $(srcdir)/%.cpp | |
84 | $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $< | |
85 | %.o: $(srcdir)/%.cpp | |
86 | $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $< | |
87 | ||
88 | ||
89 | ## Dependency rules | |
90 | %.d: $(srcdir)/%.c | |
91 | @echo "generating dependency information for $<" | |
92 | @echo -n "$@ " > $@ | |
93 | @$(SHELL) -ec '$(GEN_DEPS.c) $< >> $@; [ -s $@ ] || rm -f $@' | |
94 | ||
95 | %.d: $(srcdir)/%.cpp | |
96 | @echo "generating dependency information for $<" | |
97 | @echo -n "$@ " > $@ | |
98 | @$(SHELL) -ec '$(GEN_DEPS.cc) $< >> $@; [ -s $@ ] || rm -f $@' | |
99 | ||
100 | ## Versioned target for a shared library. | |
101 | ## Since symbolic links don't work the same way on Windows, | |
102 | ## we only use the version major number. | |
103 | #FINAL_SO_TARGET=$(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO) | |
104 | FINAL_SO_TARGET=$(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO) | |
105 | MIDDLE_SO_TARGET=$(FINAL_SO_TARGET) | |
106 | ||
107 | ## Special pkgdata information that is needed | |
108 | PKGDATA_VERSIONING = -r $(SO_TARGET_VERSION_MAJOR) | |
109 | ICUPKGDATA_INSTALL_DIR = $(shell cygpath -dma $(DESTDIR)$(ICUPKGDATA_DIR))#M# | |
110 | ICUPKGDATA_INSTALL_LIBDIR = $(shell cygpath -dma $(DESTDIR)$(libdir))#M# | |
111 | ||
112 | ## Versioned libraries rules | |
113 | #%$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO) | |
114 | # $(RM) $@ && cp ${<F} $@ | |
115 | %.$(SO): %$(SO_TARGET_VERSION_MAJOR).$(SO) | |
116 | @echo -n | |
117 | ||
118 | # Environment variable to set a runtime search path | |
119 | LDLIBRARYPATH_ENVVAR = PATH | |
120 | ||
121 | # The type of assembly to write for generating an object file | |
122 | GENCCODE_ASSEMBLY=-a gcc-cygwin | |
123 | ||
124 | # These are needed to allow the pkgdata GNU make files to work | |
125 | PKGDATA_DEFS = -DU_MAKE=\"$(MAKE)\" | |
126 | ||
127 | ## End Cygwin/MinGW specific setup | |
128 |