1 | # $Id: Makefile.kmk 35385 2010-12-30 16:35:31Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for VBoxSDL (a simple frontend based on SDL).
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2006-2007 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_NAME = VBoxSDL
|
---|
40 |
|
---|
41 |
|
---|
42 | #
|
---|
43 | # VBoxSDL
|
---|
44 | #
|
---|
45 | VBoxSDL_TEMPLATE := $(if $(VBOX_WITH_HARDENING),VBOXMAINCLIENTDLL,VBOXMAINCLIENTEXE)
|
---|
46 | VBoxSDL_SDKS = LIBSDL
|
---|
47 | VBoxSDL_SOURCES = \
|
---|
48 | VBoxSDL.cpp \
|
---|
49 | Framebuffer.cpp \
|
---|
50 | Helper.cpp
|
---|
51 | VBoxSDL_SOURCES.darwin = \
|
---|
52 | VBoxSDLMain-darwin.m
|
---|
53 |
|
---|
54 | VBoxSDL_DEFS =
|
---|
55 | ifdef VBOX_WITH_SDL13
|
---|
56 | VBoxSDL_DEFS += VBOX_WITH_SDL13
|
---|
57 | else
|
---|
58 | ifdef VBOX_WITH_SECURELABEL
|
---|
59 | VBoxSDL_DEFS += VBOX_SECURELABEL
|
---|
60 | endif
|
---|
61 | endif
|
---|
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 | ifndef VBOX_OSE
|
---|
69 | # disable for now as this customer-specific GUI
|
---|
70 | # VBoxSDL_DEFS.win = VBOX_WIN32_UI
|
---|
71 | endif
|
---|
72 | VBoxSDL_DEFS.win.x86 = _WIN32_WINNT=0x0500
|
---|
73 | VBoxSDL_DEFS.win.amd64 = _WIN32_WINNT=0x0510
|
---|
74 |
|
---|
75 | VBoxSDL_INCS = \
|
---|
76 | $(VBoxSDL_0_OUTDIR)
|
---|
77 | ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11
|
---|
78 | VBoxSDL_INCS += \
|
---|
79 | $(VBOX_XCURSOR_INCS)
|
---|
80 | endif
|
---|
81 | ifneq ($(filter-out win solaris,$(KBUILD_TARGET)),)
|
---|
82 |
|
---|
83 | VBoxSDL_LIBS = \
|
---|
84 | $(LIB_SDK_LIBSDL_SDLMAIN)
|
---|
85 | endif
|
---|
86 | ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11
|
---|
87 | VBoxSDL_LIBS += \
|
---|
88 | $(PATH_DLL)/VBoxKeyboard$(VBOX_SUFF_DLL) \
|
---|
89 | $(VBOX_XCURSOR_LIBS) \
|
---|
90 | X11
|
---|
91 | VBoxSDL_LIBPATH = \
|
---|
92 | $(VBOX_LIBPATH_X11)
|
---|
93 | endif
|
---|
94 | ifdef VBOX_OPENGL
|
---|
95 | #VBoxSDL_LIBS.linux += GL
|
---|
96 | endif
|
---|
97 |
|
---|
98 | VBoxSDL_LDFLAGS.darwin = \
|
---|
99 | -framework Foundation -framework AppKit
|
---|
100 |
|
---|
101 | VBoxSDL_CLEAN = $(VBoxSDL_0_OUTDIR)/Ico64x01.h
|
---|
102 | VBoxSDL_INTERMEDIATES = $(VBoxSDL_0_OUTDIR)/Ico64x01.h
|
---|
103 |
|
---|
104 |
|
---|
105 | # Convert the pnm-file to a byte array.
|
---|
106 | $$(VBoxSDL_0_OUTDIR)/Ico64x01.h: $(PATH_ROOT)/src/VBox/Frontends/VBoxSDL/ico64x01.pnm $(VBOX_BIN2C) | $$(dir $$@)
|
---|
107 | $(call MSG_TOOL,bin2c,VBoxSDL,$<,$@)
|
---|
108 | $(QUIET)$(VBOX_BIN2C) Ico64x01 $< $@
|
---|
109 |
|
---|
110 | # Icon include file.
|
---|
111 | $$(VBoxSDL_0_OUTDIR)/VBoxSDL-icon.rc: $(VBOX_WINDOWS_ICON_FILE) $$(VBoxSDL_DEFPATH)/Makefile.kmk | $$(dir $$@)
|
---|
112 | $(RM) -f $@
|
---|
113 | $(APPEND) $@ 'IDI_VIRTUALBOX ICON DISCARDABLE "$(subst /,\\,$(VBOX_WINDOWS_ICON_FILE))"'
|
---|
114 |
|
---|
115 |
|
---|
116 |
|
---|
117 | #
|
---|
118 | # tstSDL
|
---|
119 | #
|
---|
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 $(KBUILD_PATH)/subfooter.kmk
|
---|
164 |
|
---|