1 | #
|
---|
2 | # Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.
|
---|
3 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
---|
4 | #
|
---|
5 | # This code is free software; you can redistribute it and/or modify it
|
---|
6 | # under the terms of the GNU General Public License version 2 only, as
|
---|
7 | # published by the Free Software Foundation.
|
---|
8 | #
|
---|
9 | # This code is distributed in the hope that it will be useful, but WITHOUT
|
---|
10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
---|
11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
---|
12 | # version 2 for more details (a copy is included in the LICENSE file that
|
---|
13 | # accompanied this code).
|
---|
14 | #
|
---|
15 | # You should have received a copy of the GNU General Public License version
|
---|
16 | # 2 along with this work; if not, write to the Free Software Foundation,
|
---|
17 | # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
---|
18 | #
|
---|
19 | # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
---|
20 | # CA 95054 USA or visit www.sun.com if you need additional information or
|
---|
21 | # have any questions.
|
---|
22 | #
|
---|
23 | #
|
---|
24 |
|
---|
25 | # Generic compiler settings
|
---|
26 | CC = gcc
|
---|
27 | CXX = g++
|
---|
28 |
|
---|
29 | CC_FLAGS = $(C_FLAGS) $(CPP_FLAGS)
|
---|
30 | CXX_FLAGS = $(C_FLAGS) $(CPP_FLAGS)
|
---|
31 |
|
---|
32 | C_FLAGS = -Zomf -march=i486 -mtune=generic
|
---|
33 |
|
---|
34 | # We compile a lot of MSVC code which seems to silently tolerate these
|
---|
35 | C_FLAGS += -Wno-sign-compare -Wno-write-strings
|
---|
36 |
|
---|
37 | CXX_FLAGS += -fno-rtti
|
---|
38 | CXX_FLAGS += -fno-exceptions
|
---|
39 | CXX_FLAGS += -fcheck-new
|
---|
40 |
|
---|
41 | # Based on BUILDARCH we add some flags and select the default compiler name
|
---|
42 | ifeq ($(BUILDARCH),i486)
|
---|
43 | CPP_FLAGS += -DIA32
|
---|
44 | endif
|
---|
45 |
|
---|
46 | # Hotspot uses very unstrict aliasing turn this optimization off
|
---|
47 | OPT_CFLAGS = -fno-strict-aliasing
|
---|
48 |
|
---|
49 | # Compile for space above time.
|
---|
50 | ifeq ($(Variant),kernel)
|
---|
51 | PRODUCT_OPT_OPTION = -s -Os $(OPT_CFLAGS)
|
---|
52 | FASTDEBUG_OPT_OPTION = -s -Os $(OPT_CFLAGS)
|
---|
53 | DEBUG_OPT_OPTION = -g
|
---|
54 | else
|
---|
55 | PRODUCT_OPT_OPTION = -s -O3 $(OPT_CFLAGS)
|
---|
56 | FASTDEBUG_OPT_OPTION = -s -O3 $(OPT_CFLAGS)
|
---|
57 | DEBUG_OPT_OPTION = -g
|
---|
58 | endif
|
---|
59 |
|
---|
60 | # If NO_OPTIMIZATIONS is defined in the environment, turn everything off
|
---|
61 | ifdef NO_OPTIMIZATIONS
|
---|
62 | PRODUCT_OPT_OPTION = $(DEBUG_OPT_OPTION)
|
---|
63 | FASTDEBUG_OPT_OPTION = $(DEBUG_OPT_OPTION)
|
---|
64 | endif
|
---|
65 |
|
---|
66 | # Used for platform dispatching. Note that on OS/2 we pretend to be 'windows'
|
---|
67 | # (it works in most cases and all differences are usually handled by
|
---|
68 | # TARGET_COMPILER_gcc).
|
---|
69 | CPP_FLAGS += -DTARGET_OS_FAMILY_windows
|
---|
70 | CPP_FLAGS += -DTARGET_ARCH_$(Platform_arch)
|
---|
71 | CPP_FLAGS += -DTARGET_ARCH_MODEL_$(Platform_arch_model)
|
---|
72 | CPP_FLAGS += -DTARGET_OS_ARCH_windows_$(Platform_arch)
|
---|
73 | CPP_FLAGS += -DTARGET_OS_ARCH_MODEL_windows_$(Platform_arch_model)
|
---|
74 | CPP_FLAGS += -DTARGET_COMPILER_gcc
|
---|
75 |
|
---|
76 | # Additional define for differences not covered by TARGET_COMPILER_gcc
|
---|
77 | CPP_FLAGS += -DTARGET_OS_FAMILY_os2
|
---|
78 |
|
---|
79 | # Generate dependencies
|
---|
80 | CPP_FLAGS += -MMD -MP -MF $(@:%=%.d)
|
---|
81 | SUFFIXES += .d
|
---|
82 |
|
---|
83 | # Generic linker settings
|
---|
84 | LINK = g++
|
---|
85 | LINK_FLAGS = \
|
---|
86 | -Zomf -Zmap -Zstack 0x2000 -Zhigh-mem -Zno-fork -Zno-unix
|
---|
87 |
|
---|
88 | ifeq ($(EMXOMFLD_TYPE), WLINK)
|
---|
89 | LINK_FLAGS += -Zlinker "DISABLE 1121"
|
---|
90 | endif
|
---|
91 | ifeq ($(EMXOMFLD_TYPE), VAC308)
|
---|
92 | LINK_FLAGS += -Zlinker /OPTFUNC
|
---|
93 | endif
|
---|
94 |
|
---|
95 | IMPLIB = emximp
|
---|
96 |
|
---|
97 | # Odin SDK
|
---|
98 |
|
---|
99 | CPP_FLAGS += -D__WIN32OS2__ -D__i386__ -DSTRICT -D_POSIX_SOURCE \
|
---|
100 | -D_POSIX_C_SOURCE=200112 -D_EMX_SOURCE -D_XOPEN_SOURCE=600 \
|
---|
101 | -D_SVID_SOURCE -DOS2EMX_PLAIN_CHAR
|
---|
102 | CPP_FLAGS += -I$(ALT_ODINSDK_HEADERS_PATH)/Win -I$(ALT_ODINSDK_HEADERS_PATH)
|
---|
103 |
|
---|
104 | PRODUCT_LINK_FLAGS += -s -L$(ALT_ODINSDK_LIB_PATH)
|
---|
105 | FASTDEBUG_LINK_FLAGS += -s -L$(firstword $(ALT_ODINSDK_DBGLIB_PATH) $(ALT_ODINSDK_LIB_PATH))
|
---|
106 | DEBUG_LINK_FLAGS += -g -L$(firstword $(ALT_ODINSDK_DBGLIB_PATH) $(ALT_ODINSDK_LIB_PATH))
|
---|
107 |
|
---|
108 | LINK_FLAGS += -lkernel32.lib -luser32.lib -lgdi32.lib -lwinspool.lib \
|
---|
109 | -lcomdlg32.lib -ladvapi32.lib -lshell32.lib -lole32.lib \
|
---|
110 | -loleaut32.lib -lWsock32.lib -lwinmm.lib -llibwrap.lib
|
---|