VirtualBox

source: vbox/trunk/src/recompiler_new/Makefile.kmk@ 14463

Last change on this file since 14463 was 14447, checked in by vboxsync, 16 years ago

New REM compiles on Win/AMD64 (using wrapper yet), not tested if runs

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.8 KB
Line 
1# $Id: Makefile.kmk 14447 2008-11-21 09:58:22Z vboxsync $
2## @file
3# The Recompiler Sub-Makefile.
4#
5#
6# Copyright (C) 2006-2007 Sun Microsystems, Inc.
7#
8# This file is part of VirtualBox Open Source Edition (OSE), as
9# available from http://www.virtualbox.org. This file is free software;
10# you can redistribute it and/or modify it under the terms of the GNU
11# General Public License (GPL) as published by the Free Software
12# Foundation, in version 2 as it comes in the "COPYING" file of the
13# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
15#
16# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
17# Clara, CA 95054 USA or visit http://www.sun.com if you need
18# additional information or have any questions.
19#
20
21
22SUB_DEPTH = ../..
23include $(KBUILD_PATH)/subheader.kmk
24
25# For 64-bit Windows we currently use gcc (due to MSVC unaware of such a novel
26# thing as C99, a lot of GCC extensions deployed by QEMU
27# and calling convention differences) to cross-compile code to Linux/ELF
28# and generate invocation wrappers.
29if1of (win.amd64, $(KBUILD_TARGET).$(KBUILD_TARGET_ARCH))
30 REM_MOD += VBoxREM2
31 SYSMODS += VBoxREM2
32 DLLS += VBoxREM
33# IMPORT_LIBS += VBoxREMImp
34else
35 REM_MOD += VBoxREM
36 IMPORT_LIBS += VBoxREM
37endif
38
39ifeq ($(KBUILD_TARGET), win)
40 TEMPLATE_DUMMY = dummy template (move to kBuild)
41 $(REM_MOD)_TOOL.win.x86 = MINGW32
42 $(REM_MOD)_TOOL.win.amd64 = XGCCAMD64LINUX
43 $(REM_MOD)_TEMPLATE = DUMMY
44 $(REM_MOD)_SDKS.win.x86 = W32API
45 $(REM_MOD)_ASFLAGS = -x assembler-with-cpp
46 $(REM_MOD)_CFLAGS = -Wall -g
47 $(REM_MOD)_CFLAGS.debug = -O0
48 $(REM_MOD)_CFLAGS.release += -fomit-frame-pointer -fno-gcse -O2
49 $(REM_MOD)_CFLAGS.profile = $($(REM_MOD)_CFLAGS.release)
50 $(REM_MOD)_CFLAGS.kprofile = $($(REM_MOD)_CFLAGS.release)
51else
52 $(REM_MOD)_TEMPLATE = VBOXR3NP
53endif
54
55OTHER_CLEAN +=
56
57#
58# Globals
59#
60VBOX_PATH_RECOMPILER_SRC := $(PATH_SUB_CURRENT)
61
62# The VBoxREM.[dll|so|..] or VBoxREM2.rel.
63#
64$(REM_MOD)_DEFS = IN_REM_R3 REM_INCLUDE_CPU_H
65#$(REM_MOD)_DEFS += REM_PHYS_ADDR_IN_TLB
66#$(REM_MOD)_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.
67$(REM_MOD)_DEFS.linux = _GNU_SOURCE
68ifdef VBOX_SOLARIS_10
69 $(REM_MOD)_DEFS.solaris = HOST_SOLARIS=10
70else
71 $(REM_MOD)_DEFS.solaris = HOST_SOLARIS=11
72endif
73
74$(REM_MOD)_INCS = \
75 Sun \
76 target-i386 \
77 tcg \
78 fpu \
79 $(PATH_$(REM_MOD)) \
80 $(PATH_ROOT)/src/VBox/VMM \
81 .
82
83$(REM_MOD)_SOURCES = \
84 VBoxRecompiler.c \
85 cpu-exec.c \
86 exec.c \
87 translate-all.c \
88 host-utils.c \
89 cutils.c \
90 tcg/tcg.c \
91 tcg/tcg-dyngen.c \
92 tcg/tcg-runtime.c \
93 fpu/softfloat-native.c \
94 target-i386/op_helper.c \
95 target-i386/helper.c \
96 target-i386/translate.c
97
98ifeq ($(KBUILD_TARGET_ARCH),amd64)
99 $(REM_MOD)_DEFS += __x86_64__
100 $(REM_MOD)_INCS += tcg/x86_64
101else
102 $(REM_MOD)_DEFS += __i386__
103 $(REM_MOD)_INCS += tcg/i386
104endif
105
106$(REM_MOD)_SOURCES.debug += \
107 Sun/testmath.c
108$(REM_MOD)_SOURCES.win.x86 = $(REM_MOD).def
109ifneq ($(REM_MOD),VBoxREM2)
110 $(REM_MOD)_POST_CMDS = $(VBOX_SIGN_IMAGE_CMDS)
111endif
112
113ifeq ($(REM_MOD),VBoxREM2)
114#
115# The VBoxREM2 wrapper.
116#
117VBoxREM_TEMPLATE = VBOXR3
118VBoxREM_DEFS = IN_REM_R3 $(if $(VBOX_WITH_VMI),VBOX_WITH_VMI,)
119VBoxREM_SOURCES = \
120 VBoxREMWrapper.cpp \
121 VBoxREMWrapperA.asm
122VBoxREM_LIBS = \
123 $(LIB_VMM) \
124 $(LIB_RUNTIME)
125
126$(REM_MOD)_TEMPLATE = VBOXNOCRTGAS
127$(REM_MOD)_DEFS += LOG_USE_C99 $(ARCH_BITS_DEFS)
128$(REM_MOD)_CFLAGS.amd64 = -O2
129$(REM_MOD)_CFLAGS.debug = -O0
130
131# This doesn't fit in IPRT because it requires GAS and is LGPL.
132$(REM_MOD)_SOURCES += \
133 Sun/e_powl-$(KBUILD_TARGET_ARCH).S
134
135$(REM_MOD)_INCS += \
136 Sun/crt
137$(REM_MOD)_LIBS = \
138 $(PATH_LIB)/RuntimeR3NoCRTGCC$(VBOX_SUFF_LIB)
139$(REM_MOD)_SYSSUFF = .rel
140
141endif
142
143# gcc targets
144if1of ($(KBUILD_TARGET), linux darwin solaris)
145$(REM_MOD)_CFLAGS.debug = -O0
146$(REM_MOD)_CFLAGS.release += -fomit-frame-pointer -fno-gcse
147endif
148$(REM_MOD)_CFLAGS.profile = $($(REM_MOD)_CFLAGS.release)
149$(REM_MOD)_CFLAGS.kprofile = $($(REM_MOD)_CFLAGS.release)
150
151$(REM_MOD)_DEFS += IN_RING3 $(ARCH_BITS_DEFS)
152#$(REM_MOD)_DEFS += 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.
153
154$(REM_MOD)_LDFLAGS.darwin = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/$(REM_MOD).dylib -undefined dynamic_lookup
155$(REM_MOD)_LDFLAGS.l4 = -T$(L4_LIBDIR)/../main_rel.ld -nostdlib -Wl,--no-undefined
156$(REM_MOD)_LDFLAGS.linux = $(VBOX_LD_as_needed)
157$(REM_MOD)_LDFLAGS.os2 = -Zomf
158$(REM_MOD)_LDFLAGS.debug = -g
159$(REM_MOD)_LDFLAGS.solaris = -mimpure-text
160
161#$(REM_MOD)_LIBS = \
162 $(LIB_VMM) \
163 $(LIB_RUNTIME)
164
165
166
167if1of ($(KBUILD_TARGET), linux darwin solaris)
168# Extra flags for these source modules.
169target-i386/op-helper.c_CFLAGS.x86 = -O2 -fno-strict-aliasing -fno-gcse
170cpu-exec.c_CFLAGS.x86 = -O2 -fno-strict-aliasing -fno-gcse
171cpu-exec.c_CFLAGS.solaris.amd64 = -O2 -fno-strict-aliasing
172endif
173
174#
175# The math testcase as a standalone program for testing and debugging purposes.
176#
177## @todo This is a bit messy because of MINGW32.
178testmath_ASFLAGS.amd64 = -m amd64
179testmath_CFLAGS = -Wall -g
180testmath_CFLAGS.release = -O3
181testmath_LDFLAGS = -g
182testmath_DEFS = MATHTEST_STANDALONE
183testmath_SOURCES = Sun/testmath.c
184#testmath_SOURCES += $(PATH_LIB)/RuntimeR3NoCRTGCC$(VBOX_SUFF_LIB)
185
186
187include $(KBUILD_PATH)/subfooter.kmk
Note: See TracBrowser for help on using the repository browser.

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