VirtualBox

Ignore:
Timestamp:
Jan 27, 2009 9:15:24 PM (16 years ago)
Author:
vboxsync
Message:

SharedOpenGL/Makefile.kmk: review and some style adjustments.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedOpenGL/Makefile.kmk

    r16265 r16276  
    2020#
    2121
    22 
    2322SUB_DEPTH = ../../../..
    24 
    2523include $(KBUILD_PATH)/subheader.kmk
    2624
    27 if1of ($(KBUILD_HOST), win)
     25
     26#
     27# Target lists.
     28#
     29DLLS      += VBoxSharedCrOpenGL VBoxOGLrenderspu
     30LIBRARIES += VBoxOGLcrserverlib VBoxOGLcrunpacker
     31BLDDIRS   += \
     32        $(VBOX_PATH_CROGL_GENFILES)/
     33
     34
     35#
     36# Globals
     37#
     38if1of ($(KBUILD_HOST), os2 win)
    2839 VBOX_CROGL_HOST_PYTHONPATH := $(VBOX_PATH_CROGL_GLAPI);$(PATH_ROOT)/src/VBox/GuestHost/OpenGL/packer;$(PATH_ROOT)/src/VBox/HostServices/SharedOpenGL/crserverlib
    2940else
     
    3142endif
    3243
    33 VBOX_OPENGL_HEADERS = gl.h glu.h
    34 VBOX_PATH_MACOSX_OPENGL = $(PATH_OBJ)/VBoxOGL/GL
    35 
    36 DLLS      += VBoxSharedCrOpenGL
    37 DLLS      += VBoxOGLrenderspu
    38 LIBRARIES += VBoxOGLcrserverlib
    39 LIBRARIES += VBoxOGLcrunpacker
    40 
    41 # We have to symlink the system headers of OpenGl cause they have some
    42 # different directory hierarchy on Mac OS X (no /GL sub directory).
    43 $(addprefix $(VBOX_PATH_MACOSX_OPENGL)/,$(VBOX_OPENGL_HEADERS)): \
    44         $(VBOX_PATH_MACOSX_OPENGL)/%: $(VBOX_PATH_MACOSX_SDK)/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers/% | $$(dir $$@)
    45         $(LN) -s $< $@
    46 
    47 ## VBOXOGLR3HOST ##
     44
     45#
     46# The VBOXOGLR3HOST template.
     47#
     48## @todo r=bird: Most of the keywords are overridden here... check each and why.
    4849TEMPLATE_VBOXOGLR3HOST                = VBox OpenGL Host Libraries
    4950TEMPLATE_VBOXOGLR3HOST_EXTENDS        = VBOXR3NP
     
    5354TEMPLATE_VBOXOGLR3HOST_DEFS.solaris   = SunOS
    5455TEMPLATE_VBOXOGLR3HOST_DEFS.darwin    = DARWIN GL_GLEXT_LEGACY
     56TEMPLATE_VBOXOGLR3HOST_INCS.darwin    = $(VBOX_PATH_DARWIN_OPENGL)/..
    5557TEMPLATE_VBOXOGLR3HOST_INCS           = $(VBOX_PATH_CROGL_INCLUDE) $(VBOX_PATH_CROGL_GENFILES)
    56 TEMPLATE_VBOXOGLR3HOST_DEPS.darwin    = $(addprefix $(VBOX_PATH_MACOSX_OPENGL)/,$(VBOX_OPENGL_HEADERS))
    57 TEMPLATE_VBOXOGLR3HOST_INCS.darwin    = $(VBOX_PATH_MACOSX_OPENGL)/..
    58 TEMPLATE_VBOXOGLR3HOST_BLDDIRS.darwin = $(VBOX_PATH_MACOSX_OPENGL)
     58## @todo r=bird: try INTERMEDIATES.darwin here.
     59TEMPLATE_VBOXOGLR3HOST_DEPS.darwin    = $(addprefix $(VBOX_PATH_DARWIN_OPENGL)/,$(VBOX_DARWIN_OPENGL_HEADERS))
    5960TEMPLATE_VBOXOGLR3HOST_LDFLAGS.linux  = -Wl,--no-as-needed
    6061TEMPLATE_VBOXOGLR3HOST_LDFLAGS.darwin = -framework Carbon -framework OpenGL -current_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)
    61 TEMPLATE_VBOXOGLR3HOST_BLDDIRS        = $(VBOX_PATH_CROGL_GENFILES)/
     62TEMPLATE_VBOXOGLR3HOST_BLDDIRS.darwin = $(VBOX_PATH_DARWIN_OPENGL)
     63
     64
     65ifeq ($(KBUILD_TARGET),darwin)
     66#
     67# We have to symlink the system headers of OpenGl cause they have some
     68# different directory hierarchy on Mac OS X (no /GL sub directory).
     69#
     70VBOX_DARWIN_OPENGL_HEADERS := gl.h glu.h
     71VBOX_PATH_DARWIN_OPENGL    := $(PATH_OBJ)/VBoxOGL/GL
     72
     73$(foreach hdr, $(VBOX_DARWIN_OPENGL_HEADERS), \
     74$(VBOX_PATH_DARWIN_OPENGL)/$(hdr): \
     75        $(VBOX_PATH_MACOSX_SDK)/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers/$(hdr) \
     76        | $(VBOX_PATH_DARWIN_OPENGL)/ \
     77        ; $$(LN_SYMLINK) $$< $$@ )
     78endif # darwin
    6279
    6380#
    6481# VBoxSharedCrOpenGL
    6582#
    66 
    6783VBoxSharedCrOpenGL_TEMPLATE = VBOXOGLR3HOST
    68 VBoxSharedCrOpenGL_INCS := \
    69         $(PATH_SUB_CURRENT) \
    70         $(PATH_VBoxSVC)
    71 VBoxSharedCrOpenGL_INCS.win += \
     84ifdef VBOX_WITH_XPCOM
     85 VBoxSharedCrOpenGL_DEFS = VBOX_WITH_XPCOM
     86 VBoxSharedCrOpenGL_INTERMEDIATES = \
     87        $(VBOX_PATH_SDK)/bindings/xpcom/include/VirtualBox_XPCOM.h
     88endif
     89VBoxSharedCrOpenGL_INCS.win = \
    7290        $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_INC) \
    7391        $(VBOX_PATH_SDK)/bindings/mscom/include \
    7492        $(PATH_VBoxCOM)
     93VBoxSharedCrOpenGL_INCS = \
     94        . \
     95        $(PATH_VBoxSVC)
    7596ifdef VBOX_WITH_XPCOM
    76  VBoxSharedCrOpenGL_DEFS          += VBOX_WITH_XPCOM
    77  VBoxSharedCrOpenGL_INCS          += $(VBOX_XPCOM_INCS)
    78  VBoxSharedCrOpenGL_INTERMEDIATES += $(VBOX_PATH_SDK)/bindings/xpcom/include/VirtualBox_XPCOM.h
    79 endif
    80 VBoxSharedCrOpenGL_LDFLAGS.darwin += -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxSharedCrOpenGL.dylib
    81 VBoxSharedCrOpenGL_SOURCES        += crserver/crservice.cpp
    82 VBoxSharedCrOpenGL_LIBS.win = \
     97 VBoxSharedCrOpenGL_INCS += \
     98        $(VBOX_XPCOM_INCS)
     99endif
     100VBoxSharedCrOpenGL_SOURCES = \
     101        crserver/crservice.cpp
     102VBoxSharedCrOpenGL_LDFLAGS.darwin = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxSharedCrOpenGL.dylib
     103VBoxSharedCrOpenGL_LIBS.darwin = \
     104        $(LIB_REM)
     105ifeq ($(KBUILD_TARGET),win)
     106VBoxSharedCrOpenGL_LIBS = \
    83107        $(PATH_OBJ)/VBoxOGLhostcrutil/VBoxOGLhostcrutil$(VBOX_SUFF_LIB) \
    84108        $(PATH_LIB)/VBoxOGLhostspuload$(VBOX_SUFF_LIB) \
     
    88112        $(PATH_LIB)/VBoxOGLcrserverlib$(VBOX_SUFF_LIB) \
    89113        $(PATH_LIB)/VBoxOGLcrunpacker$(VBOX_SUFF_LIB) \
    90         $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_LIB)/atls$(VBOX_SUFF_LIB)\
    91         $(LIB_RUNTIME) $(LIB_VMM)
    92 if1of ($(KBUILD_TARGET), linux solaris darwin)
     114        $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_LIB)/atls$(VBOX_SUFF_LIB)
     115else
    93116 VBoxSharedCrOpenGL_LIBS += \
    94117        $(PATH_LIB)/VBoxOGLcrserverlib$(VBOX_SUFF_LIB) \
     
    98121        $(PATH_LIB)/VBoxOGLhostcrstate$(VBOX_SUFF_LIB) \
    99122        $(PATH_LIB)/VBoxOGLhostspuload$(VBOX_SUFF_LIB) \
    100         $(PATH_BIN)/VBoxOGLhostcrutil$(VBOX_SUFF_DLL) \
    101         $(LIB_RUNTIME) $(LIB_VMM)
    102 endif
    103 VBoxSharedCrOpenGL_LIBS.darwin += $(LIB_REM)
     123        $(PATH_BIN)/VBoxOGLhostcrutil$(VBOX_SUFF_DLL)
     124endif
     125VBoxSharedCrOpenGL_LIBS += \
     126        $(LIB_RUNTIME) \
     127        $(LIB_VMM)
     128
    104129
    105130#
    106131# VBoxOGLcrserverlib
    107132#
    108 
    109133VBoxOGLcrserverlib_TEMPLATE = VBOXOGLR3HOST
    110 VBoxOGLcrserverlib_INCS := $(PATH_SUB_CURRENT)/crserverlib
     134VBoxOGLcrserverlib_INCS  = \
     135        crserverlib
     136VBoxOGLcrserverlib_INTERMEDIATES = \
     137        $(VBOX_PATH_CROGL_GENFILES)/spu_dispatch_table.h \
     138        $(VBOX_PATH_CROGL_GENFILES)/server_dispatch.h \
     139        $(VBOX_PATH_CROGL_GENFILES)/state/cr_currentpointers.h \
     140        $(VBOX_PATH_CROGL_GENFILES)/state/cr_statefuncs.h
    111141VBoxOGLcrserverlib_SOURCES := \
    112142        crserverlib/server_main.c \
     
    139169        $(VBOX_PATH_CROGL_GENFILES)/server_get.c \
    140170        $(VBOX_PATH_CROGL_GENFILES)/server_simpleget.c
    141 VBoxOGLcrserverlib_INTERMEDIATES := \
    142         $(VBOX_PATH_CROGL_GENFILES)/spu_dispatch_table.h \
    143         $(VBOX_PATH_CROGL_GENFILES)/server_dispatch.h \
    144         $(VBOX_PATH_CROGL_GENFILES)/state/cr_currentpointers.h \
    145         $(VBOX_PATH_CROGL_GENFILES)/state/cr_statefuncs.h
    146 VBoxOGLcrserverlib_CLEAN := \
     171VBoxOGLcrserverlib_CLEAN = \
    147172        $(VBOX_PATH_CROGL_GENFILES)/server_dispatch.c \
    148173        $(VBOX_PATH_CROGL_GENFILES)/server_retval.c \
     
    150175        $(VBOX_PATH_CROGL_GENFILES)/server_simpleget.c \
    151176        $(VBOX_PATH_CROGL_GENFILES)/server_dispatch.h
    152 VBoxOGLcrserverlib_LIBS.win = \
    153         $(PATH_OBJ)/VBoxOGLhostcrutil/VBoxOGLhostcrutil$(VBOX_SUFF_LIB) \
    154         $(PATH_LIB)/VBoxOGLhostcrpacker$(VBOX_SUFF_LIB) \
    155         $(PATH_LIB)/VBoxOGLhostspuload$(VBOX_SUFF_LIB) \
    156         $(PATH_LIB)/VBoxOGLcrunpacker$(VBOX_SUFF_LIB) \
     177ifeq ($(KBUILD_HOST),win)
     178 VBoxOGLcrserverlib_LIBS = \
     179        $(PATH_OBJ)/VBoxOGLhostcrutil/VBoxOGLhostcrutil$(VBOX_SUFF_LIB) \
     180        $(PATH_LIB)/VBoxOGLhostcrpacker$(VBOX_SUFF_LIB) \
     181        $(PATH_LIB)/VBoxOGLhostspuload$(VBOX_SUFF_LIB) \
     182        $(PATH_LIB)/VBoxOGLcrunpacker$(VBOX_SUFF_LIB) \
    157183        $(PATH_LIB)/VBoxOGLhostcrstate$(VBOX_SUFF_LIB)
    158 if1of ($(KBUILD_TARGET), linux solaris darwin)
    159  VBoxOGLcrserverlib_LIBS += \
     184else
     185 VBoxOGLcrserverlib_LIBS = \
    160186        $(PATH_BIN)/VBoxOGLhostcrpacker$(VBOX_SUFF_DLL) \
    161187        $(PATH_BIN)/VBoxOGLhostspuload$(VBOX_SUFF_DLL) \
     
    165191endif
    166192
     193#
     194# Generate files for VBoxOGLcrserverlib
     195#
    167196$(VBOX_PATH_CROGL_GENFILES)/server_dispatch.h: $(addprefix $(PATH_SUB_CURRENT)/crserverlib/, server_dispatch_header.py server_special) $(VBOX_CROGL_API_FILES) | $$(dir $$@)
    168197        $(call VBOX_CROGL_PYTHON_ENV,$(VBOX_CROGL_HOST_PYTHONPATH),$@) $(VBOX_BLD_PYTHON) $< $(VBOX_PATH_CROGL_GLAPI) $(<D)
     
    180209        $(call VBOX_CROGL_PYTHON_ENV,$(VBOX_CROGL_HOST_PYTHONPATH),$@) $(VBOX_BLD_PYTHON) $< $(VBOX_PATH_CROGL_GLAPI) $(<D)
    181210
     211
    182212#
    183213# VBoxOGLcrunpacker
    184214#
    185 
    186215VBoxOGLcrunpacker_TEMPLATE       = VBOXOGLR3HOST
    187 VBoxOGLcrunpacker_INCS          := $(PATH_SUB_CURRENT)/unpacker
     216VBoxOGLcrunpacker_INCS           = \
     217        unpacker
    188218VBoxOGLcrunpacker_INTERMEDIATES  = \
    189219        $(VBOX_PATH_CROGL_GENFILES)/spu_dispatch_table.h \
    190220        $(VBOX_PATH_CROGL_GENFILES)/cr_opcodes.h \
    191221        $(VBOX_PATH_CROGL_GENFILES)/unpack_extend.h
    192 VBoxOGLcrunpacker_SOURCES       := \
     222VBoxOGLcrunpacker_SOURCES  = \
    193223        unpacker/unpack_arrays.c \
    194224        unpacker/unpack_bounds.c \
     
    215245        unpacker/unpack_visibleregion.c \
    216246        $(VBOX_PATH_CROGL_GENFILES)/unpack.c
    217 VBoxOGLcrunpacker_CLEAN         := \
     247VBoxOGLcrunpacker_CLEAN = \
    218248        $(VBOX_PATH_CROGL_GENFILES)/unpack.c \
    219249        $(VBOX_PATH_CROGL_GENFILES)/unpack_extend.h
    220 VBoxOGLcrunpacker_LIBS.win       = \
    221         $(PATH_OBJ)/VBoxOGLhostcrutil/VBoxOGLhostcrutil$(VBOX_SUFF_LIB) \
    222         $(PATH_LIB)/VBoxOGLhostspuload$(VBOX_SUFF_LIB) \
    223         $(PATH_LIB)/VBoxOGLhostcrpacker$(VBOX_SUFF_LIB)
    224 if1of ($(KBUILD_TARGET), linux solaris darwin)
    225  VBoxOGLcrunpacker_LIBS += \
    226         $(PATH_BIN)/VBoxOGLhostcrpacker$(VBOX_SUFF_DLL) \
    227         $(PATH_BIN)/VBoxOGLhostspuload$(VBOX_SUFF_DLL) \
    228         $(PATH_BIN)/VBoxOGLhostcrutil$(VBOX_SUFF_DLL)
    229 endif
    230 
     250ifeq ($(KBUILD_TARGET),win)
     251 VBoxOGLcrunpacker_LIBS = \
     252        $(PATH_OBJ)/VBoxOGLhostcrutil/VBoxOGLhostcrutil$(VBOX_SUFF_LIB) \
     253        $(PATH_LIB)/VBoxOGLhostspuload$(VBOX_SUFF_LIB) \
     254        $(PATH_LIB)/VBoxOGLhostcrpacker$(VBOX_SUFF_LIB)
     255else
     256 VBoxOGLcrunpacker_LIBS = \
     257        $(PATH_BIN)/VBoxOGLhostcrpacker$(VBOX_SUFF_DLL) \
     258        $(PATH_BIN)/VBoxOGLhostspuload$(VBOX_SUFF_DLL) \
     259        $(PATH_BIN)/VBoxOGLhostcrutil$(VBOX_SUFF_DLL)
     260endif
     261
     262#
     263# Generate files for VBoxOGLcrunpacker.
     264#
    231265$(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 $$@)
    232266        $(call VBOX_CROGL_PYTHON_ENV,$(VBOX_CROGL_HOST_PYTHONPATH),$@) $(VBOX_BLD_PYTHON) $< $(VBOX_PATH_CROGL_GLAPI) $(<D)
     
    235269        $(call VBOX_CROGL_PYTHON_ENV,$(VBOX_CROGL_HOST_PYTHONPATH),$@) $(VBOX_BLD_PYTHON) $< $(VBOX_PATH_CROGL_GLAPI) $(<D)
    236270
     271
    237272#
    238273# VBoxOGLrenderspu
    239274#
    240 
    241275VBoxOGLrenderspu_TEMPLATE = VBOXOGLR3HOST
    242 VBoxOGLrenderspu_LIBS += $(LIB_RUNTIME)
    243 VBoxOGLrenderspu_LDFLAGS.darwin += -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxOGLrenderspu.dylib
    244 VBoxOGLrenderspu_SOURCES := \
     276VBoxOGLrenderspu_INTERMEDIATES = \
     277        $(VBOX_PATH_CROGL_GENFILES)/state/cr_currentpointers.h \
     278        $(VBOX_PATH_CROGL_GENFILES)/state/cr_statefuncs.h
     279VBoxOGLrenderspu_SOURCES = \
    245280        render/renderspu.c \
    246281        render/renderspu_config.c \
     
    250285VBoxOGLrenderspu_SOURCES.solaris = render/renderspu_glx.c
    251286VBoxOGLrenderspu_SOURCES.darwin  = render/renderspu_agl.c
    252 VBoxOGLrenderspu_INTERMEDIATES = \
    253         $(VBOX_PATH_CROGL_GENFILES)/state/cr_currentpointers.h \
    254         $(VBOX_PATH_CROGL_GENFILES)/state/cr_statefuncs.h
    255 VBoxOGLrenderspu_LIBS.win      = \
    256         $(PATH_OBJ)/VBoxOGLhostcrutil/VBoxOGLhostcrutil$(VBOX_SUFF_LIB) \
    257         $(PATH_LIB)/VBoxOGLhostspuload$(VBOX_SUFF_LIB)
    258 if1of ($(KBUILD_TARGET), linux solaris darwin)
     287
     288VBoxOGLrenderspu_LDFLAGS.darwin += -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxOGLrenderspu.dylib
     289ifeq ($(KBUILD_TARGET),win)
    259290 VBoxOGLrenderspu_LIBS += \
    260         $(PATH_BIN)/VBoxOGLhostcrutil$(VBOX_SUFF_DLL) \
    261         $(PATH_LIB)/VBoxOGLhostspuload$(VBOX_SUFF_LIB)
    262 endif
    263 if1of ($(KBUILD_TARGET), linux solaris)
    264  VBoxOGLrenderspu_LIBPATH += $(VBOX_LIBPATH_X11)
     291        $(PATH_OBJ)/VBoxOGLhostcrutil/VBoxOGLhostcrutil$(VBOX_SUFF_LIB) \
     292        $(PATH_LIB)/VBoxOGLhostspuload$(VBOX_SUFF_LIB)
     293else
    265294 VBoxOGLrenderspu_LIBS += \
    266         Xmu X11 Xext
     295        $(PATH_BIN)/VBoxOGLhostcrutil$(VBOX_SUFF_DLL) \
     296        $(PATH_LIB)/VBoxOGLhostspuload$(VBOX_SUFF_LIB)
     297endif
     298VBoxOGLrenderspu_LIBS += \
     299        $(LIB_RUNTIME)
     300if1of ($(KBUILD_TARGET), freebsd linux netbsd openbsd solaris) # the X11 gang
     301 VBoxOGLrenderspu_LIBS += \
     302        Xmu \
     303        X11 \
     304        Xext
     305 VBoxOGLrenderspu_LIBPATH = \
     306        $(VBOX_LIBPATH_X11)
    267307endif
    268308
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette