VirtualBox

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

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

fixed PATH_VBoxREMImp warning

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 7.1 KB
Line 
1# $Id: Makefile.kmk 14639 2008-11-26 13:28:50Z 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 += 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.
74$(REM_MOD)_DEFS.linux = _GNU_SOURCE
75ifdef VBOX_SOLARIS_10
76 $(REM_MOD)_DEFS.solaris = HOST_SOLARIS=10
77else
78 $(REM_MOD)_DEFS.solaris = HOST_SOLARIS=11
79endif
80
81$(REM_MOD)_INCS = \
82 Sun \
83 target-i386 \
84 tcg \
85 fpu \
86 $(PATH_$(REM_MOD)) \
87 $(PATH_ROOT)/src/VBox/VMM \
88 .
89
90$(REM_MOD)_SOURCES = \
91 VBoxRecompiler.c \
92 cpu-exec.c \
93 exec.c \
94 translate-all.c \
95 host-utils.c \
96 cutils.c \
97 tcg/tcg.c \
98 tcg/tcg-dyngen.c \
99 tcg/tcg-runtime.c \
100 fpu/softfloat-native.c \
101 target-i386/op_helper.c \
102 target-i386/helper.c \
103 target-i386/translate.c
104
105ifeq ($(KBUILD_TARGET_ARCH),amd64)
106 $(REM_MOD)_DEFS += __x86_64__
107 $(REM_MOD)_INCS += tcg/x86_64
108else
109 $(REM_MOD)_DEFS += __i386__
110 $(REM_MOD)_INCS += tcg/i386
111endif
112
113$(REM_MOD)_SOURCES.debug += \
114 Sun/testmath.c
115$(REM_MOD)_SOURCES.win.x86 = $(REM_MOD).def
116ifneq ($(REM_MOD),VBoxREM2)
117 $(REM_MOD)_POST_CMDS = $(VBOX_SIGN_IMAGE_CMDS)
118endif
119
120ifeq ($(REM_MOD),VBoxREM2)
121#
122# The VBoxREM2 wrapper.
123#
124VBoxREM_TEMPLATE = VBOXR3
125VBoxREM_DEFS = IN_REM_R3 $(if $(VBOX_WITH_VMI),VBOX_WITH_VMI,)
126VBoxREM_SOURCES = \
127 VBoxREMWrapper.cpp \
128 VBoxREMWrapperA.asm
129
130$(REM_MOD)_TEMPLATE = VBOXNOCRTGAS
131$(REM_MOD)_DEFS += LOG_USE_C99 $(ARCH_BITS_DEFS)
132
133# This doesn't fit in IPRT because it requires GAS and is LGPL.
134$(REM_MOD)_SOURCES += \
135 Sun/e_powl-$(KBUILD_TARGET_ARCH).S
136
137$(REM_MOD)_INCS += \
138 Sun/crt
139$(REM_MOD)_LIBS = \
140 $(PATH_LIB)/RuntimeR3NoCRTGCC$(VBOX_SUFF_LIB)
141$(REM_MOD)_SYSSUFF = .rel
142
143endif
144
145$(REM_MOD)_CFLAGS.profile = $($(REM_MOD)_CFLAGS.release)
146$(REM_MOD)_CFLAGS.kprofile = $($(REM_MOD)_CFLAGS.release)
147
148$(REM_MOD)_DEFS += IN_RING3 $(ARCH_BITS_DEFS)
149#$(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.
150
151$(REM_MOD)_LDFLAGS.darwin = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/$(REM_MOD).dylib -undefined dynamic_lookup
152$(REM_MOD)_LDFLAGS.l4 = -T$(L4_LIBDIR)/../main_rel.ld -nostdlib -Wl,--no-undefined
153$(REM_MOD)_LDFLAGS.linux = $(VBOX_LD_as_needed)
154$(REM_MOD)_LDFLAGS.os2 = -Zomf
155$(REM_MOD)_LDFLAGS.debug = -g
156$(REM_MOD)_LDFLAGS.solaris = -mimpure-text
157
158# Temporary hack, to allow running with oldish GCC
159$(REM_MOD)_DEFS.win.x86 += GCC_WITH_BUGGY_REGPARM
160
161
162ifdef USE_REM_IMP
163#
164# The VBoxREM import library.
165#
166# This is a HACK to get around (a) the cyclic dependency between VBoxVMM and
167# VBoxREM during linking and (b) the recursive build ordering which means VBoxREM
168# won't be built until after all the other DLLs.
169#
170VBoxREMImp_TEMPLATE = VBOXR3
171if1of ($(KBUILD_TARGET), os2 win)
172VBoxREMImp_INST = $(INST_LIB)
173else
174VBoxREMImp_NAME = VBoxREM
175VBoxREMImp_INST = $(INST_LIB)
176endif
177VBoxREMImp_SOURCES.win = VBoxREM.def
178VBoxREMImp_SOURCES.os2 = $(PATH_VBoxREMImp)/VBoxREMOS2.def
179ifeq ($(filter win os2,$(KBUILD_TARGET)),)
180VBoxREMImp_SOURCES = $(PATH_VBoxREMImp)/VBoxREMImp.c
181VBoxREMImp_CLEAN = $(PATH_VBoxREMImp)/VBoxREMImp.c
182endif
183ifneq ($(filter-out darwin os2 win,$(KBUILD_TARGET)),)
184VBoxREMImp_SONAME = VBoxREM$(SUFF_DLL)
185endif
186VBoxREMImp_LDFLAGS.darwin = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxREM.dylib
187VBoxREMImp_LDFLAGS.l4 = -T$(L4_LIBDIR)/../main_rel.ld -nostdlib
188
189$$(PATH_VBoxREMImp)/VBoxREMImp.c: $(VBOX_PATH_RECOMPILER_SRC)/VBoxREM.def $(VBOX_PATH_RECOMPILER_SRC)/Sun/deftoimp.sed $(MAKEFILE_CURRENT) | $$(dir $$@)
190 $(call MSG_GENERATE,,$@)
191 $(QUIET)$(APPEND) -t $@ '#ifdef VBOX_HAVE_VISIBILITY_HIDDEN'
192 $(QUIET)$(APPEND) $@ '# define EXPORT __attribute__((visibility("default")))'
193 $(QUIET)$(APPEND) $@ '#else'
194 $(QUIET)$(APPEND) $@ '# define EXPORT'
195 $(QUIET)$(APPEND) $@ '#endif'
196 $(QUIET)$(APPEND) $@ ''
197 $(QUIET)$(SED) -f $(VBOX_PATH_RECOMPILER_SRC)/Sun/deftoimp.sed --append $@ $<
198
199$$(PATH_VBoxREMImp)/VBoxREMOS2.def: $(VBOX_PATH_RECOMPILER_SRC)/VBoxREM.def $(MAKEFILE_CURRENT) | $$(dir $$@)
200 $(SED) \
201 -e 's/^[ \t][ \t]*REMR3/ _REMR3/' \
202 -e 's/\.[Dd][Ll][Ll]//' \
203 -e 's/^LIBRARY .*/LIBRARY VBoxREM INITINSTANCE TERMINSTANCE\nDATA MULTIPLE\n/' \
204 --output $@ \
205 $<
206endif
207
208#
209# The math testcase as a standalone program for testing and debugging purposes.
210#
211## @todo This is a bit messy because of MINGW32.
212testmath_ASFLAGS.amd64 = -m amd64
213testmath_CFLAGS = -Wall -g
214testmath_CFLAGS.release = -O3
215testmath_LDFLAGS = -g
216testmath_DEFS = MATHTEST_STANDALONE
217testmath_SOURCES = Sun/testmath.c
218#testmath_SOURCES += $(PATH_LIB)/RuntimeR3NoCRTGCC$(VBOX_SUFF_LIB)
219
220
221include $(KBUILD_PATH)/subfooter.kmk
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