VirtualBox

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

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

src/recompiler_new/Makefile.kmk: VBOX_WITH_NEW_RECOMPILER

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 7.3 KB
Line 
1# $Id: Makefile.kmk 14834 2008-11-30 11:26:52Z 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 and calling convention
27# differences) to cross-compile code to Linux/ELF and dynamically generate invocation wrappers.
28if1of (win.amd64, $(KBUILD_TARGET).$(KBUILD_TARGET_ARCH))
29 REM_MOD += VBoxREM2
30 SYSMODS += VBoxREM2
31else
32 REM_MOD += VBoxREM
33endif
34
35ifeq ($(KBUILD_TARGET), win)
36 TEMPLATE_DUMMY = dummy template (move to kBuild)
37 $(REM_MOD)_TOOL.win.x86 = MINGW32
38 $(REM_MOD)_TOOL.win.amd64 = XGCCAMD64LINUX
39 $(REM_MOD)_TEMPLATE = DUMMY
40 $(REM_MOD)_SDKS.win.x86 = W32API
41 $(REM_MOD)_ASFLAGS = -x assembler-with-cpp
42 $(REM_MOD)_CFLAGS = -Wall -g
43 $(REM_MOD)_CFLAGS.debug = -O0
44 $(REM_MOD)_CFLAGS.release += -fno-gcse -O2
45 $(REM_MOD)_CFLAGS.profile = $($(REM_MOD)_CFLAGS.release)
46 $(REM_MOD)_CFLAGS.kprofile = $($(REM_MOD)_CFLAGS.release)
47
48 IMPORT_LIBS += VBoxREMImp
49 DLLS += VBoxREM
50
51 VBoxREM_LIBS = \
52 $(LIB_VMM) \
53 $(LIB_RUNTIME)
54
55 USE_REM_IMP = 1
56else
57 $(REM_MOD)_TEMPLATE = VBOXR3NP
58
59 IMPORT_LIBS += VBoxREM
60endif
61
62OTHER_CLEAN +=
63
64#
65# Globals
66#
67VBOX_PATH_RECOMPILER_SRC := $(PATH_SUB_CURRENT)
68
69# The VBoxREM.[dll|so|..] or VBoxREM2.rel.
70#
71$(REM_MOD)_DEFS = IN_REM_R3 REM_INCLUDE_CPU_H
72$(REM_MOD)_DEFS += REM_PHYS_ADDR_IN_TLB
73$(REM_MOD)_DEFS += VBOX_WITH_NEW_RECOMPILER
74#$(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.
75$(REM_MOD)_DEFS.linux = _GNU_SOURCE
76ifdef VBOX_SOLARIS_10
77 $(REM_MOD)_DEFS.solaris = HOST_SOLARIS=10
78else
79 $(REM_MOD)_DEFS.solaris = HOST_SOLARIS=11
80endif
81
82$(REM_MOD)_INCS = \
83 Sun \
84 target-i386 \
85 tcg \
86 fpu \
87 $(PATH_$(REM_MOD)) \
88 $(PATH_ROOT)/src/VBox/VMM \
89 .
90
91$(REM_MOD)_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
105
106ifeq ($(KBUILD_TARGET_ARCH),amd64)
107 $(REM_MOD)_DEFS += __x86_64__
108 $(REM_MOD)_INCS += tcg/x86_64
109else
110 $(REM_MOD)_DEFS += __i386__
111 $(REM_MOD)_INCS += tcg/i386
112endif
113
114$(REM_MOD)_SOURCES.debug += \
115 Sun/testmath.c
116$(REM_MOD)_SOURCES.win.x86 = $(REM_MOD).def
117ifneq ($(REM_MOD),VBoxREM2)
118 $(REM_MOD)_POST_CMDS = $(VBOX_SIGN_IMAGE_CMDS)
119endif
120
121ifeq ($(REM_MOD),VBoxREM2)
122#
123# The VBoxREM2 wrapper.
124#
125VBoxREM_TEMPLATE = VBOXR3
126VBoxREM_DEFS = IN_REM_R3 $(if $(VBOX_WITH_VMI),VBOX_WITH_VMI,)
127VBoxREM_DEFS += VBOX_WITH_NEW_RECOMPILER
128VBoxREM_SOURCES = \
129 VBoxREMWrapper.cpp \
130 VBoxREMWrapperA.asm
131
132$(REM_MOD)_TEMPLATE = VBOXNOCRTGAS
133$(REM_MOD)_DEFS += LOG_USE_C99 $(ARCH_BITS_DEFS)
134
135# This doesn't fit in IPRT because it requires GAS and is LGPL.
136$(REM_MOD)_SOURCES += \
137 Sun/e_powl-$(KBUILD_TARGET_ARCH).S
138
139$(REM_MOD)_INCS += \
140 Sun/crt
141$(REM_MOD)_LIBS = \
142 $(PATH_LIB)/RuntimeR3NoCRTGCC$(VBOX_SUFF_LIB)
143$(REM_MOD)_SYSSUFF = .rel
144
145endif
146
147$(REM_MOD)_CFLAGS.profile = $($(REM_MOD)_CFLAGS.release)
148$(REM_MOD)_CFLAGS.kprofile = $($(REM_MOD)_CFLAGS.release)
149
150$(REM_MOD)_DEFS += IN_RING3 $(ARCH_BITS_DEFS)
151#$(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.
152
153$(REM_MOD)_LDFLAGS.darwin = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/$(REM_MOD).dylib -undefined dynamic_lookup
154$(REM_MOD)_LDFLAGS.l4 = -T$(L4_LIBDIR)/../main_rel.ld -nostdlib -Wl,--no-undefined
155$(REM_MOD)_LDFLAGS.linux = $(VBOX_LD_as_needed)
156$(REM_MOD)_LDFLAGS.os2 = -Zomf
157$(REM_MOD)_LDFLAGS.debug = -g
158$(REM_MOD)_LDFLAGS.solaris = -mimpure-text
159
160# Temporary hack, to allow running with oldish GCC
161$(REM_MOD)_DEFS.win.x86 += GCC_WITH_BUGGY_REGPARM
162
163
164ifdef USE_REM_IMP
165#
166# The VBoxREM import library.
167#
168# This is a HACK to get around (a) the cyclic dependency between VBoxVMM and
169# VBoxREM during linking and (b) the recursive build ordering which means VBoxREM
170# won't be built until after all the other DLLs.
171#
172VBoxREMImp_TEMPLATE = VBOXR3
173 if1of ($(KBUILD_TARGET), os2 win)
174VBoxREMImp_INST = $(INST_LIB)
175 else
176VBoxREMImp_NAME = VBoxREM
177VBoxREMImp_INST = $(INST_LIB)
178 endif
179VBoxREMImp_SOURCES.win = VBoxREM.def
180VBoxREMImp_SOURCES.os2 = $(PATH_VBoxREMImp)/VBoxREMOS2.def
181 ifeq ($(filter win os2,$(KBUILD_TARGET)),)
182VBoxREMImp_SOURCES = $(PATH_VBoxREMImp)/VBoxREMImp.c
183VBoxREMImp_CLEAN = $(PATH_VBoxREMImp)/VBoxREMImp.c
184 endif
185 ifneq ($(filter-out darwin os2 win,$(KBUILD_TARGET)),)
186VBoxREMImp_SONAME = VBoxREM$(SUFF_DLL)
187 endif
188VBoxREMImp_LDFLAGS.darwin = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxREM.dylib
189VBoxREMImp_LDFLAGS.l4 = -T$(L4_LIBDIR)/../main_rel.ld -nostdlib
190
191$$(PATH_VBoxREMImp)/VBoxREMImp.c: $(VBOX_PATH_RECOMPILER_SRC)/VBoxREM.def $(VBOX_PATH_RECOMPILER_SRC)/Sun/deftoimp.sed $(MAKEFILE_CURRENT) | $$(dir $$@)
192 $(call MSG_GENERATE,,$@)
193 $(QUIET)$(APPEND) -t $@ '#ifdef VBOX_HAVE_VISIBILITY_HIDDEN'
194 $(QUIET)$(APPEND) $@ '# define EXPORT __attribute__((visibility("default")))'
195 $(QUIET)$(APPEND) $@ '#else'
196 $(QUIET)$(APPEND) $@ '# define EXPORT'
197 $(QUIET)$(APPEND) $@ '#endif'
198 $(QUIET)$(APPEND) $@ ''
199 $(QUIET)$(SED) -f $(VBOX_PATH_RECOMPILER_SRC)/Sun/deftoimp.sed --append $@ $<
200
201$$(PATH_VBoxREMImp)/VBoxREMOS2.def: $(VBOX_PATH_RECOMPILER_SRC)/VBoxREM.def $(MAKEFILE_CURRENT) | $$(dir $$@)
202 $(SED) \
203 -e 's/^[ \t][ \t]*REMR3/ _REMR3/' \
204 -e 's/\.[Dd][Ll][Ll]//' \
205 -e 's/^LIBRARY .*/LIBRARY VBoxREM INITINSTANCE TERMINSTANCE\nDATA MULTIPLE\n/' \
206 --output $@ \
207 $<
208endif # USE_REM_IMP
209
210#
211# The math testcase as a standalone program for testing and debugging purposes.
212#
213## @todo This is a bit messy because of MINGW32.
214testmath_ASFLAGS.amd64 = -m amd64
215testmath_CFLAGS = -Wall -g
216testmath_CFLAGS.release = -O3
217testmath_LDFLAGS = -g
218testmath_DEFS = MATHTEST_STANDALONE
219testmath_DEFS += VBOX_WITH_NEW_RECOMPILER
220testmath_SOURCES = Sun/testmath.c
221#testmath_SOURCES += $(PATH_LIB)/RuntimeR3NoCRTGCC$(VBOX_SUFF_LIB)
222
223
224include $(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