1 | # $Id: Makefile.kmk 96407 2022-08-22 17:43:14Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for VBoxSDL (a simple frontend based on SDL).
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2006-2022 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 |
|
---|
28 | SUB_DEPTH = ../../../..
|
---|
29 | include $(KBUILD_PATH)/subheader.kmk
|
---|
30 | if !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 = LIBSDL
|
---|
55 | VBoxSDL_SOURCES = \
|
---|
56 | VBoxSDL.cpp \
|
---|
57 | Framebuffer.cpp \
|
---|
58 | Helper.cpp \
|
---|
59 | ../Common/PasswordInput.cpp
|
---|
60 | VBoxSDL_SOURCES.darwin = \
|
---|
61 | VBoxSDLMain-darwin.m \
|
---|
62 | Framebuffer-darwin.m
|
---|
63 |
|
---|
64 | VBoxSDL_DEFS =
|
---|
65 | ifdef VBOX_WITH_SDL2
|
---|
66 | VBoxSDL_DEFS += VBOX_WITH_SDL2
|
---|
67 | endif
|
---|
68 | if !defined(VBOX_WITH_SDL2)
|
---|
69 | ifdef VBOX_WITH_SECURELABEL
|
---|
70 | VBoxSDL_DEFS += VBOX_SECURELABEL
|
---|
71 | endif
|
---|
72 | endif
|
---|
73 | VBoxSDL_DEFS.freebsd = VBOXSDL_WITH_X11
|
---|
74 | VBoxSDL_DEFS.linux = _GNU_SOURCE VBOXSDL_WITH_X11
|
---|
75 | VBoxSDL_DEFS.solaris = VBOXSDL_WITH_X11
|
---|
76 | ifdef VBOX_OPENGL
|
---|
77 | #VBoxSDL_DEFS.linux += VBOX_OPENGL
|
---|
78 | endif
|
---|
79 | VBoxSDL_DEFS.win.x86 = _WIN32_WINNT=0x0500
|
---|
80 | VBoxSDL_DEFS.win.amd64 = _WIN32_WINNT=0x0510
|
---|
81 |
|
---|
82 | VBoxSDL_INCS = \
|
---|
83 | $(VBoxSDL_0_OUTDIR) \
|
---|
84 | $(VBOX_GRAPHICS_INCS) \
|
---|
85 | ../Common
|
---|
86 | ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11
|
---|
87 | VBoxSDL_INCS += \
|
---|
88 | $(VBOX_XCURSOR_INCS)
|
---|
89 | endif
|
---|
90 | ifneq ($(filter-out win solaris,$(KBUILD_TARGET)),)
|
---|
91 |
|
---|
92 | VBoxSDL_LIBS = \
|
---|
93 | $(LIB_SDK_LIBSDL_SDLMAIN)
|
---|
94 | endif
|
---|
95 | ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11
|
---|
96 | VBoxSDL_LIBS += \
|
---|
97 | $(PATH_STAGE_DLL)/VBoxKeyboard$(VBOX_SUFF_DLL) \
|
---|
98 | $(VBOX_XCURSOR_LIBS) \
|
---|
99 | X11
|
---|
100 | VBoxSDL_LIBPATH = \
|
---|
101 | $(VBOX_LIBPATH_X11)
|
---|
102 | endif
|
---|
103 | ifdef VBOX_OPENGL
|
---|
104 | #VBoxSDL_LIBS.linux += GL
|
---|
105 | endif
|
---|
106 |
|
---|
107 | VBoxSDL_LDFLAGS.darwin = \
|
---|
108 | -framework Foundation -framework AppKit
|
---|
109 |
|
---|
110 | VBoxSDL_CLEAN = $(VBoxSDL_0_OUTDIR)/Ico64x01.h
|
---|
111 | VBoxSDL_INTERMEDIATES = $(VBoxSDL_0_OUTDIR)/Ico64x01.h
|
---|
112 |
|
---|
113 |
|
---|
114 | # Convert the pnm-file to a byte array.
|
---|
115 | $$(VBoxSDL_0_OUTDIR)/Ico64x01.h: $(PATH_ROOT)/src/VBox/Frontends/VBoxSDL/ico64x01.pnm $(VBOX_BIN2C) | $$(dir $$@)
|
---|
116 | $(call MSG_TOOL,bin2c,VBoxSDL,$<,$@)
|
---|
117 | $(QUIET)$(VBOX_BIN2C) Ico64x01 $< $@
|
---|
118 |
|
---|
119 | ifdef VBOX_WITH_HARDENING
|
---|
120 | $(call VBOX_SET_VER_INFO_DLL,VBoxSDL,VirtualBox Pure SDL Frontend,$(VBOX_WINDOWS_ICON_FILE)) # Version info / description.
|
---|
121 | else
|
---|
122 | $(call VBOX_SET_VER_INFO_EXE,VBoxSDL,VirtualBox Pure SDL Frontend,$(VBOX_WINDOWS_ICON_FILE)) # Version info / description.
|
---|
123 | endif
|
---|
124 |
|
---|
125 |
|
---|
126 | #
|
---|
127 | # tstSDL
|
---|
128 | #
|
---|
129 | PROGRAMS += tstSDL
|
---|
130 | tstSDL_TEMPLATE = VBOXR3NPEXE
|
---|
131 | tstSDL_SDKS = LIBSDL
|
---|
132 | tstSDL_INST = $(INST_TESTCASE)
|
---|
133 | tstSDL_SOURCES = \
|
---|
134 | VBoxSDLTest.cpp
|
---|
135 | tstSDL_SOURCES.darwin = \
|
---|
136 | VBoxSDLMain-darwin.m
|
---|
137 | tstSDL_DEFS = IN_RING3 IN_RT_R3 _GNU_SOURCE
|
---|
138 | tstSDL_DEFS.win.x86 = _WIN32_WINNT=0x0500
|
---|
139 | ifdef VBOX_OPENGL
|
---|
140 | tstSDL_DEFS.linux = VBOX_OPENGL
|
---|
141 | endif
|
---|
142 |
|
---|
143 | tstSDL_LIBS = \
|
---|
144 | $(LIB_RUNTIME)
|
---|
145 | ifneq ($(filter-out win solaris,$(KBUILD_TARGET)),)
|
---|
146 | tstSDL_LIBS += \
|
---|
147 | $(LIB_SDK_LIBSDL_SDLMAIN)
|
---|
148 | endif
|
---|
149 |
|
---|
150 | ifdef VBOX_OPENGL
|
---|
151 | tstSDL_LIBS.linux += GL
|
---|
152 | endif
|
---|
153 | ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11
|
---|
154 | tstSDL_LIBPATH = \
|
---|
155 | $(VBOX_LIBPATH_X11)
|
---|
156 | endif
|
---|
157 |
|
---|
158 | tstSDL_LDFLAGS.darwin = \
|
---|
159 | -framework Foundation -framework AppKit
|
---|
160 |
|
---|
161 | ## @todo What was this stuff doing here? The exception config is saying two different things, and why just -O for release builds?
|
---|
162 | #tstSDL_CXXFLAGS.win = \
|
---|
163 | # -EHsc
|
---|
164 | #tstSDL_CXXFLAGS.linux = \
|
---|
165 | # -DNDEBUG -DTRIMMED -O -Wall -fno-rtti -fno-exceptions \
|
---|
166 | # -Wno-non-virtual-dtor -Wno-long-long -fshort-wchar -pthread -pipe
|
---|
167 | # Is this what's intended? Why -fshort-wchar?
|
---|
168 | tstSDL_DEFS.linux = NDEBUG TRIMMED
|
---|
169 | tstSDL_CXXFLAGS.linux = -O -Wall -Wno-non-virtual-dtor -Wno-long-long -fshort-wchar
|
---|
170 |
|
---|
171 |
|
---|
172 | endif # !VBOX_WITH_HARDENING || "$(KBUILD_TARGET)" != "darwin"
|
---|
173 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|