1 | #
|
---|
2 | # Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved.
|
---|
3 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
---|
4 | #
|
---|
5 | # Copyright 2010 netlabs.org. OS/2 parts
|
---|
6 | #
|
---|
7 | # This code is free software; you can redistribute it and/or modify it
|
---|
8 | # under the terms of the GNU General Public License version 2 only, as
|
---|
9 | # published by the Free Software Foundation. Sun designates this
|
---|
10 | # particular file as subject to the "Classpath" exception as provided
|
---|
11 | # by Sun in the LICENSE file that accompanied this code.
|
---|
12 | #
|
---|
13 | # This code is distributed in the hope that it will be useful, but WITHOUT
|
---|
14 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
---|
15 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
---|
16 | # version 2 for more details (a copy is included in the LICENSE file that
|
---|
17 | # accompanied this code).
|
---|
18 | #
|
---|
19 | # You should have received a copy of the GNU General Public License version
|
---|
20 | # 2 along with this work; if not, write to the Free Software Foundation,
|
---|
21 | # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
---|
22 | #
|
---|
23 | # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
---|
24 | # CA 95054 USA or visit www.sun.com if you need additional information or
|
---|
25 | # have any questions.
|
---|
26 | #
|
---|
27 |
|
---|
28 | #
|
---|
29 | # Makefile to specify compiler flags for programs and libraries
|
---|
30 | # targeted to Windows builds. Should not contain any rules.
|
---|
31 | #
|
---|
32 | # WARNING: This file is shared with other workspaces.
|
---|
33 | # So when it includes other files, it must use JDK_TOPDIR.
|
---|
34 | #
|
---|
35 |
|
---|
36 | # Get shared JDK settings
|
---|
37 | include $(JDK_MAKE_SHARED_DIR)/Defs.gmk
|
---|
38 |
|
---|
39 | # LIB_LOCATION, which for OS/2 identifies where .exe files go, may be
|
---|
40 | # set by each GNUmakefile. The default is BINDIR.
|
---|
41 | ifndef LIB_LOCATION
|
---|
42 | LIB_LOCATION = $(BINDIR)
|
---|
43 | endif # LIB_LOCATION
|
---|
44 |
|
---|
45 | # Part of INCREMENTAL_BUILD mechanism.
|
---|
46 | # Compiler emits things like: file.obj: file.c file.h...
|
---|
47 | # We want something like: obj_path/file.obj: file.c file.h...
|
---|
48 | CC_DEPEND = -MM -MT $(@:$(suffix $@)=.$(OBJECT_SUFFIX))
|
---|
49 | CC_DEPEND_FILTER =
|
---|
50 |
|
---|
51 | ifndef PLATFORM_SRC
|
---|
52 | # We mostly reuse the windows code so far.
|
---|
53 | PLATFORM_SRC = $(BUILDDIR)/../src/windows
|
---|
54 | endif # PLATFORM_SRC
|
---|
55 |
|
---|
56 | ifndef PLATFORM_SRC_OS2
|
---|
57 | # OS/2 is based on Odin32 so PLATFORM_SRC is 'windows'. But in some cases we
|
---|
58 | # provide the native bits and need to refer to a separate 'os2' soorce tree
|
---|
59 | PLATFORM_SRC_OS2 = $(PLATFORM_SRC:%/windows=%/os2)
|
---|
60 | endif
|
---|
61 |
|
---|
62 | ifeq ($(PLATFORM_SRC), $(PLATFORM_SRC_OS2))
|
---|
63 | $(error Both PLATFORM_SRC and PLATFORM_SRC_OS2 are '$(PLATFOROM_SRC)'!)
|
---|
64 | endif
|
---|
65 |
|
---|
66 | # Platform specific closed sources
|
---|
67 | ifndef OPENJDK
|
---|
68 | ifndef CLOSED_PLATFORM_SRC
|
---|
69 | CLOSED_PLATFORM_SRC = $(BUILDDIR)/../src/closed/os2
|
---|
70 | endif
|
---|
71 | endif
|
---|
72 |
|
---|
73 | # platform specific include files
|
---|
74 | PLATFORM_INCLUDE_NAME = os2
|
---|
75 | PLATFORM_INCLUDE = $(INCLUDEDIR)/$(PLATFORM_INCLUDE_NAME)
|
---|
76 |
|
---|
77 | # suffix used for make dependencies files.
|
---|
78 | DEPEND_SUFFIX = dep
|
---|
79 | # The suffix applied to the library name for FDLIBM
|
---|
80 | FDDLIBM_SUFFIX = lib
|
---|
81 | # The suffix applied to scripts (.bat for windows, nothing for unix)
|
---|
82 | SCRIPT_SUFFIX = cmd
|
---|
83 | # CC compiler object code output directive flag value
|
---|
84 | CC_OBJECT_OUTPUT_FLAG = -o #trailing blank required!
|
---|
85 | CC_PROGRAM_OUTPUT_FLAG = -o #trailing blank required!
|
---|
86 |
|
---|
87 | #
|
---|
88 | # Default HPI libraries. Build will build only native, unless
|
---|
89 | # overriden at the make command line. This makes it convenient for
|
---|
90 | # people doing, say, a pthreads port -- they can create a posix
|
---|
91 | # directory here, and say "gnumake HPIS=posix" at the top
|
---|
92 | # level.
|
---|
93 | #
|
---|
94 | HPIS = windows
|
---|
95 |
|
---|
96 | #
|
---|
97 | # Default optimization
|
---|
98 | #
|
---|
99 | CC_HIGHEST_OPT = -O3
|
---|
100 | CC_HIGHER_OPT = -O3
|
---|
101 | CC_LOWER_OPT = -O2
|
---|
102 | CC_NO_OPT =
|
---|
103 |
|
---|
104 | ifeq ($(PRODUCT), java)
|
---|
105 | _OPT = $(CC_HIGHER_OPT)
|
---|
106 | else
|
---|
107 | _OPT = $(CC_LOWER_OPT)
|
---|
108 | CPPFLAGS_DBG += -DLOGGING
|
---|
109 | endif
|
---|
110 |
|
---|
111 | # If NO_OPTIMIZATIONS is defined in the environment, turn all optimzations off
|
---|
112 | ifdef NO_OPTIMIZATIONS
|
---|
113 | CC_HIGHEST_OPT = $(CC_NO_OPT)
|
---|
114 | CC_HIGHER_OPT = $(CC_NO_OPT)
|
---|
115 | CC_LOWER_OPT = $(CC_NO_OPT)
|
---|
116 | endif
|
---|
117 |
|
---|
118 | #
|
---|
119 | # Selection of warning messages
|
---|
120 | #
|
---|
121 | GCC_INHIBIT = -Wno-unused -Wno-parentheses
|
---|
122 | GCC_STYLE =
|
---|
123 | GCC_WARNINGS = -W -Wall $(GCC_STYLE) $(GCC_INHIBIT)
|
---|
124 |
|
---|
125 | # We compile a lot of MSVC code which seems to silently tolerate this
|
---|
126 | GCC_WARNINGS += -Wno-sign-compare -Wno-type-limits -Wno-missing-field-initializers -Wno-missing-braces
|
---|
127 | GCC_WARNINGS_C += -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast
|
---|
128 | GCC_WARNINGS_CXX += -Wno-write-strings
|
---|
129 |
|
---|
130 | #
|
---|
131 | # Treat compiler warnings as errors, if warnings not allowed
|
---|
132 | #
|
---|
133 | ifeq ($(COMPILER_WARNINGS_FATAL),true)
|
---|
134 | GCC_WARNINGS += -Werror
|
---|
135 | endif
|
---|
136 |
|
---|
137 | #
|
---|
138 | # Misc compiler options
|
---|
139 | #
|
---|
140 | CFLAGS_COMMON = $(GCC_WARNINGS) $(GCC_WARNINGS_C) -march=i486 -mtune=generic -Zomf
|
---|
141 | CFLAGS_OPT = -s $(POPT)
|
---|
142 | CFLAGS_DBG = -g
|
---|
143 |
|
---|
144 | CXXFLAGS_COMMON = -DCC_NOEX $(GCC_WARNINGS) $(GCC_WARNINGS_CXX) -march=i486 -mtune=generic -Zomf
|
---|
145 | CXXFLAGS_OPT = $(CFLAGS_OPT)
|
---|
146 | CXXFLAGS_DBG = $(CFLAGS_DBG)
|
---|
147 |
|
---|
148 | # Some code uses very unstrict aliasing turn this optimization off
|
---|
149 | CFLAGS_COMMON += -fno-strict-aliasing
|
---|
150 | CXXFLAGS_COMMON += -fno-strict-aliasing
|
---|
151 |
|
---|
152 | #
|
---|
153 | # Preprocessor macro definitions
|
---|
154 | #
|
---|
155 | CPPFLAGS_COMMON = -D$(ARCH) -DARCH='"$(ARCH)"' -DOS2 -D_LITTLE_ENDIAN $(VERSION_DEFINES)
|
---|
156 | CPPFLAGS_OPT =
|
---|
157 | CPPFLAGS_DBG = -DDEBUG
|
---|
158 |
|
---|
159 | #
|
---|
160 | # Linker options
|
---|
161 | #
|
---|
162 | LDFLAGS_COMMON = -Zomf -Zmap -Zstack 0x2000 -Zhigh-mem -Zno-fork -Zno-unix
|
---|
163 | LDFLAGS_OPT = -s
|
---|
164 | LDFLAGS_DBG =
|
---|
165 |
|
---|
166 | ifeq ($(EMXOMFLD_TYPE), WLINK)
|
---|
167 | LDFLAGS_COMMON += -Zlinker "DISABLE 1121"
|
---|
168 | endif
|
---|
169 | ifeq ($(EMXOMFLD_TYPE), VAC308)
|
---|
170 | LDFLAGS_COMMON += -Zlinker /OPTFUNC
|
---|
171 | endif
|
---|
172 |
|
---|
173 | #
|
---|
174 | # Additional libraries needed by all targets
|
---|
175 | #
|
---|
176 |
|
---|
177 | CPPFLAGS_COMMON += -D__WIN32OS2__ -D__i386__ -DSTRICT -D_POSIX_SOURCE \
|
---|
178 | -D_POSIX_C_SOURCE=200112 -D_EMX_SOURCE -D_XOPEN_SOURCE=600 \
|
---|
179 | -D_SVID_SOURCE -DOS2EMX_PLAIN_CHAR
|
---|
180 | CPPFLAGS_COMMON += -I$(ODINSDK_HEADERS_PATH)/Win -I$(ODINSDK_HEADERS_PATH) \
|
---|
181 | -DWINE_LARGE_INTEGER
|
---|
182 |
|
---|
183 | LDFLAGS_OPT += -L$(ODINSDK_LIB_PATH)
|
---|
184 | LDFLAGS_DBG += -L$(firstword $(ODINSDK_DBGLIB_PATH) $(ODINSDK_LIB_PATH))
|
---|
185 | LDFLAGS_COMMON += -lkernel32.lib -luser32.lib -ladvapi32.lib \
|
---|
186 | -lminivcrt.lib -lntdll.lib -llibwrap.lib
|
---|
187 |
|
---|
188 | #
|
---|
189 | # Path and option to link against the VM, if you have to.
|
---|
190 | #
|
---|
191 | JVMLIB = $(LIBDIR)/jvm.lib
|
---|
192 | JAVALIB = $(LIBDIR)/java.lib
|
---|
193 |
|
---|
194 | LIBRARY_SUFFIX = dll
|
---|
195 | LIB_SUFFIX = lib
|
---|
196 |
|
---|
197 | # Settings for the JDI - Serviceability Agent binding.
|
---|
198 | HOTSPOT_SALIB_PATH = $(HOTSPOT_IMPORT_PATH)/jre/bin
|
---|
199 | SALIB_NAME = $(LIB_PREFIX)sawindbg.$(LIBRARY_SUFFIX)
|
---|
200 | SAMAP_NAME = $(LIB_PREFIX)sawindbg.map
|
---|
201 |
|
---|
202 | # SA is not supported so far.
|
---|
203 | INCLUDE_SA = false
|
---|
204 |
|
---|