1 | # $Id: Makefile.kmk 51894 2014-07-06 22:05:09Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for VBoxSDL (a simple frontend based on SDL).
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2006-2012 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 | # Targets.
|
---|
24 | #
|
---|
25 | ifdef VBOX_WITH_HARDENING
|
---|
26 | PROGRAMS += VBoxSDLHardened
|
---|
27 | DLLS += VBoxSDL
|
---|
28 | else
|
---|
29 | PROGRAMS += VBoxSDL
|
---|
30 | endif
|
---|
31 | PROGRAMS += tstSDL
|
---|
32 |
|
---|
33 |
|
---|
34 | #
|
---|
35 | # Hardened VBoxSDL
|
---|
36 | #
|
---|
37 | VBoxSDLHardened_TEMPLATE = VBOXR3HARDENEDEXE
|
---|
38 | VBoxSDLHardened_SOURCES = VBoxSDLHardened.cpp
|
---|
39 | VBoxSDLHardened_SOURCES.win = $(VBoxSDL_0_OUTDIR)/VBoxSDL-icon.rc
|
---|
40 | VBoxSDLHardened_NAME = VBoxSDL
|
---|
41 |
|
---|
42 |
|
---|
43 | #
|
---|
44 | # VBoxSDL
|
---|
45 | #
|
---|
46 | VBoxSDL_TEMPLATE := $(if $(VBOX_WITH_HARDENING),VBOXMAINCLIENTDLL,VBOXMAINCLIENTEXE)
|
---|
47 | VBoxSDL_SDKS = LIBSDL
|
---|
48 | VBoxSDL_SOURCES = \
|
---|
49 | VBoxSDL.cpp \
|
---|
50 | Framebuffer.cpp \
|
---|
51 | Helper.cpp
|
---|
52 | VBoxSDL_SOURCES.darwin = \
|
---|
53 | VBoxSDLMain-darwin.m
|
---|
54 |
|
---|
55 | VBoxSDL_DEFS =
|
---|
56 | ifdef VBOX_WITH_SDL13
|
---|
57 | VBoxSDL_DEFS += VBOX_WITH_SDL13
|
---|
58 | else
|
---|
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 | ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11
|
---|
75 | VBoxSDL_INCS += \
|
---|
76 | $(VBOX_XCURSOR_INCS)
|
---|
77 | endif
|
---|
78 | ifneq ($(filter-out win solaris,$(KBUILD_TARGET)),)
|
---|
79 |
|
---|
80 | VBoxSDL_LIBS = \
|
---|
81 | $(LIB_SDK_LIBSDL_SDLMAIN)
|
---|
82 | endif
|
---|
83 | ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # 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.darwin = \
|
---|
96 | -framework Foundation -framework AppKit
|
---|
97 |
|
---|
98 | VBoxSDL_CLEAN = $(VBoxSDL_0_OUTDIR)/Ico64x01.h
|
---|
99 | VBoxSDL_INTERMEDIATES = $(VBoxSDL_0_OUTDIR)/Ico64x01.h
|
---|
100 |
|
---|
101 |
|
---|
102 | # Convert the pnm-file to a byte array.
|
---|
103 | $$(VBoxSDL_0_OUTDIR)/Ico64x01.h: $(PATH_ROOT)/src/VBox/Frontends/VBoxSDL/ico64x01.pnm $(VBOX_BIN2C) | $$(dir $$@)
|
---|
104 | $(call MSG_TOOL,bin2c,VBoxSDL,$<,$@)
|
---|
105 | $(QUIET)$(VBOX_BIN2C) Ico64x01 $< $@
|
---|
106 |
|
---|
107 | # Icon include file.
|
---|
108 | $$(VBoxSDL_0_OUTDIR)/VBoxSDL-icon.rc: $(VBOX_WINDOWS_ICON_FILE) $$(VBoxSDL_DEFPATH)/Makefile.kmk | $$(dir $$@)
|
---|
109 | $(RM) -f $@
|
---|
110 | $(APPEND) $@ 'IDI_VIRTUALBOX ICON DISCARDABLE "$(subst /,\\,$(VBOX_WINDOWS_ICON_FILE))"'
|
---|
111 |
|
---|
112 |
|
---|
113 |
|
---|
114 | #
|
---|
115 | # tstSDL
|
---|
116 | #
|
---|
117 | tstSDL_TEMPLATE = VBOXR3NPEXE
|
---|
118 | tstSDL_SDKS = LIBSDL
|
---|
119 | tstSDL_INST = $(INST_TESTCASE)
|
---|
120 | tstSDL_SOURCES = \
|
---|
121 | VBoxSDLTest.cpp
|
---|
122 | tstSDL_SOURCES.darwin = \
|
---|
123 | VBoxSDLMain-darwin.m
|
---|
124 | tstSDL_DEFS = IN_RING3 IN_RT_R3 _GNU_SOURCE
|
---|
125 | tstSDL_DEFS.win.x86 = _WIN32_WINNT=0x0500
|
---|
126 | ifdef VBOX_OPENGL
|
---|
127 | tstSDL_DEFS.linux = VBOX_OPENGL
|
---|
128 | endif
|
---|
129 |
|
---|
130 | tstSDL_LIBS = \
|
---|
131 | $(LIB_RUNTIME)
|
---|
132 | ifneq ($(filter-out win solaris,$(KBUILD_TARGET)),)
|
---|
133 | tstSDL_LIBS += \
|
---|
134 | $(LIB_SDK_LIBSDL_SDLMAIN)
|
---|
135 | endif
|
---|
136 |
|
---|
137 | ifdef VBOX_OPENGL
|
---|
138 | tstSDL_LIBS.linux += GL
|
---|
139 | endif
|
---|
140 | ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11
|
---|
141 | tstSDL_LIBPATH = \
|
---|
142 | $(VBOX_LIBPATH_X11)
|
---|
143 | endif
|
---|
144 |
|
---|
145 | tstSDL_LDFLAGS.darwin = \
|
---|
146 | -framework Foundation -framework AppKit
|
---|
147 |
|
---|
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 |
|
---|
159 | endif # !VBOX_WITH_HARDENING || "$(KBUILD_TARGET)" != "darwin"
|
---|
160 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
161 |
|
---|