VirtualBox

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

Last change on this file since 96562 was 96407, checked in by vboxsync, 2 years ago

scm copyright and license note update

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.7 KB
Line 
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
28SUB_DEPTH = ../../../..
29include $(KBUILD_PATH)/subheader.kmk
30if !defined(VBOX_WITH_HARDENING) || "$(KBUILD_TARGET)" != "darwin" # No hardened VBoxSDL on darwin.
31
32
33ifdef 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.
42endif
43
44
45#
46# VBoxSDL
47#
48ifdef VBOX_WITH_HARDENING
49 DLLS += VBoxSDL
50else
51 PROGRAMS += VBoxSDL
52endif
53VBoxSDL_TEMPLATE := $(if $(VBOX_WITH_HARDENING),VBOXMAINCLIENTDLL,VBOXMAINCLIENTEXE)
54VBoxSDL_SDKS = LIBSDL
55VBoxSDL_SOURCES = \
56 VBoxSDL.cpp \
57 Framebuffer.cpp \
58 Helper.cpp \
59 ../Common/PasswordInput.cpp
60VBoxSDL_SOURCES.darwin = \
61 VBoxSDLMain-darwin.m \
62 Framebuffer-darwin.m
63
64VBoxSDL_DEFS =
65ifdef VBOX_WITH_SDL2
66 VBoxSDL_DEFS += VBOX_WITH_SDL2
67endif
68if !defined(VBOX_WITH_SDL2)
69 ifdef VBOX_WITH_SECURELABEL
70 VBoxSDL_DEFS += VBOX_SECURELABEL
71 endif
72endif
73VBoxSDL_DEFS.freebsd = VBOXSDL_WITH_X11
74VBoxSDL_DEFS.linux = _GNU_SOURCE VBOXSDL_WITH_X11
75VBoxSDL_DEFS.solaris = VBOXSDL_WITH_X11
76ifdef VBOX_OPENGL
77 #VBoxSDL_DEFS.linux += VBOX_OPENGL
78endif
79VBoxSDL_DEFS.win.x86 = _WIN32_WINNT=0x0500
80VBoxSDL_DEFS.win.amd64 = _WIN32_WINNT=0x0510
81
82VBoxSDL_INCS = \
83 $(VBoxSDL_0_OUTDIR) \
84 $(VBOX_GRAPHICS_INCS) \
85 ../Common
86ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11
87VBoxSDL_INCS += \
88 $(VBOX_XCURSOR_INCS)
89endif
90ifneq ($(filter-out win solaris,$(KBUILD_TARGET)),)
91
92VBoxSDL_LIBS = \
93 $(LIB_SDK_LIBSDL_SDLMAIN)
94endif
95ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11
96VBoxSDL_LIBS += \
97 $(PATH_STAGE_DLL)/VBoxKeyboard$(VBOX_SUFF_DLL) \
98 $(VBOX_XCURSOR_LIBS) \
99 X11
100VBoxSDL_LIBPATH = \
101 $(VBOX_LIBPATH_X11)
102endif
103ifdef VBOX_OPENGL
104 #VBoxSDL_LIBS.linux += GL
105endif
106
107VBoxSDL_LDFLAGS.darwin = \
108 -framework Foundation -framework AppKit
109
110VBoxSDL_CLEAN = $(VBoxSDL_0_OUTDIR)/Ico64x01.h
111VBoxSDL_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
119ifdef VBOX_WITH_HARDENING
120$(call VBOX_SET_VER_INFO_DLL,VBoxSDL,VirtualBox Pure SDL Frontend,$(VBOX_WINDOWS_ICON_FILE)) # Version info / description.
121else
122$(call VBOX_SET_VER_INFO_EXE,VBoxSDL,VirtualBox Pure SDL Frontend,$(VBOX_WINDOWS_ICON_FILE)) # Version info / description.
123endif
124
125
126#
127# tstSDL
128#
129PROGRAMS += tstSDL
130tstSDL_TEMPLATE = VBOXR3NPEXE
131tstSDL_SDKS = LIBSDL
132tstSDL_INST = $(INST_TESTCASE)
133tstSDL_SOURCES = \
134 VBoxSDLTest.cpp
135tstSDL_SOURCES.darwin = \
136 VBoxSDLMain-darwin.m
137tstSDL_DEFS = IN_RING3 IN_RT_R3 _GNU_SOURCE
138tstSDL_DEFS.win.x86 = _WIN32_WINNT=0x0500
139ifdef VBOX_OPENGL
140tstSDL_DEFS.linux = VBOX_OPENGL
141endif
142
143tstSDL_LIBS = \
144 $(LIB_RUNTIME)
145ifneq ($(filter-out win solaris,$(KBUILD_TARGET)),)
146tstSDL_LIBS += \
147 $(LIB_SDK_LIBSDL_SDLMAIN)
148endif
149
150ifdef VBOX_OPENGL
151tstSDL_LIBS.linux += GL
152endif
153ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11
154tstSDL_LIBPATH = \
155 $(VBOX_LIBPATH_X11)
156endif
157
158tstSDL_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?
168tstSDL_DEFS.linux = NDEBUG TRIMMED
169tstSDL_CXXFLAGS.linux = -O -Wall -Wno-non-virtual-dtor -Wno-long-long -fshort-wchar
170
171
172endif # !VBOX_WITH_HARDENING || "$(KBUILD_TARGET)" != "darwin"
173include $(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