]>
Commit | Line | Data |
---|---|---|
1 | ## -*-makefile-*- | |
2 | ## Cygwin-specific setup | |
3 | ## Copyright (c) 2001-2003, International Business Machines Corporation and | |
4 | ## others. All Rights Reserved. | |
5 | ## | |
6 | ## $Id: mh-cygwin-msvc,v 1.1.1.1 2003/07/03 18:13:33 avery Exp $ | |
7 | ||
8 | ## Commands to generate dependency files | |
9 | GEN_DEPS.c= : | |
10 | GEN_DEPS.cc= : | |
11 | ||
12 | ## Flags for position independent code | |
13 | SHAREDLIBCFLAGS = | |
14 | SHAREDLIBCXXFLAGS = | |
15 | SHAREDLIBCPPFLAGS = | |
16 | ||
17 | ## Additional flags when building libraries and with threads | |
18 | LIBCPPFLAGS = | |
19 | THREADSCPPFLAGS = | |
20 | ||
21 | CPPFLAGS+=/nologo | |
22 | DEFS+=/D"WIN32" | |
23 | LDFLAGS+=/nologo | |
24 | ||
25 | # Commands to compile | |
26 | COMPILE.c= $(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) /GF /c | |
27 | COMPILE.cc= $(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) /GF /c | |
28 | ||
29 | # Commands to link | |
30 | LINK.c= LINK.EXE /subsystem:console $(LDFLAGS) | |
31 | LINK.cc= LINK.EXE /subsystem:console $(LDFLAGS) | |
32 | ||
33 | ## Commands to make a shared library | |
34 | SHLIB.c= LINK.EXE /DLL $(LDFLAGS) | |
35 | SHLIB.cc= LINK.EXE /DLL $(LDFLAGS) | |
36 | ||
37 | ## Compiler switch to embed a runtime search path | |
38 | LD_RPATH= | |
39 | LD_RPATH_PRE= | |
40 | ||
41 | ## Compiler switch to embed a library name | |
42 | LD_SONAME = | |
43 | ||
44 | ## Shared object suffix | |
45 | SO = dll | |
46 | ## Non-shared intermediate object suffix | |
47 | STATIC_O = o | |
48 | # OUTOPT is for creating a specific output name | |
49 | OUTOPT = /out: | |
50 | ||
51 | ## An import library is needed for z/OS and MSVC | |
52 | IMPORT_LIB_EXT = .lib | |
53 | ||
54 | LIBICU = $(ICUPREFIX) | |
55 | DEFAULT_LIBS = | |
56 | ||
57 | ## Link commands to link to ICU libs | |
58 | LIBICUDT= $(top_builddir)/stubdata/$(LIBICU)data$(ICULIBSUFFIX)$(SO_TARGET_VERSION_MAJOR).lib | |
59 | LIBICUUC= $(top_builddir)/common/$(LIBICU)uc$(ICULIBSUFFIX)$(SO_TARGET_VERSION_MAJOR).lib | |
60 | LIBICUI18N= $(top_builddir)/i18n/$(LIBICU)i18n$(ICULIBSUFFIX)$(SO_TARGET_VERSION_MAJOR).lib | |
61 | LIBICULE= $(top_builddir)/layout/$(LIBICU)le$(ICULIBSUFFIX)$(SO_TARGET_VERSION_MAJOR).lib | |
62 | LIBICULX= $(top_builddir)/layoutex/$(LIBICU)lx$(ICULIBSUFFIX)$(SO_TARGET_VERSION_MAJOR).lib | |
63 | LIBCTESTFW= $(top_builddir)/tools/ctestfw/$(LIBICU)ctestfw$(ICULIBSUFFIX)$(SO_TARGET_VERSION_MAJOR).lib | |
64 | LIBICUTOOLUTIL= $(top_builddir)/tools/toolutil/$(LIBICU)toolutil$(ICULIBSUFFIX)$(SO_TARGET_VERSION_MAJOR).lib | |
65 | LIBUSTDIO= $(top_builddir)/extra/ustdio/$(LIBICU)io$(ICULIBSUFFIX)$(SO_TARGET_VERSION_MAJOR).lib | |
66 | ||
67 | ||
68 | ## Compilation rules | |
69 | %.$(STATIC_O): $(srcdir)/%.c | |
70 | $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) /Fo$@ $< | |
71 | %.o: $(srcdir)/%.c | |
72 | $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) /Fo$@ $< | |
73 | ||
74 | %.$(STATIC_O): $(srcdir)/%.cpp | |
75 | $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) /Fo$@ $< | |
76 | %.o: $(srcdir)/%.cpp | |
77 | $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) /Fo$@ $< | |
78 | ||
79 | ../data/%.o: ../data/%.c | |
80 | $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) /Fo$@ $< | |
81 | ||
82 | ## Dependency rules | |
83 | #%.d: $(srcdir)/%.c | |
84 | # @echo "generating dependency information for $<" | |
85 | # $(SHELL) -ec '$(GEN_DEPS.c) $< \ | |
86 | # | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \ | |
87 | # [ -s $@ ] || rm -f $@' | |
88 | # | |
89 | #%.d: $(srcdir)/%.cpp | |
90 | # @echo "generating dependency information for $<" | |
91 | # $(SHELL) -ec '$(GEN_DEPS.cc) $< \ | |
92 | # | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \ | |
93 | # [ -s $@ ] || rm -f $@' | |
94 | ||
95 | ## Dependency rules | |
96 | %.d : $(srcdir)/%.c | |
97 | @echo "generating dependency information for $<" | |
98 | @$(GEN_DEPS.c) $< > $@ | |
99 | ||
100 | %.d : $(srcdir)/%.cpp | |
101 | @echo "generating dependency information for $<" | |
102 | @$(GEN_DEPS.cc) $< > $@ | |
103 | ||
104 | ## Compile a Windows resource file | |
105 | %.res : $(srcdir)/%.rc | |
106 | @rc.exe /fo$@ $< | |
107 | ||
108 | ## Versioned target for a shared library. | |
109 | FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO) | |
110 | MIDDLE_SO_TARGET=$(SO_TARGET) | |
111 | ||
112 | ## Versioned import library names. | |
113 | IMPORT_LIB = $(LIBICU)$(TARGET_STUBNAME)$(ICULIBSUFFIX)$(IMPORT_LIB_EXT) | |
114 | MIDDLE_IMPORT_LIB = $(LIBICU)$(TARGET_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_MAJOR)$(IMPORT_LIB_EXT) | |
115 | FINAL_IMPORT_LIB := $(MIDDLE_IMPORT_LIB) | |
116 | ||
117 | ## Versioned libraries rules | |
118 | #%$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO) | |
119 | # $(RM) $@ && cp $< $@ | |
120 | %.$(SO): %$(SO_TARGET_VERSION_MAJOR).$(SO) | |
121 | $(RM) $@ && ln -s $< $@ | |
122 | ||
123 | ## Bind internal references | |
124 | ||
125 | # LDflags that pkgdata will use | |
126 | BIR_LDFLAGS= -Wl,-Bsymbolic | |
127 | ||
128 | # CPPflags for genccode/gencmn | |
129 | BIR_CPPFLAGS= -DU_HAVE_BIND_INTERNAL_REFERENCES | |
130 | ||
131 | # Dependencies [i.e. map files] for the final library | |
132 | BIR_DEPS= | |
133 | ||
134 | # Environment variable to set a runtime search path | |
135 | LDLIBRARYPATH_ENVVAR = PATH | |
136 | ||
137 | ## End Cygwin-specific setup | |
138 |