# $Id: Makefile.kmk 13370 2008-10-17 11:58:09Z vboxsync $ ## @file # The Recompiler Sub-Makefile. # # # Copyright (C) 2006-2007 Sun Microsystems, Inc. # # This file is part of VirtualBox Open Source Edition (OSE), as # available from http://www.virtualbox.org. This file is free software; # you can redistribute it and/or modify it under the terms of the GNU # General Public License (GPL) as published by the Free Software # Foundation, in version 2 as it comes in the "COPYING" file of the # VirtualBox OSE distribution. VirtualBox OSE is distributed in the # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. # # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa # Clara, CA 95054 USA or visit http://www.sun.com if you need # additional information or have any questions. # SUB_DEPTH = ../.. include $(KBUILD_PATH)/subheader.kmk REM_MOD += VBoxREM DLLS += VBoxREM IMPORT_LIBS += VBoxREMImp DEFS += VBOX_WITH_NEW_RECOMPILER $(REM_MOD)_TEMPLATE = VBOXR3NP OTHER_CLEAN += # # Globals # VBOX_PATH_RECOMPILER_SRC := $(PATH_SUB_CURRENT) # The VBoxREM.[dll|so|..] or VBoxREM2.rel. # $(REM_MOD)_DEFS = IN_REM_R3 REM_INCLUDE_CPU_H $(REM_MOD)_DEFS += REM_PHYS_ADDR_IN_TLB #$(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. $(REM_MOD)_DEFS.linux = _GNU_SOURCE ifdef VBOX_SOLARIS_10 $(REM_MOD)_DEFS.solaris = HOST_SOLARIS=10 else $(REM_MOD)_DEFS.solaris = HOST_SOLARIS=11 endif $(REM_MOD)_DEFS.solaris += $(REM_MOD)_INCS = \ Sun \ target-i386 \ tcg \ fpu \ $(PATH_$(REM_MOD)) \ $(PATH_ROOT)/src/VBox/VMM \ . $(REM_MOD)_SOURCES = \ VBoxRecompiler.c \ cpu-exec.c \ exec.c \ translate-all.c \ host-utils.c \ tcg/tcg.c \ tcg/tcg-dyngen.c \ tcg/tcg-runtime.c \ fpu/softfloat-native.c \ target-i386/op_helper.c \ target-i386/helper.c \ target-i386/translate.c ifeq ($(KBUILD_TARGET_ARCH),amd64) $(REM_MOD)_DEFS += __x86_64__ $(REM_MOD)_INCS += tcg/x86_64 else $(REM_MOD)_DEFS += __i386__ $(REM_MOD)_INCS += tcg/i386 endif $(REM_MOD)_SOURCES.debug = \ Sun/testmath.c $(REM_MOD)_SOURCES.win.x86 = $(REM_MOD).def ifneq ($(REM_MOD),VBoxREM2) $(REM_MOD)_POST_CMDS = $(VBOX_SIGN_IMAGE_CMDS) endif # gcc targets if1of ($(KBUILD_TARGET), linux darwin solaris) $(REM_MOD)_CFLAGS.debug = -O0 $(REM_MOD)_CFLAGS.release += -fomit-frame-pointer -fno-gcse endif $(REM_MOD)_CFLAGS.profile = $($(REM_MOD)_CFLAGS.release) $(REM_MOD)_CFLAGS.kprofile = $($(REM_MOD)_CFLAGS.release) $(REM_MOD)_DEFS += IN_RING3 $(ARCH_BITS_DEFS) #$(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. $(REM_MOD)_LDFLAGS.darwin = -read_only_relocs suppress -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/$(REM_MOD).dylib -multiple_defined warning $(REM_MOD)_LDFLAGS.l4 = -T$(L4_LIBDIR)/../main_rel.ld -nostdlib -Wl,--no-undefined $(REM_MOD)_LDFLAGS.linux = $(VBOX_LD_as_needed) $(REM_MOD)_LDFLAGS.os2 = -Zomf $(REM_MOD)_LDFLAGS.debug = -g $(REM_MOD)_LDFLAGS.solaris = -mimpure-text $(REM_MOD)_LIBS = \ $(LIB_VMM) \ $(LIB_RUNTIME) if1of ($(KBUILD_TARGET), linux darwin solaris) # Extra flags for these source modules. target-i386/op-helper.c_CFLAGS.x86 = -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-gcse cpu-exec.c_CFLAGS.x86 = -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-gcse cpu-exec.c_CFLAGS.solaris.amd64 = -O2 -fomit-frame-pointer -fno-strict-aliasing endif # # The math testcase as a standalone program for testing and debugging purposes. # ## @todo This is a bit messy because of MINGW32. testmath_ASFLAGS.amd64 = -m amd64 testmath_CFLAGS = -Wall -g testmath_CFLAGS.release = -O3 testmath_LDFLAGS = -g testmath_DEFS = MATHTEST_STANDALONE testmath_SOURCES = Sun/testmath.c #testmath_SOURCES += $(PATH_LIB)/RuntimeR3NoCRTGCC$(VBOX_SUFF_LIB) # # The VBoxREM import library. # VBoxREMImp_TEMPLATE = VBOXR3 ifeq ($(KBUILD_TARGET),darwin) VBoxREMImp_INST = $(INST_LIB) endif VBoxREMImp_SOURCES.win = VBoxREM.def VBoxREMImp_SOURCES.os2 = $(PATH_VBoxREMImp)/VBoxREMOS2.def ifeq ($(filter win os2,$(KBUILD_TARGET)),) VBoxREMImp_SOURCES = $(PATH_VBoxREMImp)/VBoxREMImp.c VBoxREMImp_CLEAN = $(PATH_VBoxREMImp)/VBoxREMImp.c endif ifneq ($(filter-out darwin os2 win,$(KBUILD_TARGET)),) VBoxREMImp_SONAME = VBoxREM$(SUFF_DLL) endif VBoxREMImp_LDFLAGS.darwin = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxREM.dylib VBoxREMImp_LDFLAGS.l4 = -T$(L4_LIBDIR)/../main_rel.ld -nostdlib $$(PATH_VBoxREMImp)/VBoxREMImp.c: $(VBOX_PATH_RECOMPILER_SRC)/VBoxREM.def $(VBOX_PATH_RECOMPILER_SRC)/Sun/deftoimp.sed $(MAKEFILE_CURRENT) | $$(dir $$@) $(call MSG_GENERATE,,$@) $(QUIET)$(APPEND) -t $@ '#ifdef VBOX_HAVE_VISIBILITY_HIDDEN' $(QUIET)$(APPEND) $@ '# define EXPORT __attribute__((visibility("default")))' $(QUIET)$(APPEND) $@ '#else' $(QUIET)$(APPEND) $@ '# define EXPORT' $(QUIET)$(APPEND) $@ '#endif' $(QUIET)$(APPEND) $@ '' $(QUIET)$(SED) -f $(VBOX_PATH_RECOMPILER_SRC)/Sun/deftoimp.sed --append $@ $< $$(PATH_VBoxREMImp)/VBoxREMOS2.def: $(VBOX_PATH_RECOMPILER_SRC)/VBoxREM.def $(MAKEFILE_CURRENT) | $$(dir $$@) $(SED) \ -e 's/^[ \t][ \t]*REMR3/ _REMR3/' \ -e 's/\.[Dd][Ll][Ll]//' \ -e 's/^LIBRARY .*/LIBRARY VBoxREM INITINSTANCE TERMINSTANCE\nDATA MULTIPLE\n/' \ --output $@ \ $< include $(KBUILD_PATH)/subfooter.kmk importlib: $(LIB_REM)