Makefile.kmk revision 8a5e0b7c43d7ee861689984edc2abd86b9ed4456
# $Id$
## @file
# Sub-Makefile for the VirtualBox HGCM Service.
#
#
# Copyright (C) 2008 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
#
# Target lists.
#
DLLS += VBoxSharedCrOpenGL VBoxOGLrenderspu
LIBRARIES += VBoxOGLcrserverlib VBoxOGLcrunpacker
BLDDIRS += \
$(VBOX_PATH_CROGL_GENFILES)/
ifeq ($(KBUILD_TARGET),darwin)
#
# We have to symlink the system headers of OpenGl cause they have some
# different directory hierarchy on Mac OS X (no /GL sub directory).
#
# See Config.kmk for the global variables.
#
INSTALLS += DarwinOpenGLHdrs
DarwinOpenGLHdrs_INST = $(VBOX_DARWIN_OPENGL_INST)
DarwinOpenGLHdrs_SYMLINKS = \
$(foreach hdr, $(VBOX_DARWIN_OPENGL_HEADERS),\
$(hdr)=>$(VBOX_PATH_MACOSX_SDK)/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers/$(hdr))
endif # darwin
#
# VBoxSharedCrOpenGL
#
VBoxSharedCrOpenGL_TEMPLATE = VBOXCROGLR3HOSTDLL
ifdef VBOX_WITH_XPCOM
VBoxSharedCrOpenGL_DEFS = VBOX_WITH_XPCOM
endif
VBoxSharedCrOpenGL_INTERMEDIATES = \
$(TEMPLATE_VBOXMAINEXE_INTERMEDIATES)
$(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_INC) \
$(VBOX_PATH_SDK)/bindings/mscom/include \
$(PATH_VBoxCOM)
VBoxSharedCrOpenGL_INCS = \
. \
$(PATH_VBoxSVC)
ifdef VBOX_WITH_XPCOM
VBoxSharedCrOpenGL_INCS += \
$(VBOX_XPCOM_INCS)
endif
VBoxSharedCrOpenGL_SOURCES = \
VBoxSharedCrOpenGL_LDFLAGS.darwin = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxSharedCrOpenGL.dylib
VBoxSharedCrOpenGL_LIBS = \
$(PATH_LIB)/VBoxOGLcrserverlib$(VBOX_SUFF_LIB) \
$(PATH_LIB)/VBoxOGLhostcrstate$(VBOX_SUFF_LIB) \
$(PATH_LIB)/VBoxOGLcrunpacker$(VBOX_SUFF_LIB) \
$(PATH_LIB)/VBoxOGLhostcrpacker$(VBOX_SUFF_LIB) \
$(PATH_LIB)/VBoxOGLhostspuload$(VBOX_SUFF_LIB) \
$(VBOX_LIB_OGL_HOSTCRUTIL) \
$(LIB_RUNTIME) \
$(LIB_VMM)
$(LIB_REM)
ifeq ($(KBUILD_TARGET),win)
VBoxSharedCrOpenGL_LIBS += \
$(PATH_OBJ)/VBoxOGLrenderspu/VBoxOGLrenderspu$(VBOX_SUFF_LIB) \
$(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_LIB)/atls$(VBOX_SUFF_LIB)
else
VBoxSharedCrOpenGL_LIBS += \
$(PATH_BIN)/VBoxOGLrenderspu$(VBOX_SUFF_DLL)
endif
#
# VBoxOGLcrserverlib
#
VBoxOGLcrserverlib_TEMPLATE = VBOXCROGLR3HOSTLIB
VBoxOGLcrserverlib_INCS = \
crserverlib
VBoxOGLcrserverlib_INTERMEDIATES = \
$(VBOX_PATH_CROGL_GENFILES)/spu_dispatch_table.h \
$(VBOX_PATH_CROGL_GENFILES)/server_dispatch.h \
$(VBOX_PATH_CROGL_GENFILES)/state/cr_currentpointers.h \
$(VBOX_PATH_CROGL_GENFILES)/state/cr_statefuncs.h
VBoxOGLcrserverlib_SOURCES := \
$(VBOX_PATH_CROGL_GENFILES)/server_dispatch.c \
$(VBOX_PATH_CROGL_GENFILES)/server_retval.c \
$(VBOX_PATH_CROGL_GENFILES)/server_get.c \
$(VBOX_PATH_CROGL_GENFILES)/server_simpleget.c
VBoxOGLcrserverlib_CLEAN = \
$(VBOX_PATH_CROGL_GENFILES)/server_dispatch.c \
$(VBOX_PATH_CROGL_GENFILES)/server_retval.c \
$(VBOX_PATH_CROGL_GENFILES)/server_get.c \
$(VBOX_PATH_CROGL_GENFILES)/server_simpleget.c \
$(VBOX_PATH_CROGL_GENFILES)/server_dispatch.h
#
# Generate files for VBoxOGLcrserverlib
#
$(VBOX_PATH_CROGL_GENFILES)/server_dispatch.h: $(addprefix $(PATH_SUB_CURRENT)/crserverlib/, server_dispatch_header.py server_special) $(VBOX_CROGL_API_FILES) | $$(dir $$@)
$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $< $(VBOX_PATH_CROGL_GLAPI) $(<D)
$(VBOX_PATH_CROGL_GENFILES)/server_dispatch.c: $(addprefix $(PATH_SUB_CURRENT)/crserverlib/, server_dispatch.py server_special) $(VBOX_CROGL_API_FILES) | $$(dir $$@)
$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $< $(VBOX_PATH_CROGL_GLAPI) $(<D)
$(VBOX_PATH_CROGL_GENFILES)/server_retval.c: $(addprefix $(PATH_SUB_CURRENT)/crserverlib/, server_retval.py server_special) $(VBOX_CROGL_API_FILES) | $$(dir $$@)
$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $< $(VBOX_PATH_CROGL_GLAPI) $(<D)
$(VBOX_PATH_CROGL_GENFILES)/server_get.c: $(addprefix $(PATH_SUB_CURRENT)/crserverlib/, server_get.py server_special get_components.py) $(VBOX_CROGL_API_FILES) | $$(dir $$@)
$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $< $(VBOX_PATH_CROGL_GLAPI) $(<D)
$(VBOX_PATH_CROGL_GENFILES)/server_simpleget.c: $(addprefix $(PATH_SUB_CURRENT)/crserverlib/, server_simpleget.py get_sizes.py) $(VBOX_CROGL_API_FILES) | $$(dir $$@)
$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $< $(VBOX_PATH_CROGL_GLAPI) $(<D)
#
# VBoxOGLcrunpacker
#
VBoxOGLcrunpacker_TEMPLATE = VBOXCROGLR3HOSTLIB
VBoxOGLcrunpacker_INCS = \
unpacker
VBoxOGLcrunpacker_INTERMEDIATES = \
$(VBOX_PATH_CROGL_GENFILES)/spu_dispatch_table.h \
$(VBOX_PATH_CROGL_GENFILES)/cr_opcodes.h \
$(VBOX_PATH_CROGL_GENFILES)/unpack_extend.h
VBoxOGLcrunpacker_SOURCES = \
$(VBOX_PATH_CROGL_GENFILES)/unpack.c
VBoxOGLcrunpacker_CLEAN = \
$(VBOX_PATH_CROGL_GENFILES)/unpack.c \
$(VBOX_PATH_CROGL_GENFILES)/unpack_extend.h
#
# Generate files for VBoxOGLcrunpacker.
#
$(VBOX_PATH_CROGL_GENFILES)/unpack.c: $(addprefix $(PATH_SUB_CURRENT)/unpacker/, unpack.py unpacker_special) $(VBOX_PATH_CROGL_GENFILES)/unpack_extend.h $(VBOX_CROGL_API_FILES) | $$(dir $$@)
$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $< $(VBOX_PATH_CROGL_GLAPI) $(<D)
$(VBOX_PATH_CROGL_GENFILES)/unpack_extend.h: $(addprefix $(PATH_SUB_CURRENT)/unpacker/, unpack_extend.py unpacker_special) $(VBOX_CROGL_API_FILES) | $$(dir $$@)
$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $< $(VBOX_PATH_CROGL_GLAPI) $(<D)
#
# VBoxOGLrenderspu
#
VBoxOGLrenderspu_TEMPLATE = VBOXCROGLR3HOSTDLL
VBoxOGLrenderspu_INTERMEDIATES = \
$(VBOX_PATH_CROGL_GENFILES)/state/cr_currentpointers.h \
$(VBOX_PATH_CROGL_GENFILES)/state/cr_statefuncs.h
VBoxOGLrenderspu_SOURCES = \
VBoxOGLrenderspu_LDFLAGS.darwin += -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxOGLrenderspu.dylib
VBoxOGLrenderspu_LIBS = \
$(PATH_LIB)/VBoxOGLhostspuload$(VBOX_SUFF_LIB) \
$(VBOX_LIB_OGL_HOSTCRUTIL) \
$(LIB_RUNTIME)
if1of ($(KBUILD_TARGET), freebsd linux netbsd openbsd solaris) # the X11 gang
VBoxOGLrenderspu_LIBS += \
Xmu \
X11 \
Xext
VBoxOGLrenderspu_LIBPATH = \
$(VBOX_LIBPATH_X11)
endif
include $(KBUILD_PATH)/subfooter.kmk