# $Id: Makefile.kmk 37037 2011-05-11 12:53:40Z vboxsync $ ## @file # Sub-Makefile for VBoxSDL (a simple frontend based on SDL). # # # Copyright (C) 2006-2007 Oracle Corporation # # 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. # SUB_DEPTH = ../../../.. include $(KBUILD_PATH)/subheader.kmk if !defined(VBOX_WITH_HARDENING) || "$(KBUILD_TARGET)" != "darwin" # No hardened VBoxSDL on darwin. # # Targets. # ifdef VBOX_WITH_HARDENING PROGRAMS += VBoxSDLHardened DLLS += VBoxSDL else PROGRAMS += VBoxSDL endif PROGRAMS += tstSDL # # Hardened VBoxSDL # VBoxSDLHardened_TEMPLATE = VBOXR3HARDENEDEXE VBoxSDLHardened_SOURCES = VBoxSDLHardened.cpp VBoxSDLHardened_NAME = VBoxSDL # # VBoxSDL # VBoxSDL_TEMPLATE := $(if $(VBOX_WITH_HARDENING),VBOXMAINCLIENTDLL,VBOXMAINCLIENTEXE) VBoxSDL_SDKS = LIBSDL VBoxSDL_SOURCES = \ VBoxSDL.cpp \ Framebuffer.cpp \ Helper.cpp VBoxSDL_SOURCES.darwin = \ VBoxSDLMain-darwin.m VBoxSDL_DEFS = ifdef VBOX_WITH_SDL13 VBoxSDL_DEFS += VBOX_WITH_SDL13 else ifdef VBOX_WITH_SECURELABEL VBoxSDL_DEFS += VBOX_SECURELABEL endif endif VBoxSDL_DEFS.freebsd = VBOXSDL_WITH_X11 VBoxSDL_DEFS.linux = _GNU_SOURCE VBOXSDL_WITH_X11 VBoxSDL_DEFS.solaris = VBOXSDL_WITH_X11 ifdef VBOX_OPENGL #VBoxSDL_DEFS.linux += VBOX_OPENGL endif VBoxSDL_DEFS.win.x86 = _WIN32_WINNT=0x0500 VBoxSDL_DEFS.win.amd64 = _WIN32_WINNT=0x0510 VBoxSDL_INCS = \ $(VBoxSDL_0_OUTDIR) ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11 VBoxSDL_INCS += \ $(VBOX_XCURSOR_INCS) endif ifneq ($(filter-out win solaris,$(KBUILD_TARGET)),) VBoxSDL_LIBS = \ $(LIB_SDK_LIBSDL_SDLMAIN) endif ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11 VBoxSDL_LIBS += \ $(PATH_DLL)/VBoxKeyboard$(VBOX_SUFF_DLL) \ $(VBOX_XCURSOR_LIBS) \ X11 VBoxSDL_LIBPATH = \ $(VBOX_LIBPATH_X11) endif ifdef VBOX_OPENGL #VBoxSDL_LIBS.linux += GL endif VBoxSDL_LDFLAGS.darwin = \ -framework Foundation -framework AppKit VBoxSDL_CLEAN = $(VBoxSDL_0_OUTDIR)/Ico64x01.h VBoxSDL_INTERMEDIATES = $(VBoxSDL_0_OUTDIR)/Ico64x01.h # Convert the pnm-file to a byte array. $$(VBoxSDL_0_OUTDIR)/Ico64x01.h: $(PATH_ROOT)/src/VBox/Frontends/VBoxSDL/ico64x01.pnm $(VBOX_BIN2C) | $$(dir $$@) $(call MSG_TOOL,bin2c,VBoxSDL,$<,$@) $(QUIET)$(VBOX_BIN2C) Ico64x01 $< $@ # Icon include file. $$(VBoxSDL_0_OUTDIR)/VBoxSDL-icon.rc: $(VBOX_WINDOWS_ICON_FILE) $$(VBoxSDL_DEFPATH)/Makefile.kmk | $$(dir $$@) $(RM) -f $@ $(APPEND) $@ 'IDI_VIRTUALBOX ICON DISCARDABLE "$(subst /,\\,$(VBOX_WINDOWS_ICON_FILE))"' # # tstSDL # tstSDL_TEMPLATE = VBOXR3NPEXE tstSDL_SDKS = LIBSDL tstSDL_INST = $(INST_TESTCASE) tstSDL_SOURCES = \ VBoxSDLTest.cpp tstSDL_SOURCES.darwin = \ VBoxSDLMain-darwin.m tstSDL_DEFS = IN_RING3 IN_RT_R3 _GNU_SOURCE tstSDL_DEFS.win.x86 = _WIN32_WINNT=0x0500 ifdef VBOX_OPENGL tstSDL_DEFS.linux = VBOX_OPENGL endif tstSDL_LIBS = \ $(LIB_RUNTIME) ifneq ($(filter-out win solaris,$(KBUILD_TARGET)),) tstSDL_LIBS += \ $(LIB_SDK_LIBSDL_SDLMAIN) endif ifdef VBOX_OPENGL tstSDL_LIBS.linux += GL endif ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11 tstSDL_LIBPATH = \ $(VBOX_LIBPATH_X11) endif tstSDL_LDFLAGS.darwin = \ -framework Foundation -framework AppKit ## @todo What was this stuff doing here? The exception config is saying two different things, and why just -O for release builds? #tstSDL_CXXFLAGS.win = \ # -EHsc #tstSDL_CXXFLAGS.linux = \ # -DNDEBUG -DTRIMMED -O -Wall -fno-rtti -fno-exceptions \ # -Wno-non-virtual-dtor -Wno-long-long -fshort-wchar -pthread -pipe # Is this what's intended? Why -fshort-wchar? tstSDL_DEFS.linux = NDEBUG TRIMMED tstSDL_CXXFLAGS.linux = -O -Wall -Wno-non-virtual-dtor -Wno-long-long -fshort-wchar endif # !VBOX_WITH_HARDENING || "$(KBUILD_TARGET)" != "darwin" include $(KBUILD_PATH)/subfooter.kmk