VirtualBox

source: vbox/trunk/src/recompiler/Makefile.kmk@ 28991

Last change on this file since 28991 was 28991, checked in by vboxsync, 15 years ago

bugger

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 9.0 KB
Line 
1# $Id: Makefile.kmk 28991 2010-05-03 23:54:42Z vboxsync $
2## @file
3# The Recompiler Sub-Makefile.
4#
5
6#
7# Copyright (C) 2006-2010 Oracle Corporation
8#
9# This file is part of VirtualBox Open Source Edition (OSE), as
10# available from http://www.virtualbox.org. This file is free software;
11# you can redistribute it and/or modify it under the terms of the GNU
12# General Public License (GPL) as published by the Free Software
13# Foundation, in version 2 as it comes in the "COPYING" file of the
14# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16#
17
18
19SUB_DEPTH = ../..
20include $(KBUILD_PATH)/subheader.kmk
21
22ifn1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), darwin.x86)
23 include $(PATH_SUB_CURRENT)/Makefile-old.kmk
24else # new stuff
25
26#
27# Globals
28#
29VBOX_PATH_RECOMPILER_SRC := $(PATH_SUB_CURRENT)
30# Workaround for darwin hell.
31ifeq ($(KBUILD_TARGET),darwin)
32 VBOX_WITHOUT_REM_LDR_CYCLE := 1
33endif
34
35
36#
37# The primary REM module definition.
38#
39# This is extended by one of the VBoxREM* modules below. Currently, this
40# isn't done by inheritance because of some obscure bug wrt inherting from
41# unused targets that I'm not going to fix now.
42#
43ifneq ($(KBUILD_TARGET),win)
44 VBoxRemPrimary_TEMPLATE = VBOXR3NP
45 # workaround the regparm bug in gcc <= 3.3
46 VBoxRemPrimary_DEFS = $(if $(VBOX_GCC_BUGGY_REGPARM),GCC_WITH_BUGGY_REGPARM,)
47else
48 VBoxRemPrimary_TEMPLATE = DUMMY
49 VBoxRemPrimary_TOOL.win.x86 = MINGW32
50 VBoxRemPrimary_TOOL.win.amd64 = XGCCAMD64LINUX
51 VBoxRemPrimary_SDKS.win.x86 = W32API
52 VBoxRemPrimary_ASFLAGS = -x assembler-with-cpp
53 VBoxRemPrimary_CFLAGS = -Wall -g -fno-omit-frame-pointer -fno-strict-aliasing -Wno-shadow
54 VBoxRemPrimary_CFLAGS.debug = -O0
55 VBoxRemPrimary_CFLAGS.release += -fno-gcse -O2
56 VBoxRemPrimary_CFLAGS.profile = $(VBoxRemPrimary_CFLAGS.release)
57 VBoxRemPrimary_DEFS += IN_RING3 $(ARCH_BITS_DEFS)
58 # workaround the regparm bug in gcc <= 3.3
59 VBoxRemPrimary_DEFS.win.x86 += GCC_WITH_BUGGY_REGPARM
60endif # win
61VBoxRemPrimary_DEFS += IN_REM_R3 REM_INCLUDE_CPU_H
62#VBoxRemPrimary_DEFS += REM_PHYS_ADDR_IN_TLB
63#VBoxRemPrimary_DEFS += DEBUG_ALL_LOGGING DEBUG_DISAS DEBUG_PCALL DEBUG_EXEC DEBUG_FLUSH DEBUG_IOPORT DEBUG_SIGNAL DEBUG_TLB_CHECK DEBUG_TB_INVALIDATE DEBUG_TLB # Enables huge amounts of debug logging.
64#VBoxRemPrimary_DEFS += DEBUG_TMP_LOGGING # log qemu parts to "/tmp/vbox-qemu.log" - does not work with VBoxREM2.
65VBoxRemPrimary_DEFS.linux = _GNU_SOURCE
66ifdef VBOX_SOLARIS_10
67 VBoxRemPrimary_DEFS.solaris = HOST_SOLARIS=10
68else
69 VBoxRemPrimary_DEFS.solaris = HOST_SOLARIS=11
70endif
71VBoxRemPrimary_DEFS.freebsd += _BSD
72VBoxRemPrimary_DEFS.amd64 += __x86_64__
73VBoxRemPrimary_DEFS.x86 += __i386__
74
75VBoxRemPrimary_INCS = \
76 Sun \
77 target-i386 \
78 tcg \
79 fpu \
80 $(PATH_VBoxRemPrimary) \
81 $(PATH_ROOT)/src/VBox/VMM \
82 .
83VBoxRemPrimary_INCS.amd64 += tcg/x86_64
84VBoxRemPrimary_INCS.x86 += tcg/i386
85ifn1of ($(VBoxRemPrimary_DEFS),DEBUG_TMP_LOGGING)
86 VBoxRemPrimary_DEFS += LOG_USE_C99
87 VBoxRemPrimary_INCS <= \
88 Sun/crt
89endif
90
91VBoxRemPrimary_SOURCES = \
92 VBoxRecompiler.c \
93 cpu-exec.c \
94 exec.c \
95 translate-all.c \
96 host-utils.c \
97 cutils.c \
98 tcg/tcg.c \
99 tcg/tcg-dyngen.c \
100 tcg/tcg-runtime.c \
101 fpu/softfloat-native.c \
102 target-i386/op_helper.c \
103 target-i386/helper.c \
104 target-i386/translate.c
105VBoxRemPrimary_SOURCES.debug += \
106 Sun/testmath.c
107VBoxRemPrimary_SOURCES.win.x86 = $(PATH_VBoxREMImp)/VBoxREMWin.def
108
109VBoxRemPrimary_LIBS = \
110 $(LIB_VMM) \
111 $(LIB_RUNTIME)
112
113VBoxRemPrimary_LDFLAGS.solaris = -mimpure-text
114VBoxRemPrimary_POST_CMDS = $(VBOX_SIGN_IMAGE_CMDS)
115
116
117if "$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)" == "win.amd64"
118 #
119 # VBoxREM2/VBoxRemPrimary - Currently only used by 64-bit Windows.
120 # (e_powl-xxx.S doesn't fit in IPRT because it requires GAS and is LGPL.)
121 #
122 SYSMODS += VBoxRemPrimary
123 VBoxRemPrimary_TEMPLATE = VBOXNOCRTGAS
124 VBoxRemPrimary_NAME = VBoxREM2
125 VBoxRemPrimary_DEFS += LOG_USE_C99 $(ARCH_BITS_DEFS)
126 VBoxRemPrimary_SOURCES += \
127 Sun/e_powl-$(KBUILD_TARGET_ARCH).S
128 VBoxRemPrimary_INCS += \
129 Sun/crt
130 VBoxRemPrimary_SYSSUFF = .rel
131 VBoxRemPrimary_LIBS = \
132 $(PATH_LIB)/RuntimeR3NoCRTGCC$(VBOX_SUFF_LIB)
133 VBoxRemPrimary_POST_CMDS = $(NO_SUCH_VARIABLE)
134
135else if "$(KBUILD_TARGET_ARCH)" == "x86" && defined(VBOX_WITH_64_BITS_GUESTS)
136 #
137 # For 32-bit targets when enabled 64-bit guests we build 2 REM DLLs:
138 # with 64-bit support (slow and buggy at the moment) VBOXREM64
139 # only 32-bit support (faster, stable, but not suitable for 64-bit guests) VBOXREM32
140 # During the runtime, we load appropriate library from VBOXREM, depending on guest settings.
141 # 64-bit targets have 64-bit enabled REM by default, so is not part of this mess
142 #
143
144 #
145 # VBoxREM32/VBoxRemPrimary
146 #
147 DLLS += VBoxRemPrimary
148 VBoxRemPrimary_NAME = VBoxREM32
149 VBoxRemPrimary_LDFLAGS.darwin = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxREM32.dylib
150
151 #
152 # VBoxREM64
153 #
154 DLLS += VBoxREM64
155 VBoxREM64_EXTENDS = VBoxRemPrimary
156 VBoxREM64_EXTENDS_BY = appending
157 VBoxREM64_NAME = VBoxREM64
158 VBoxREM64_DEFS = VBOX_ENABLE_VBOXREM64
159 VBoxREM64_LDFLAGS.darwin = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxREM64.dylib
160
161## @todo else ifdef VBOX_WITHOUT_REM_LDR_CYCLE
162else
163 #
164 # VBoxREM/VBoxRemPrimary - Normal.
165 #
166 DLLS += VBoxRemPrimary
167 VBoxRemPrimary_NAME = VBoxREM
168 VBoxRemPrimary_LDFLAGS.darwin = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxREM.dylib
169endif
170
171
172ifn1of ($(DLLS),VBoxREM)
173 #
174 # VBoxREM - Wrapper for loading VBoxREM2, VBoxREM32 or VBoxREM64.
175 #
176 DLLS += VBoxREMWrapper
177 VBoxREMWrapper_TEMPLATE = VBOXR3
178 VBoxREMWrapper_NAME = VBoxREM
179 VBoxREMWrapper_DEFS = IN_REM_R3 $(if $(VBOX_WITH_VMI),VBOX_WITH_VMI,)
180 if "$(KBUILD_TARGET_ARCH)" == "x86" && defined(VBOX_WITH_64_BITS_GUESTS)
181 VBoxREMWrapper_DEFS += VBOX_USE_BITNESS_SELECTOR
182 endif
183 ifdef VBOX_WITHOUT_REM_LDR_CYCLE
184 VBoxREMWrapper_DEFS += VBOX_WITHOUT_REM_LDR_CYCLE
185 endif
186 VBoxREMWrapper_SOURCES = \
187 VBoxREMWrapper.cpp
188 if "$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)" == "win.amd64"
189 VBoxREMWrapper_SOURCES += \
190 VBoxREMWrapperA.asm
191 endif
192 VBoxREMWrapper_LIBS = \
193 $(LIB_RUNTIME)
194 ifndef VBOX_WITHOUT_REM_LDR_CYCLE
195 VBoxREMWrapper_LIBS += \
196 $(LIB_VMM)
197 VBoxREMWrapper_LIBS.darwin += \
198 $(TARGET_VBoxREMImp)
199 endif
200 VBoxREMWrapper_LDFLAGS.darwin = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxREM.dylib
201endif
202
203
204#
205# The VBoxREM import library.
206#
207# This is a HACK to get around (a) the cyclic dependency between VBoxVMM and
208# VBoxREM during linking and (b) the recursive build ordering which means VBoxREM
209# won't be built until after all the other DLLs.
210#
211IMPORT_LIBS += VBoxREMImp
212VBoxREMImp_TEMPLATE = VBOXR3
213 ifn1of ($(KBUILD_TARGET), os2 win)
214VBoxREMImp_NAME = VBoxREM
215 endif
216VBoxREMImp_INST = $(INST_LIB)
217VBoxREMImp_SOURCES.win = $(PATH_VBoxREMImp)/VBoxREMWin.def
218VBoxREMImp_CLEAN.win = $(PATH_VBoxREMImp)/VBoxREMWin.def
219VBoxREMImp_SOURCES.os2 = $(PATH_VBoxREMImp)/VBoxREMOS2.def
220VBoxREMImp_CLEAN.os2 = $(PATH_VBoxREMImp)/VBoxREMOS2.def
221 ifn1of ($(KBUILD_TARGET), os2 win)
222VBoxREMImp_SOURCES = $(PATH_VBoxREMImp)/VBoxREMImp.c
223VBoxREMImp_CLEAN = $(PATH_VBoxREMImp)/VBoxREMImp.c
224 endif
225 ifn1of ($(KBUILD_TARGET), darwin os2 win)
226VBoxREMImp_SONAME = VBoxREM$(SUFF_DLL)
227 endif
228ifdef VBOX_WITHOUT_REM_LDR_CYCLE
229 VBoxREMImp_LDFLAGS.darwin = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxREM.dylib
230else
231 VBoxREMImp_LDFLAGS.darwin = -install_name $(subst @rpath,@executable_path,$(VBOX_DYLD_EXECUTABLE_PATH))/VBoxREM.dylib
232endif
233VBoxREMImp_LDFLAGS.l4 = -T$(L4_LIBDIR)/../main_rel.ld -nostdlib
234
235$$(PATH_VBoxREMImp)/VBoxREMImp.c: $(VBOX_PATH_RECOMPILER_SRC)/VBoxREM.def $(VBOX_PATH_RECOMPILER_SRC)/Sun/deftoimp.sed $(MAKEFILE_CURRENT) | $$(dir $$@)
236 $(call MSG_GENERATE,,$@)
237 $(QUIET)$(APPEND) -t $@ '#ifdef VBOX_HAVE_VISIBILITY_HIDDEN'
238 $(QUIET)$(APPEND) $@ '# define EXPORT __attribute__((visibility("default")))'
239 $(QUIET)$(APPEND) $@ '#else'
240 $(QUIET)$(APPEND) $@ '# define EXPORT'
241 $(QUIET)$(APPEND) $@ '#endif'
242 $(QUIET)$(APPEND) $@ ''
243 $(QUIET)$(SED) -f $(VBOX_PATH_RECOMPILER_SRC)/Sun/deftoimp.sed --append $@ $<
244
245$$(PATH_VBoxREMImp)/VBoxREMOS2.def: $(VBOX_PATH_RECOMPILER_SRC)/VBoxREM.def $(MAKEFILE_CURRENT) | $$(dir $$@)
246 $(SED) \
247 -e 's/^[ \t][ \t]*REMR3/ _REMR3/' \
248 -e 's/\.[Dd][Ll][Ll]//' \
249 -e 's/^LIBRARY .*/LIBRARY VBoxREM INITINSTANCE TERMINSTANCE\nDATA MULTIPLE\n/' \
250 --output $@ \
251 $<
252
253$$(PATH_VBoxREMImp)/VBoxREMWin.def: $(VBOX_PATH_RECOMPILER_SRC)/VBoxREM.def $(MAKEFILE_CURRENT) | $$(dir $$@)
254 $(CP) -f $< $@
255
256
257#
258# The math testcase as a standalone program for testing and debugging purposes.
259#
260## @todo This is a bit messy because of MINGW32.
261testmath_ASFLAGS.amd64 = -m amd64
262testmath_CFLAGS = -Wall -g
263testmath_CFLAGS.release = -O3
264testmath_LDFLAGS = -g
265testmath_DEFS = MATHTEST_STANDALONE
266testmath_SOURCES = Sun/testmath.c
267
268
269endif # new stuff
270include $(KBUILD_PATH)/subfooter.kmk
271
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette