1 | # $Id: Makefile.kmk 13357 2008-10-16 21:16:27Z 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.alldomusa.eu.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 |
|
---|
22 | SUB_DEPTH = ../..
|
---|
23 | include $(KBUILD_PATH)/subheader.kmk
|
---|
24 |
|
---|
25 |
|
---|
26 | REM_MOD += VBoxREM
|
---|
27 | DLLS += VBoxREM
|
---|
28 | IMPORT_LIBS += VBoxREMImp
|
---|
29 |
|
---|
30 | DEFS += VBOX_WITH_NEW_RECOMPILER
|
---|
31 | $(REM_MOD)_TEMPLATE = VBOXR3NP
|
---|
32 |
|
---|
33 |
|
---|
34 | OTHER_CLEAN +=
|
---|
35 |
|
---|
36 | #
|
---|
37 | # Globals
|
---|
38 | #
|
---|
39 | VBOX_PATH_RECOMPILER_SRC := $(PATH_SUB_CURRENT)
|
---|
40 |
|
---|
41 | # The VBoxREM.[dll|so|..] or VBoxREM2.rel.
|
---|
42 | #
|
---|
43 | $(REM_MOD)_DEFS = IN_REM_R3 REM_INCLUDE_CPU_H
|
---|
44 | $(REM_MOD)_DEFS += REM_PHYS_ADDR_IN_TLB
|
---|
45 | #$(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.
|
---|
46 | $(REM_MOD)_DEFS.linux = _GNU_SOURCE
|
---|
47 |
|
---|
48 | $(REM_MOD)_INCS = \
|
---|
49 | Sun \
|
---|
50 | Sun/crt \
|
---|
51 | target-i386 \
|
---|
52 | tcg \
|
---|
53 | fpu \
|
---|
54 | $(PATH_$(REM_MOD)) \
|
---|
55 | $(PATH_ROOT)/src/VBox/VMM \
|
---|
56 | .
|
---|
57 |
|
---|
58 | $(REM_MOD)_SOURCES = \
|
---|
59 | VBoxRecompiler.c \
|
---|
60 | cpu-exec.c \
|
---|
61 | exec.c \
|
---|
62 | translate-all.c \
|
---|
63 | host-utils.c \
|
---|
64 | tcg/tcg.c \
|
---|
65 | tcg/tcg-dyngen.c \
|
---|
66 | tcg/tcg-runtime.c \
|
---|
67 | fpu/softfloat-native.c \
|
---|
68 | target-i386/op_helper.c \
|
---|
69 | target-i386/helper.c \
|
---|
70 | target-i386/translate.c
|
---|
71 |
|
---|
72 | ifeq ($(KBUILD_TARGET_ARCH),amd64)
|
---|
73 | $(REM_MOD)_INCS += tcg/x86_64
|
---|
74 | else
|
---|
75 | $(REM_MOD)_INCS += tcg/i386
|
---|
76 | endif
|
---|
77 |
|
---|
78 |
|
---|
79 | $(REM_MOD)_SOURCES.debug = \
|
---|
80 | Sun/testmath.c
|
---|
81 | $(REM_MOD)_SOURCES.win.x86 = $(REM_MOD).def
|
---|
82 | ifneq ($(REM_MOD),VBoxREM2)
|
---|
83 | $(REM_MOD)_POST_CMDS = $(VBOX_SIGN_IMAGE_CMDS)
|
---|
84 | endif
|
---|
85 |
|
---|
86 | $(REM_MOD)_CFLAGS.linux += -Wno-unused
|
---|
87 | $(REM_MOD)_CFLAGS.debug = -O0
|
---|
88 | $(REM_MOD)_CFLAGS.release += -fomit-frame-pointer -fno-gcse
|
---|
89 | $(REM_MOD)_CFLAGS.profile = $($(REM_MOD)_CFLAGS.release)
|
---|
90 | $(REM_MOD)_CFLAGS.kprofile = $($(REM_MOD)_CFLAGS.release)
|
---|
91 |
|
---|
92 | $(REM_MOD)_DEFS += IN_RING3 LOG_USE_C99 $(ARCH_BITS_DEFS)
|
---|
93 | #$(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.
|
---|
94 |
|
---|
95 | $(REM_MOD)_LDFLAGS.darwin = -read_only_relocs suppress -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/$(REM_MOD).dylib -multiple_defined warning
|
---|
96 | $(REM_MOD)_LDFLAGS.l4 = -T$(L4_LIBDIR)/../main_rel.ld -nostdlib -Wl,--no-undefined
|
---|
97 | $(REM_MOD)_LDFLAGS.linux = $(VBOX_LD_as_needed)
|
---|
98 | $(REM_MOD)_LDFLAGS.os2 = -Zomf
|
---|
99 | $(REM_MOD)_LDFLAGS.debug = -g
|
---|
100 | $(REM_MOD)_LDFLAGS.solaris = -mimpure-text
|
---|
101 |
|
---|
102 | $(REM_MOD)_LIBS = \
|
---|
103 | $(LIB_VMM) \
|
---|
104 | $(LIB_RUNTIME)
|
---|
105 |
|
---|
106 |
|
---|
107 | # Extra flags for these source modules.
|
---|
108 | target-i386/op-helper.c_CFLAGS.x86 = -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-gcse
|
---|
109 | cpu-exec.c_CFLAGS.x86 = -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-gcse
|
---|
110 | cpu-exec.c_CFLAGS.solaris.amd64 = -O2 -fomit-frame-pointer -fno-strict-aliasing
|
---|
111 |
|
---|
112 |
|
---|
113 | #
|
---|
114 | # The math testcase as a standalone program for testing and debugging purposes.
|
---|
115 | #
|
---|
116 | ## @todo This is a bit messy because of MINGW32.
|
---|
117 | testmath_ASFLAGS.amd64 = -m amd64
|
---|
118 | testmath_CFLAGS = -Wall -g
|
---|
119 | testmath_CFLAGS.release = -O3
|
---|
120 | testmath_LDFLAGS = -g
|
---|
121 | testmath_DEFS = MATHTEST_STANDALONE
|
---|
122 | testmath_SOURCES = Sun/testmath.c
|
---|
123 | #testmath_SOURCES += $(PATH_LIB)/RuntimeR3NoCRTGCC$(VBOX_SUFF_LIB)
|
---|
124 |
|
---|
125 |
|
---|
126 | #
|
---|
127 | # The VBoxREM import library.
|
---|
128 | #
|
---|
129 | VBoxREMImp_TEMPLATE = VBOXR3
|
---|
130 | ifeq ($(KBUILD_TARGET),darwin)
|
---|
131 | VBoxREMImp_INST = $(INST_LIB)
|
---|
132 | endif
|
---|
133 | VBoxREMImp_SOURCES.win = VBoxREM.def
|
---|
134 | VBoxREMImp_SOURCES.os2 = $(PATH_VBoxREMImp)/VBoxREMOS2.def
|
---|
135 | ifeq ($(filter win os2,$(KBUILD_TARGET)),)
|
---|
136 | VBoxREMImp_SOURCES = $(PATH_VBoxREMImp)/VBoxREMImp.c
|
---|
137 | VBoxREMImp_CLEAN = $(PATH_VBoxREMImp)/VBoxREMImp.c
|
---|
138 | endif
|
---|
139 | ifneq ($(filter-out darwin os2 win,$(KBUILD_TARGET)),)
|
---|
140 | VBoxREMImp_SONAME = VBoxREM$(SUFF_DLL)
|
---|
141 | endif
|
---|
142 | VBoxREMImp_LDFLAGS.darwin = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxREM.dylib
|
---|
143 | VBoxREMImp_LDFLAGS.l4 = -T$(L4_LIBDIR)/../main_rel.ld -nostdlib
|
---|
144 |
|
---|
145 | $$(PATH_VBoxREMImp)/VBoxREMImp.c: $(VBOX_PATH_RECOMPILER_SRC)/VBoxREM.def $(VBOX_PATH_RECOMPILER_SRC)/Sun/deftoimp.sed $(MAKEFILE_CURRENT) | $$(dir $$@)
|
---|
146 | $(call MSG_GENERATE,,$@)
|
---|
147 | $(QUIET)$(APPEND) -t $@ '#ifdef VBOX_HAVE_VISIBILITY_HIDDEN'
|
---|
148 | $(QUIET)$(APPEND) $@ '# define EXPORT __attribute__((visibility("default")))'
|
---|
149 | $(QUIET)$(APPEND) $@ '#else'
|
---|
150 | $(QUIET)$(APPEND) $@ '# define EXPORT'
|
---|
151 | $(QUIET)$(APPEND) $@ '#endif'
|
---|
152 | $(QUIET)$(APPEND) $@ ''
|
---|
153 | $(QUIET)$(SED) -f $(VBOX_PATH_RECOMPILER_SRC)/Sun/deftoimp.sed --append $@ $<
|
---|
154 |
|
---|
155 | $$(PATH_VBoxREMImp)/VBoxREMOS2.def: $(VBOX_PATH_RECOMPILER_SRC)/VBoxREM.def $(MAKEFILE_CURRENT) | $$(dir $$@)
|
---|
156 | $(SED) \
|
---|
157 | -e 's/^[ \t][ \t]*REMR3/ _REMR3/' \
|
---|
158 | -e 's/\.[Dd][Ll][Ll]//' \
|
---|
159 | -e 's/^LIBRARY .*/LIBRARY VBoxREM INITINSTANCE TERMINSTANCE\nDATA MULTIPLE\n/' \
|
---|
160 | --output $@ \
|
---|
161 | $<
|
---|
162 |
|
---|
163 | include $(KBUILD_PATH)/subfooter.kmk
|
---|
164 |
|
---|
165 | importlib: $(LIB_REM)
|
---|