1 | # $Id: Makefile.kmk 93115 2022-01-01 11:31:46Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for VBoxSDL (a simple frontend based on SDL).
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2006-2022 Oracle Corporation
|
---|
8 | #
|
---|
9 | # This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | # available from http://www.virtualbox.org. This file is free software;
|
---|
11 | # you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | # General Public License (GPL) as published by the Free Software
|
---|
13 | # Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | #
|
---|
17 |
|
---|
18 | SUB_DEPTH = ../../../..
|
---|
19 | include $(KBUILD_PATH)/subheader.kmk
|
---|
20 | if !defined(VBOX_WITH_HARDENING) || "$(KBUILD_TARGET)" != "darwin" # No hardened VBoxSDL on darwin.
|
---|
21 |
|
---|
22 |
|
---|
23 | ifdef VBOX_WITH_HARDENING
|
---|
24 | #
|
---|
25 | # Hardened VBoxSDL
|
---|
26 | #
|
---|
27 | PROGRAMS += VBoxSDLHardened
|
---|
28 | VBoxSDLHardened_TEMPLATE = VBOXR3HARDENEDEXE
|
---|
29 | VBoxSDLHardened_SOURCES = VBoxSDLHardened.cpp
|
---|
30 | VBoxSDLHardened_NAME = VBoxSDL
|
---|
31 | $(call VBOX_SET_VER_INFO_EXE,VBoxSDLHardened,VirtualBox Pure SDL Frontend,$(VBOX_WINDOWS_ICON_FILE)) # Version info / description.
|
---|
32 | endif
|
---|
33 |
|
---|
34 |
|
---|
35 | #
|
---|
36 | # VBoxSDL
|
---|
37 | #
|
---|
38 | ifdef VBOX_WITH_HARDENING
|
---|
39 | DLLS += VBoxSDL
|
---|
40 | else
|
---|
41 | PROGRAMS += VBoxSDL
|
---|
42 | endif
|
---|
43 | VBoxSDL_TEMPLATE := $(if $(VBOX_WITH_HARDENING),VBOXMAINCLIENTDLL,VBOXMAINCLIENTEXE)
|
---|
44 | VBoxSDL_SDKS = LIBSDL
|
---|
45 | VBoxSDL_SOURCES = \
|
---|
46 | VBoxSDL.cpp \
|
---|
47 | Framebuffer.cpp \
|
---|
48 | Helper.cpp \
|
---|
49 | ../Common/PasswordInput.cpp
|
---|
50 | VBoxSDL_SOURCES.darwin = \
|
---|
51 | VBoxSDLMain-darwin.m \
|
---|
52 | Framebuffer-darwin.m
|
---|
53 |
|
---|
54 | VBoxSDL_DEFS =
|
---|
55 | ifdef VBOX_WITH_SDL2
|
---|
56 | VBoxSDL_DEFS += VBOX_WITH_SDL2
|
---|
57 | endif
|
---|
58 | if !defined(VBOX_WITH_SDL2)
|
---|
59 | ifdef VBOX_WITH_SECURELABEL
|
---|
60 | VBoxSDL_DEFS += VBOX_SECURELABEL
|
---|
61 | endif
|
---|
62 | endif
|
---|
63 | VBoxSDL_DEFS.freebsd = VBOXSDL_WITH_X11
|
---|
64 | VBoxSDL_DEFS.linux = _GNU_SOURCE VBOXSDL_WITH_X11
|
---|
65 | VBoxSDL_DEFS.solaris = VBOXSDL_WITH_X11
|
---|
66 | ifdef VBOX_OPENGL
|
---|
67 | #VBoxSDL_DEFS.linux += VBOX_OPENGL
|
---|
68 | endif
|
---|
69 | VBoxSDL_DEFS.win.x86 = _WIN32_WINNT=0x0500
|
---|
70 | VBoxSDL_DEFS.win.amd64 = _WIN32_WINNT=0x0510
|
---|
71 |
|
---|
72 | VBoxSDL_INCS = \
|
---|
73 | $(VBoxSDL_0_OUTDIR) \
|
---|
74 | $(VBOX_GRAPHICS_INCS) \
|
---|
75 | ../Common
|
---|
76 | ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11
|
---|
77 | VBoxSDL_INCS += \
|
---|
78 | $(VBOX_XCURSOR_INCS)
|
---|
79 | endif
|
---|
80 | ifneq ($(filter-out win solaris,$(KBUILD_TARGET)),)
|
---|
81 |
|
---|
82 | VBoxSDL_LIBS = \
|
---|
83 | $(LIB_SDK_LIBSDL_SDLMAIN)
|
---|
84 | endif
|
---|
85 | ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11
|
---|
86 | VBoxSDL_LIBS += \
|
---|
87 | $(PATH_STAGE_DLL)/VBoxKeyboard$(VBOX_SUFF_DLL) \
|
---|
88 | $(VBOX_XCURSOR_LIBS) \
|
---|
89 | X11
|
---|
90 | VBoxSDL_LIBPATH = \
|
---|
91 | $(VBOX_LIBPATH_X11)
|
---|
92 | endif
|
---|
93 | ifdef VBOX_OPENGL
|
---|
94 | #VBoxSDL_LIBS.linux += GL
|
---|
95 | endif
|
---|
96 |
|
---|
97 | VBoxSDL_LDFLAGS.darwin = \
|
---|
98 | -framework Foundation -framework AppKit
|
---|
99 |
|
---|
100 | VBoxSDL_CLEAN = $(VBoxSDL_0_OUTDIR)/Ico64x01.h
|
---|
101 | VBoxSDL_INTERMEDIATES = $(VBoxSDL_0_OUTDIR)/Ico64x01.h
|
---|
102 |
|
---|
103 |
|
---|
104 | # Convert the pnm-file to a byte array.
|
---|
105 | $$(VBoxSDL_0_OUTDIR)/Ico64x01.h: $(PATH_ROOT)/src/VBox/Frontends/VBoxSDL/ico64x01.pnm $(VBOX_BIN2C) | $$(dir $$@)
|
---|
106 | $(call MSG_TOOL,bin2c,VBoxSDL,$<,$@)
|
---|
107 | $(QUIET)$(VBOX_BIN2C) Ico64x01 $< $@
|
---|
108 |
|
---|
109 | ifdef VBOX_WITH_HARDENING
|
---|
110 | $(call VBOX_SET_VER_INFO_DLL,VBoxSDL,VirtualBox Pure SDL Frontend,$(VBOX_WINDOWS_ICON_FILE)) # Version info / description.
|
---|
111 | else
|
---|
112 | $(call VBOX_SET_VER_INFO_EXE,VBoxSDL,VirtualBox Pure SDL Frontend,$(VBOX_WINDOWS_ICON_FILE)) # Version info / description.
|
---|
113 | endif
|
---|
114 |
|
---|
115 |
|
---|
116 | #
|
---|
117 | # tstSDL
|
---|
118 | #
|
---|
119 | PROGRAMS += tstSDL
|
---|
120 | tstSDL_TEMPLATE = VBOXR3NPEXE
|
---|
121 | tstSDL_SDKS = LIBSDL
|
---|
122 | tstSDL_INST = $(INST_TESTCASE)
|
---|
123 | tstSDL_SOURCES = \
|
---|
124 | VBoxSDLTest.cpp
|
---|
125 | tstSDL_SOURCES.darwin = \
|
---|
126 | VBoxSDLMain-darwin.m
|
---|
127 | tstSDL_DEFS = IN_RING3 IN_RT_R3 _GNU_SOURCE
|
---|
128 | tstSDL_DEFS.win.x86 = _WIN32_WINNT=0x0500
|
---|
129 | ifdef VBOX_OPENGL
|
---|
130 | tstSDL_DEFS.linux = VBOX_OPENGL
|
---|
131 | endif
|
---|
132 |
|
---|
133 | tstSDL_LIBS = \
|
---|
134 | $(LIB_RUNTIME)
|
---|
135 | ifneq ($(filter-out win solaris,$(KBUILD_TARGET)),)
|
---|
136 | tstSDL_LIBS += \
|
---|
137 | $(LIB_SDK_LIBSDL_SDLMAIN)
|
---|
138 | endif
|
---|
139 |
|
---|
140 | ifdef VBOX_OPENGL
|
---|
141 | tstSDL_LIBS.linux += GL
|
---|
142 | endif
|
---|
143 | ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11
|
---|
144 | tstSDL_LIBPATH = \
|
---|
145 | $(VBOX_LIBPATH_X11)
|
---|
146 | endif
|
---|
147 |
|
---|
148 | tstSDL_LDFLAGS.darwin = \
|
---|
149 | -framework Foundation -framework AppKit
|
---|
150 |
|
---|
151 | ## @todo What was this stuff doing here? The exception config is saying two different things, and why just -O for release builds?
|
---|
152 | #tstSDL_CXXFLAGS.win = \
|
---|
153 | # -EHsc
|
---|
154 | #tstSDL_CXXFLAGS.linux = \
|
---|
155 | # -DNDEBUG -DTRIMMED -O -Wall -fno-rtti -fno-exceptions \
|
---|
156 | # -Wno-non-virtual-dtor -Wno-long-long -fshort-wchar -pthread -pipe
|
---|
157 | # Is this what's intended? Why -fshort-wchar?
|
---|
158 | tstSDL_DEFS.linux = NDEBUG TRIMMED
|
---|
159 | tstSDL_CXXFLAGS.linux = -O -Wall -Wno-non-virtual-dtor -Wno-long-long -fshort-wchar
|
---|
160 |
|
---|
161 |
|
---|
162 | endif # !VBOX_WITH_HARDENING || "$(KBUILD_TARGET)" != "darwin"
|
---|
163 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|