VirtualBox

source: vbox/trunk/src/VBox/Frontends/VBoxSDL/Makefile.kmk@ 103914

Last change on this file since 103914 was 99494, checked in by vboxsync, 20 months ago

FE/VBoxSDL: Make it work with macOS, bugref:9449

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.5 KB
Line 
1# $Id: Makefile.kmk 99494 2023-04-20 19:52:23Z vboxsync $
2## @file
3# Sub-Makefile for VBoxSDL (a simple frontend based on SDL).
4#
5
6#
7# Copyright (C) 2006-2023 Oracle and/or its affiliates.
8#
9# This file is part of VirtualBox base platform packages, as
10# available from https://www.virtualbox.org.
11#
12# This program is free software; you can redistribute it and/or
13# modify it under the terms of the GNU General Public License
14# as published by the Free Software Foundation, in version 3 of the
15# License.
16#
17# This program is distributed in the hope that it will be useful, but
18# WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20# General Public License for more details.
21#
22# You should have received a copy of the GNU General Public License
23# along with this program; if not, see <https://www.gnu.org/licenses>.
24#
25# SPDX-License-Identifier: GPL-3.0-only
26#
27
28SUB_DEPTH = ../../../..
29include $(KBUILD_PATH)/subheader.kmk
30if !defined(VBOX_WITH_HARDENING) || "$(KBUILD_TARGET)" != "darwin" # No hardened VBoxSDL on darwin.
31
32
33 ifdef VBOX_WITH_HARDENING
34 #
35 # Hardened VBoxSDL
36 #
37 PROGRAMS += VBoxSDLHardened
38 VBoxSDLHardened_TEMPLATE = VBoxR3HardenedExe
39 VBoxSDLHardened_SOURCES = VBoxSDLHardened.cpp
40 VBoxSDLHardened_NAME = VBoxSDL
41 $(call VBOX_SET_VER_INFO_EXE,VBoxSDLHardened,VirtualBox Pure SDL Frontend,$(VBOX_WINDOWS_ICON_FILE)) # Version info / description.
42 endif
43
44
45 #
46 # VBoxSDL
47 #
48 ifdef VBOX_WITH_HARDENING
49 DLLS += VBoxSDL
50 else
51 PROGRAMS += VBoxSDL
52 endif
53 VBoxSDL_TEMPLATE := $(if $(VBOX_WITH_HARDENING),VBoxMainClientDll,VBoxMainClientExe)
54 VBoxSDL_SDKS = LIBSDL2
55 VBoxSDL_SOURCES = \
56 VBoxSDL.cpp \
57 Framebuffer.cpp \
58 Helper.cpp \
59 ../Common/PasswordInput.cpp
60
61 VBoxSDL_DEFS =
62 VBoxSDL_DEFS.freebsd = VBOXSDL_WITH_X11
63 VBoxSDL_DEFS.linux = _GNU_SOURCE VBOXSDL_WITH_X11
64 VBoxSDL_DEFS.solaris = VBOXSDL_WITH_X11
65 ifdef VBOX_OPENGL
66 #VBoxSDL_DEFS.linux += VBOX_OPENGL
67 endif
68 VBoxSDL_DEFS.win.x86 = _WIN32_WINNT=0x0500
69 VBoxSDL_DEFS.win.amd64 = _WIN32_WINNT=0x0510
70
71 VBoxSDL_INCS = \
72 $(VBoxSDL_0_OUTDIR) \
73 $(VBOX_GRAPHICS_INCS) \
74 ../Common
75 if1of ($(KBUILD_TARGET), freebsd linux netbsd openbsd solaris) # X11
76 VBoxSDL_INCS += \
77 $(VBOX_XCURSOR_INCS)
78 endif
79 ifn1of ($(KBUILD_TARGET), solaris) # Probably wrong with SDL2
80 VBoxSDL_LIBS = \
81 $(LIB_SDK_LIBSDL2_SDLMAIN)
82 endif
83 if1of ($(KBUILD_TARGET), freebsd linux netbsd openbsd solaris) # X11
84 VBoxSDL_LIBS += \
85 $(PATH_STAGE_DLL)/VBoxKeyboard$(VBOX_SUFF_DLL) \
86 $(VBOX_XCURSOR_LIBS) \
87 X11
88 VBoxSDL_LIBPATH = \
89 $(VBOX_LIBPATH_X11)
90 endif
91 ifdef VBOX_OPENGL
92 #VBoxSDL_LIBS.linux += GL
93 endif
94
95 VBoxSDL_LDFLAGS.win = -SubSystem:Windows
96
97 VBoxSDL_CLEAN = $(VBoxSDL_0_OUTDIR)/Ico64x01.h
98 VBoxSDL_INTERMEDIATES = $(VBoxSDL_0_OUTDIR)/Ico64x01.h
99
100
101 # Convert the pnm-file to a byte array.
102 $$(VBoxSDL_0_OUTDIR)/Ico64x01.h: $(PATH_ROOT)/src/VBox/Frontends/VBoxSDL/ico64x01.pnm $(VBOX_BIN2C) | $$(dir $$@)
103 $(call MSG_TOOL,bin2c,VBoxSDL,$<,$@)
104 $(QUIET)$(VBOX_BIN2C) Ico64x01 $< $@
105
106 ifdef VBOX_WITH_HARDENING
107 $(call VBOX_SET_VER_INFO_DLL,VBoxSDL,VirtualBox Pure SDL Frontend,$(VBOX_WINDOWS_ICON_FILE)) # Version info / description.
108 else
109 $(call VBOX_SET_VER_INFO_EXE,VBoxSDL,VirtualBox Pure SDL Frontend,$(VBOX_WINDOWS_ICON_FILE)) # Version info / description.
110 endif
111
112
113 #
114 # tstSDL
115 #
116 if 0
117 PROGRAMS += tstSDL
118 tstSDL_TEMPLATE = VBoxR3TstExe
119 tstSDL_SDKS = LIBSDL2
120 tstSDL_INST = $(INST_TESTCASE)
121 tstSDL_SOURCES = \
122 VBoxSDLTest.cpp
123 tstSDL_DEFS = IN_RING3 IN_RT_R3 _GNU_SOURCE
124 tstSDL_DEFS.win.x86 = _WIN32_WINNT=0x0500
125 ifdef VBOX_OPENGL
126 tstSDL_DEFS.linux = VBOX_OPENGL
127 endif
128
129
130 tstSDL_LIBS = \
131 $(LIB_RUNTIME)
132 ifn1of ($(KBUILD_TARGET), solaris)
133 tstSDL_LIBS += \
134 $(LIB_SDK_LIBSDL2_SDLMAIN)
135 endif
136
137 ifdef VBOX_OPENGL
138 tstSDL_LIBS.linux += GL
139 endif
140 if1of ($(KBUILD_TARGET), freebsd linux netbsd openbsd solaris) # X11
141 tstSDL_LIBPATH = \
142 $(VBOX_LIBPATH_X11)
143 endif
144
145 tstSDL_LDFLAGS.darwin = \
146 -framework Foundation -framework AppKit
147 endif
148 ## @todo What was this stuff doing here? The exception config is saying two different things, and why just -O for release builds?
149 #tstSDL_CXXFLAGS.win = \
150 # -EHsc
151 #tstSDL_CXXFLAGS.linux = \
152 # -DNDEBUG -DTRIMMED -O -Wall -fno-rtti -fno-exceptions \
153 # -Wno-non-virtual-dtor -Wno-long-long -fshort-wchar -pthread -pipe
154 # Is this what's intended? Why -fshort-wchar?
155 tstSDL_DEFS.linux = NDEBUG TRIMMED
156 tstSDL_CXXFLAGS.linux = -O -Wall -Wno-non-virtual-dtor -Wno-long-long -fshort-wchar
157
158
159endif # !VBOX_WITH_HARDENING || "$(KBUILD_TARGET)" != "darwin"
160include $(FILE_KBUILD_SUB_FOOTER)
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