VirtualBox

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

Last change on this file since 4337 was 4071, checked in by vboxsync, 17 years ago

Biggest check-in ever. New source code headers for all (C) innotek files.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 16.4 KB
Line 
1# $Id: Makefile.kmk 4071 2007-08-07 17:07:59Z vboxsync $
2## @file
3# The Recompiler Makefile.
4#
5# There are a few of complicating factors here, esp. on AMD64 systems:
6#
7# * op.c doesn't compile work correctly with gcc 4. For this we've
8# checked in op.S, which is the reason why we don't compile op.c
9# directly but always compile via the assembly file.s
10# * On 64-bit Windows we lack a compiler and have to resort to a
11# linux cross compiler building an ELF relocatable module which
12# we then load using a wrapper module. Thus the REM_MOD mess.
13# * On platforms using the 64-bit GCC ABI, we're not allowed to
14# generate non-PIC shared objects, and op.c requires the code
15# to be non-PIC. We apply the same trick as we developed for
16# 64-bit windows.
17#
18
19#
20# Copyright (C) 2006-2007 innotek GmbH
21#
22# This file is part of VirtualBox Open Source Edition (OSE), as
23# available from http://www.virtualbox.org. This file is free software;
24# you can redistribute it and/or modify it under the terms of the GNU
25# General Public License as published by the Free Software Foundation,
26# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
27# distribution. VirtualBox OSE is distributed in the hope that it will
28# be useful, but WITHOUT ANY WARRANTY of any kind.
29
30
31DEPTH = ../..
32include $(PATH_KBUILD)/header.kmk
33
34
35# todo this is a BUILD_PLATFORM binary, to a target binary!
36BLDPROGS = dyngen
37ifeq ($(BUILD_TARGET_ARCH),amd64)
38 SYSMODS = VBoxREM2
39 REM_MOD = VBoxREM2
40else
41 REM_MOD = VBoxREM
42endif
43DLLS = VBoxREM
44IMPORT_LIBS = VBoxREMImp
45
46OTHER_CLEAN = \
47 $(PATH_$(REM_MOD))/op.h \
48 $(PATH_$(REM_MOD))/opc.h \
49 $(PATH_$(REM_MOD))/gen-op.h \
50 $(PATH_$(REM_MOD))/opc.h
51
52DEFS.amd64 += REM_PHYS_ADDR_IN_TLB
53
54#
55# L4 must use the no-crt path because it's lacking math stuff it seems...
56# Darwin must use the non-crt path because it can't compile op.c nativly.
57# All the AMD64 target must use the no-crt path because ELF doesn't like op.c
58# when stuffed into a shared library and windows doesn't have 64-bit gcc (yet).
59#
60ifeq ($(filter-out l4 darwin freebsd,$(BUILD_TARGET)),)
61 REM_USE_NOCRT := 1
62endif
63ifeq ($(BUILD_TARGET_ARCH),amd64)
64 REM_USE_NOCRT := 1
65endif
66
67#
68# We need to figure out the solaris version.
69#
70ifeq ($(BUILD_TARGET),solaris)
71 ifndef HOST_SOLARIS
72 HOST_SOLARIS = $(shell uname -r | cut -f2 -d.)
73 ifneq ($(HOST_SOLARIS),11)
74 $(error Solaris $(HOST_SOLARIS) not compatible. Check src/recompiler/fpu/softfloat-native.h for details)
75 endif
76 endif
77endif
78
79
80#
81# The dyngen build tool.
82#
83ifeq ($(BUILD_PLATFORM),win)
84 dyngen_TOOL = MINGW32
85 dyngen_SDKS = W32API
86 # On 64-bit Windows we pretend to be 32-bit.
87 dyngen_BLD_TRG_ARCH = x86
88 dyngen_BLD_TRG_CPU = i386
89 dyngen_CFLAGS = -Wall -g -fno-strict-aliasing
90else
91 dyngen_TEMPLATE = VBOXBLDPROG
92endif
93ifeq ($(BUILD_TARGET_ARCH),amd64)
94 dyngen_DEFS += HOST_X86_64=1
95endif
96dyngen_CFLAGS += -Wno-missing-prototypes -Wno-missing-declarations
97dyngen_INCS := \
98 InnoTek \
99 target-i386 \
100 fpu \
101 $(PATH_SUB_CURRENT)
102dyngen_SOURCES = dyngen.c
103
104
105#
106# The VBoxREM.[dll|so|..] or VBoxREM2.rel.
107#
108$(REM_MOD)_DEFS = IN_REM_R3 REM_INCLUDE_CPU_H
109#$(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.
110
111$(REM_MOD)_INCS = \
112 InnoTek \
113 InnoTek/crt\
114 target-i386 \
115 fpu \
116 $(PATH_$(REM_MOD)) \
117 $(PATH_ROOT)/src/VBox/VMM \
118 $(PATH_CURRENT)
119
120$(REM_MOD)_SOURCES = \
121 VBoxRecompiler.c \
122 cpu-exec.c \
123 exec.c \
124 translate-all.c \
125 translate-op.c \
126 fpu/softfloat-native.c \
127 target-i386/helper.c \
128 target-i386/helper2.c \
129 target-i386/translate.c
130$(REM_MOD)_SOURCES.debug = \
131 InnoTek/testmath.c
132ifeq ($(filter-out win os2,$(BUILD_TARGET)),)
133 $(REM_MOD)_SOURCES += target-i386/op.c
134 FILE_OP_OBJ = $(PATH_$(REM_MOD)_target-i386/op.c)/op.o
135else # The remaining targets can be using gcc-4 and needs checking.
136 $(REM_MOD)_SOURCES += $(PATH_$(REM_MOD))/op.S
137 FILE_OP_OBJ = $(PATH_$(REM_MOD)_$(PATH_$(REM_MOD))/op.S)/op.o
138 $(REM_MOD)_CLEAN = $(FILE_OP_OBJ) $(PATH_$(REM_MOD))/op.S.dep
139endif
140#$(REM_MOD)_SOURCES.os2 = $(PATH_TARGET)/$(REM_MOD).def
141$(REM_MOD)_SOURCES.win.x86 = $(REM_MOD).def
142ifneq ($(REM_MOD),VBoxREM2)
143 $(REM_MOD)_POST_CMDS = $(VBOX_SIGN_IMAGE_CMDS)
144endif
145
146
147ifdef REM_USE_NOCRT
148 $(REM_MOD)_TEMPLATE = VBOXNOCRTGAS
149 $(REM_MOD)_DEFS += LOG_USE_C99
150 $(REM_MOD)_CFLAGS.amd64 = -O2
151 $(REM_MOD)_CFLAGS.debug = -O0
152 $(REM_MOD)_CFLAGS.darwin = -fno-common -mdynamic-no-pic
153 ifdef ($(BUILD_TARGET_ARCH),x86)
154 $(REM_MOD)_CFLAGS.release+= -fomit-frame-pointer -fno-gcse
155 endif
156
157 # This doesn't fit in IPRT because it requires GAS and is LGPL.
158 $(REM_MOD)_SOURCES += \
159 InnoTek/e_powl-$(BUILD_TARGET_ARCH).S
160
161 ifeq ($(REM_MOD),VBoxREM)
162 $(REM_MOD)_LIBS = \
163 $(PATH_LIB)/RuntimeR3NoCRTGCC$(VBOX_SUFF_LIB) \
164 $(LIB_VMM) \
165 $(LIB_RUNTIME)
166 ifeq ($(BUILD_TARGET),l4)
167 $(REM_MOD)_LIBS += \
168 $(L4_LIBDIR)/libuc.0.s.so
169 endif
170 $(REM_MOD)_LIBS.darwin = \
171 $(TARGET_VBoxREMImp)
172# $(PATH_BIN)/VBoxREMImp.dylib
173 $(REM_MOD)_LDFLAGS.darwin = -read_only_relocs suppress -multiply_defined warning #-install_name @executable_path/$(REM_MOD).dylib#
174 else
175 $(REM_MOD)_LIBS = \
176 $(PATH_LIB)/RuntimeR3NoCRTGCC$(VBOX_SUFF_LIB)
177 $(REM_MOD)_SYSSUFF = .rel
178 endif
179
180else # !REM_USE_NOCRT
181
182 $(REM_MOD)_TOOL = GXX3
183 $(REM_MOD)_TOOL.win.x86 = MINGW32
184 $(REM_MOD)_TOOL.win.amd64 = XGCCAMD64LINUX
185 $(REM_MOD)_SDKS.win.x86 = W32API ## @todo do we really need this now?
186 $(REM_MOD)_ASFLAGS = -x assembler-with-cpp ## @todo didn't I make this default already?
187 $(REM_MOD)_CFLAGS = -Wall -g
188 $(REM_MOD)_CFLAGS.debug = -O0
189 $(REM_MOD)_CFLAGS.release += -fomit-frame-pointer -fno-gcse
190 $(REM_MOD)_CFLAGS.profile = $($(REM_MOD)_CFLAGS.release)
191 $(REM_MOD)_CFLAGS.kprofile = $($(REM_MOD)_CFLAGS.release)
192 $(REM_MOD)_CFLAGS.l4 = -nostdinc
193 ifeq ($(BUILD_TARGET),l4)
194 $(REM_MOD)_INCS += $(VBOX_L4_GCC3_INCS) $(L4_INCDIR)
195 endif
196
197 $(REM_MOD)_DEFS += IN_RING3 LOG_USE_C99
198 #$(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.
199 # these defines are probably all irrelevant now:
200 $(REM_MOD)_DEFS += _GNU_SOURCE _FILE_OFFSET_BITS=64 _LARGEFILE_SOURCE _REENTRANT
201
202 $(REM_MOD)_LDFLAGS.darwin = -read_only_relocs suppress -install_name @executable_path/$(REM_MOD).dylib -multiple_defined warning
203 $(REM_MOD)_LDFLAGS.l4 = -T$(L4_LIBDIR)/../main_rel.ld -nostdlib -Wl,--no-undefined
204 $(REM_MOD)_LDFLAGS.os2 = -Zomf
205 $(REM_MOD)_LDFLAGS.debug = -g
206 $(REM_MOD)_LDFLAGS.solaris = -mimpure-text
207 $(REM_MOD)_DEFS.solaris += HOST_SOLARIS=$(HOST_SOLARIS)
208 ifeq ($(BUILD_TARGET_ARCH),amd64)
209 $(REM_MOD)_LIBS = $(FILE_TOOL_GCC3_LIBGCC)
210 else # x86
211 $(REM_MOD)_LIBS = \
212 $(LIB_VMM) \
213 $(LIB_RUNTIME)
214 $(REM_MOD)_LIBS.win.x86 = \
215 mingw32 \
216 user32 gdi32 winmm ws2_32 iphlpapi dxguid
217 $(REM_MOD)_LIBS.linux = \
218 $(LIB_UUID) \
219 m \
220 util \
221 rt \
222 $(LIB_PTHREAD)
223 $(REM_MOD)_LIBS.l4 = \
224 gcc \
225 $(L4_LIBDIR)/libvboxserver.s.so \
226 $(L4_LIBDIR)/libdl.s.so \
227 $(L4_LIBDIR)/libuc.0.s.so
228 endif # x86
229
230endif # !REM_USE_NOCRT
231
232# Extra flags for these source modules.
233target-i386/op.c_CFLAGS = -O2 -fno-strict-aliasing -fomit-frame-pointer -falign-functions=0 -fno-reorder-blocks -fno-optimize-sibling-calls
234target-i386/op.c_CFLAGS.x86 = -fno-gcse -fno-instrument-functions -mpreferred-stack-boundary=2
235target-i386/op.c_CFLAGS.darwin.x86 = -m128bit-long-double -mpreferred-stack-boundary=4
236target-i386/helper.c_CFLAGS.x86 = -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-gcse
237cpu-exec.c_CFLAGS.x86 = -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-gcse
238
239
240#
241# The math testcase as a standalone program for testing and debugging purposes.
242#
243## @todo This is a bit messy because of MINGW32.
244#BLDPROGS += testmath
245testmath_TOOL = GXX3
246testmath_TOOL.win.x86 = MINGW32
247testmath_SDKS.win.x86 = W32API
248ifeq ($(BUILD_PLATFORM).$(BUILD_PLATFORM_ARCH),win.amd64)
249 # 64-bit windows: Pretend to be 32-bit.
250 testmath_BLD_TRG = win32
251 testmath_BLD_TRG_ARCH = x86
252 testmath_BLD_TRG_CPU = i386
253endif
254testmath_ASTOOL = $(VBOX_ASTOOL)
255ifeq ($(filter-out win32 win64,$(BUILD_PLATFORM)),)
256 testmath_ASFLAGS = -f win32 -DNASM_FORMAT_PE $(VBOX_ASFLAGS) -w+orphan-labels
257else
258 testmath_ASFLAGS = -f elf -DNASM_FORMAT_ELF $(VBOX_ASFLAGS) -w+orphan-labels
259endif
260testmath_ASFLAGS.amd64 = -m amd64
261testmath_CFLAGS = -Wall -g
262testmath_CFLAGS.release = -O3
263testmath_LDFLAGS = -g
264testmath_DEFS = MATHTEST_STANDALONE
265testmath_SOURCES = InnoTek/testmath.c
266#testmath_SOURCES += $(PATH_LIB)/RuntimeR3NoCRTGCC$(VBOX_SUFF_LIB)
267
268
269ifeq ($(BUILD_TARGET_ARCH),amd64)
270#
271# The VBoxREM2 wrapper.
272#
273VBoxREM_TEMPLATE = VBOXR3
274VBoxREM_DEFS = IN_REM_R3
275VBoxREM_SOURCES = \
276 VBoxREMWrapper.cpp \
277 VBoxREMWrapperA.asm
278VBoxREM_LDFLAGS.darwin = -install_name @executable_path/VBoxREM.dylib
279VBoxREM_LIBS = \
280 $(LIB_VMM) \
281 $(LIB_RUNTIME)
282endif
283
284
285#
286# The VBoxREM import library.
287#
288VBoxREMImp_TEMPLATE = VBOXR3
289ifeq ($(BUILD_TARGET),darwin)
290VBoxREMImp_INST = $(INST_LIB)
291endif
292VBoxREMImp_SOURCES.win = VBoxREM.def
293VBoxREMImp_SOURCES.os2 = $(PATH_TARGET)/VBoxREMOS2.def
294ifeq ($(filter win os2,$(BUILD_TARGET)),)
295VBoxREMImp_SOURCES = $(PATH_TARGET)/VBoxREMImp.c
296VBoxREMImp_CLEAN = $(PATH_TARGET)/VBoxREMImp.c
297endif
298VBoxREMImp_SONAME.linux = VBoxREM.so
299VBoxREMImp_SONAME.l4 = VBoxREM.s.so
300VBoxREMImp_LDFLAGS.darwin = -install_name @executable_path/VBoxREM.dylib
301#VBoxREMImp_LDFLAGS.darwin = -install_name VBoxREM.dylib
302VBoxREMImp_LDFLAGS.l4 = -T$(L4_LIBDIR)/../main_rel.ld -nostdlib
303
304$(PATH_TARGET)/VBoxREMImp.c: VBoxREM.def InnoTek/deftoimp.sed Makefile.kmk | $(call DIRDEP,$(PATH_TARGET))
305 $(call MSG_GENERATE,,$@)
306 $(QUIET)$(MKDIR) -p $(PATH_TARGET)
307 $(QUIET)$(APPEND) $@.tmp '#ifdef VBOX_HAVE_VISIBILITY_HIDDEN'
308 $(QUIET)$(APPEND) $@.tmp '# define EXPORT __attribute__((visibility("default")))'
309 $(QUIET)$(APPEND) $@.tmp '#else'
310 $(QUIET)$(APPEND) $@.tmp '# define EXPORT'
311 $(QUIET)$(APPEND) $@.tmp '#endif'
312 $(QUIET)$(APPEND) $@.tmp ''
313 $(QUIET)$(SED) -f InnoTek/deftoimp.sed VBoxREM.def >> $@.tmp
314 $(QUIET)$(MV) -f $@.tmp $@
315
316$(VBoxREMImp_SOURCES.os2): VBoxREM.def $(MAKEFILE) | $(call DIRDEP,$(PATH_TARGET))
317 $(SED) \
318 -e 's/^[ \t][ \t]*REMR3/ _REMR3/' \
319 -e 's/\.[Dd][Ll][Ll]//' \
320 -e 's/^LIBRARY .*/LIBRARY VBoxREM INITINSTANCE TERMINSTANCE\nDATA MULTIPLE\n/' \
321 VBoxREM.def > $@.tmp
322 $(MV) -f $@.tmp $@
323
324
325
326include $(PATH_KBUILD)/footer.kmk
327
328
329#
330# Generate the op.S file somehow...
331#
332# Gathering the flags, defines and include dirs for the command is a lot
333# of work. Unfortunately, there is only a highly specialized kBuild function
334# for doing this, so we're currently left to our own devices here.
335#
336# Add something like VBOX_RECOMPILER_OP_GCC = gcc-3.4.6 to LocalConfig.kmk
337# to be 100% sure that you get a working op.S. My gcc 4.1.1 seems to work
338# fine, so feel free to try VBOX_RECOMPILER_OP_GCC = gcc.
339#
340# The op-undefined.lst is generated by finding all the undefined symbols
341# in one (or more) ELF op.o files using nm.
342#
343ifndef VBOX_RECOMPILER_OP_GCC
344 ifeq ($(BUILD_TARGET).$(BUILD_TARGET_ARCH),darwin.x86)
345 VBOX_RECOMPILER_OP_GCC ?= i386-elf-gcc-3.4.3 # (port install i386-gcc-elf)
346 VBOX_RECOMPILER_OP_GCC_OK := yes
347 VBOX_RECOMPILER_OP_GCC_INCS ?= $(abspath $(dir $(shell LC_ALL=C $(VBOX_RECOMPILER_OP_GCC) -print-libgcc-file-name)))/include
348 endif
349 ifndef VBOX_RECOMPILER_OP_GCC
350 VBOX_RECOMPILER_OP_GCC := $(TOOL_$(VBOX_GCC_TOOL)_CC)
351 VBOX_RECOMPILER_OP_GCC_OK := dunno
352 endif
353else
354 # If set, assume it's an OK compiler.
355 VBOX_RECOMPILER_OP_GCC_OK := yes
356endif
357
358
359# The command sans -o op.S.tmp.
360COMPILE_OP_CMDS = $(VBOX_RECOMPILER_OP_GCC) \
361 -S -s \
362 $(filter-out -g -O0, \
363 $($(REM_MOD)_CFLAGS) $($(REM_MOD)_CFLAGS.$(BUILD_TYPE)) $($(REM_MOD)_CFLAGS.$(BUILD_TARGET)) $($(REM_MOD)_CFLAGS.$(BUILD_TARGET_ARCH)) $($(REM_MOD)_CFLAGS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) \
364 $(target-i386/op.c_CFLAGS) $(target-i386/op.c_CFLAGS.$(BUILD_TARGET)) $(target-i386/op.c_CFLAGS.$(BUILD_TARGET_ARCH)) $(target-i386/op.c_CFLAGS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) \
365 ) \
366 $(addprefix -I, \
367 $($(REM_MOD)_CINCS.$(BUILD_TARGET_ARCH)) $($(REM_MOD)_CINCS.$(BUILD_TARGET)) $($(REM_MOD)_CINCS) $(CINCS) \
368 $($(REM_MOD)_INCS.$(BUILD_TARGET_ARCH)) $($(REM_MOD)_INCS.$(BUILD_TARGET)) $($(REM_MOD)_INCS) $(INCS) \
369 ) \
370 $(addprefix -D, \
371 $($(REM_MOD)_CDEFS.$(BUILD_TARGET_ARCH)) $($(REM_MOD)_CDEFS.$(BUILD_TARGET)) $($(REM_MOD)_CDEFS) $(CDEFS.$(BUILD_TARGET)) $(CDEFS.$(BUILD_TARGET_ARCH)) $(CDEFS.$(BUILD_TYPE)) $(CDEFS) \
372 $($(REM_MOD)_DEFS.$(BUILD_TARGET_ARCH)) $($(REM_MOD)_DEFS.$(BUILD_TARGET)) $($(REM_MOD)_DEFS) $(DEFS.$(BUILD_TARGET)) $(DEFS.$(BUILD_TARGET_ARCH)) $(DEFS.$(BUILD_TYPE)) $(DEFS) \
373 ) \
374 -Wp,-MD,$(PATH_$(REM_MOD))/op.S.dep \
375 -Wp,-MT,$(PATH_$(REM_MOD))/op.S \
376 -Wp,-MP \
377 target-i386/op.c
378
379# Use the right GCC includes.
380ifdef VBOX_RECOMPILER_OP_GCC_INCS
381COMPILE_OP_CMDS := $(subst $(VBOX_PATH_GCC_INCS),$(VBOX_RECOMPILER_OP_GCC_INCS),$(COMPILE_OP_CMDS))
382endif
383
384# Drop incompatible options when using the cross-compiler on darwin.
385ifeq ($(BUILD_TARGET),darwin)
386 ifeq ($(filter-out i386-elf-gcc%, $(VBOX_RECOMPILER_OP_GCC)),)
387 COMPILE_OP_CMDS := $(filter-out -mdynamic-no-pic, $(COMPILE_OP_CMDS))
388 endif
389endif
390
391# include the dependencies
392-include $(PATH_$(REM_MOD))/op.S.dep
393
394# The rule.
395$(PATH_$(REM_MOD))/op.S: \
396 target-i386/op.c \
397 InnoTek/staged-op-elf-$(BUILD_TARGET_ARCH).S \
398 InnoTek/op-validate.sed \
399 InnoTek/op-darwin.sed \
400 InnoTek/op-undefined.lst \
401 Makefile.kmk \
402 $(comp-cmds COMPILE_OP_CMDS,COMPILE_OP_CMDS_PREV,FORCE) \
403 | $(call DIRDEP,$(PATH_$(REM_MOD)))
404 $(RM) -f $@ $@.tmp $@.tmp2 $@.dep
405ifeq ($(VBOX_RECOMPILER_OP_GCC_OK),yes)
406 $(call MSG_COMPILE,VBoxREM,$<,$@,AS)
407 $(addsuffix $(SP)\$(NL)$(TAB) ,$(COMPILE_OP_CMDS)) -o $@.tmp
408else ifeq ($(VBOX_RECOMPILER_OP_GCC_OK),dunno) # (permit 3.x.x and 4.1.x+ for now)
409 major_ver=`$(VBOX_RECOMPILER_OP_GCC) -dumpversion | $(SED) -e 's/^\([2-9]\)\..*$$/\1/'`; \
410 minor_ver=`$(VBOX_RECOMPILER_OP_GCC) -dumpversion | $(SED) -e 's/^[2-9]\.\([0-9]\)\..*$$/\1/'`; \
411 bugfix_ver=`$(VBOX_RECOMPILER_OP_GCC) -dumpversion | $(SED) -e 's/^[2-9]\.[0-9]\.\([0-9]\).*$$/\1/'`; \
412 if test "$$major_ver" = "3" -o "(" "$$major_ver" = "4" -a "$$minor_ver" != "0" ")"; then \
413 $(ECHO_EXT) "Compiling $< => $@ [gcc v$${major_ver}.$${minor_ver}.$${bugfix_ver}]" && \
414 $(addsuffix $(SP)\$(NL)$(TAB)$(TAB) ,$(COMPILE_OP_CMDS)) -o $@.tmp; \
415 else \
416 $(ECHO_EXT) "Using staged op.S [gcc v$${major_ver}.$${minor_ver}.$${bugfix_ver}]" && \
417 $(CP_EXT) -f InnoTek/staged-op-elf-$(BUILD_TARGET_ARCH).S $@.tmp; \
418 fi
419else
420 $(CP) InnoTek/staged-op-elf-$(BUILD_TARGET_ARCH).S $@.tmp
421endif
422 $(SED) -f InnoTek/op-validate.sed $@.tmp
423ifeq ($(BUILD_TARGET),darwin)
424 $(SED) -f InnoTek/op-darwin.sed $@.tmp > $@.tmp2
425 $(SED) -e 's/^\(.*\)$$/#define \1 _\1/' InnoTek/op-undefined.lst > $@.tmp
426 $(CAT_EXT) $@.tmp2 >> $@.tmp
427endif
428 $(MV) -f $@.tmp $@
429 $(QUIET2)$(APPEND) "$@.dep"
430 $(QUIET2)$(APPEND) "$@.dep" 'define COMPILE_OP_CMDS_PREV'
431 $(QUIET2)$(APPEND) "$@.dep" '$(subst $(NL),'$(NL)$(TAB)@$(APPEND) "$@.dep" ',$(COMPILE_OP_CMDS))'
432 $(QUIET2)$(APPEND) "$@.dep" 'endef'
433
434
435# Hack for crosscompiling.
436DYNGEN = $(PATH_dyngen)/dyngen$(HOSTSUFF_EXE)
437DYNGEN_EXEC = $(DYNGEN)
438ifneq ($(BUILD_PLATFORM),$(BUILD_TARGET)) # hack for crosscompiling.
439 ifeq ($(BUILD_TARGET),win)
440 DYNGEN = $(PATH_dyngen)/dyngen.exe
441 DYNGEN_EXEC := $(EXEC_X86_WIN32) $(DYNGEN_EXEC)
442 endif
443endif
444
445# The dyngen rules.
446$(PATH_$(REM_MOD))/op.h: $(FILE_OP_OBJ) $(DYNGEN)
447 $(call MSG_TOOL,dyngen,VBoxREM,$<,$@)
448 $(QUIET)$(DYNGEN_EXEC) -o $@ $<
449
450$(PATH_$(REM_MOD))/opc.h: $(FILE_OP_OBJ) $(DYNGEN)
451 $(call MSG_TOOL,dyngen,VBoxREM,$<,$@)
452 $(QUIET)$(DYNGEN_EXEC) -c -o $@ $<
453
454$(PATH_$(REM_MOD))/gen-op.h: $(FILE_OP_OBJ) $(DYNGEN)
455 $(call MSG_TOOL,dyngen,VBoxREM,$<,$@)
456 $(QUIET)$(DYNGEN_EXEC) -g -o $@ $<
457
458# Dyngen dependants (sp?).
459translate-all.c \
460translate-op.c \
461target-i386/translate.c \
462 : $(PATH_$(REM_MOD))/op.h $(PATH_$(REM_MOD))/opc.h $(PATH_$(REM_MOD))/gen-op.h
463
464
465# Some aliases
466do_dyngen: $(PATH_$(REM_MOD))/gen-op.h $(PATH_$(REM_MOD))/opc.h $(PATH_$(REM_MOD))/op.h
467importlib: $(LIB_REM)
468op.S: $(PATH_$(REM_MOD))/op.S
469
470
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