1 | # $Id: Makefile.kmk 12712 2008-09-25 09:35:25Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for VBoxSDL (a simple frontend based on SDL).
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2006-2007 Sun Microsystems, Inc.
|
---|
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 | # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
18 | # Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
19 | # additional information or have any questions.
|
---|
20 | #
|
---|
21 |
|
---|
22 | SUB_DEPTH = ../../../..
|
---|
23 | include $(KBUILD_PATH)/subheader.kmk
|
---|
24 | if !defined(VBOX_WITH_HARDENING) || "$(KBUILD_TARGET)" != "darwin" # No hardened VBoxSDL on darwin.
|
---|
25 |
|
---|
26 | #
|
---|
27 | # Targets.
|
---|
28 | #
|
---|
29 | ifdef VBOX_WITH_HARDENING
|
---|
30 | PROGRAMS += VBoxSDLHardened
|
---|
31 | DLLS += VBoxSDL
|
---|
32 | else
|
---|
33 | PROGRAMS += VBoxSDL
|
---|
34 | endif
|
---|
35 | PROGRAMS += tstSDL
|
---|
36 |
|
---|
37 |
|
---|
38 | #
|
---|
39 | # Hardened VBoxSDL
|
---|
40 | #
|
---|
41 | VBoxSDLHardened_TEMPLATE = VBOXR3HARDENEDEXE
|
---|
42 | VBoxSDLHardened_SOURCES = VBoxSDLHardened.cpp
|
---|
43 | VBoxSDLHardened_NAME = VBoxSDL
|
---|
44 |
|
---|
45 |
|
---|
46 | #
|
---|
47 | # VBoxSDL
|
---|
48 | #
|
---|
49 | VBoxSDL_TEMPLATE := $(if $(VBOX_WITH_HARDENING),VBOXMAINCLIENTDLL,VBOXMAINCLIENTEXE)
|
---|
50 | VBoxSDL_SDKS = LIBSDL
|
---|
51 | VBoxSDL_SOURCES = \
|
---|
52 | VBoxSDL.cpp \
|
---|
53 | Framebuffer.cpp \
|
---|
54 | Helper.cpp
|
---|
55 | VBoxSDL_SOURCES.darwin = \
|
---|
56 | VBoxSDLMain-darwin.m
|
---|
57 | ifndef VBOX_OSE
|
---|
58 | VBoxSDL_SOURCES.win = \
|
---|
59 | win32/WinUI.cpp \
|
---|
60 | win32/TitlebarButtons.cpp \
|
---|
61 | win32/VBoxSDL.rc
|
---|
62 | win32/VBoxSDL.rc_INCS = $(PATH_VBoxSDL)
|
---|
63 | win32/VBoxSDL.rc_DEPS = $(PATH_VBoxSDL)/VBoxSDL-icon.rc
|
---|
64 | win32/VBoxSDL.rc_CLEAN = $(PATH_VBoxSDL)/VBoxSDL-icon.rc
|
---|
65 | endif
|
---|
66 |
|
---|
67 | VBoxSDL_DEFS =
|
---|
68 | ifdef VBOX_WITH_SECURELABEL
|
---|
69 | VBoxSDL_DEFS += VBOX_SECURELABEL
|
---|
70 | endif
|
---|
71 | ifdef VBOX_WITH_VRDP
|
---|
72 | VBoxSDL_DEFS += VBOX_WITH_VRDP
|
---|
73 | endif
|
---|
74 | VBoxSDL_DEFS.freebsd = VBOXSDL_WITH_X11
|
---|
75 | VBoxSDL_DEFS.linux = _GNU_SOURCE VBOXSDL_WITH_X11
|
---|
76 | VBoxSDL_DEFS.solaris = VBOXSDL_WITH_X11
|
---|
77 | ifdef VBOX_OPENGL
|
---|
78 | #VBoxSDL_DEFS.linux += VBOX_OPENGL
|
---|
79 | endif
|
---|
80 | ifndef VBOX_OSE
|
---|
81 | # disable for now as this customer-specific GUI
|
---|
82 | # VBoxSDL_DEFS.win = VBOX_WIN32_UI
|
---|
83 | endif
|
---|
84 | VBoxSDL_DEFS.win.x86 = _WIN32_WINNT=0x0500
|
---|
85 | VBoxSDL_DEFS.win.amd64 = _WIN32_WINNT=0x0510
|
---|
86 |
|
---|
87 | VBoxSDL_INCS = \
|
---|
88 | $(PATH_VBoxSDL)
|
---|
89 | ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11
|
---|
90 | VBoxSDL_INCS += \
|
---|
91 | $(VBOX_XCURSOR_INCS)
|
---|
92 | endif
|
---|
93 | VBoxSDL_INCS.freebsd = \
|
---|
94 | /usr/include \
|
---|
95 | /usr/local/include \
|
---|
96 | /usr/X11R6/include ## @todo figure this out.
|
---|
97 | ifneq ($(filter-out win solaris,$(KBUILD_TARGET)),)
|
---|
98 |
|
---|
99 | VBoxSDL_LIBS = \
|
---|
100 | $(LIB_SDK_LIBSDL_SDLMAIN)
|
---|
101 | endif
|
---|
102 | ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11
|
---|
103 | VBoxSDL_LIBS += \
|
---|
104 | $(VBOX_XCURSOR_LIBS) \
|
---|
105 | X11
|
---|
106 | VBoxSDL_LIBPATH = \
|
---|
107 | $(VBOX_LIBPATH_X11)
|
---|
108 | endif
|
---|
109 | ifdef VBOX_OPENGL
|
---|
110 | #VBoxSDL_LIBS.linux += GL
|
---|
111 | endif
|
---|
112 |
|
---|
113 | VBoxSDL_LDFLAGS.darwin = \
|
---|
114 | -framework Foundation -framework AppKit
|
---|
115 |
|
---|
116 | VBoxSDL_CLEAN = $(PATH_VBoxSDL)/Ico64x01.h
|
---|
117 | VBoxSDL_INTERMEDIATES = $(PATH_VBoxSDL)/Ico64x01.h
|
---|
118 |
|
---|
119 |
|
---|
120 | # Convert the pnm-file to a byte array.
|
---|
121 | $$(PATH_VBoxSDL)/Ico64x01.h: $(PATH_ROOT)/src/VBox/Frontends/VBoxSDL/ico64x01.pnm $(VBOX_BIN2C) | $$(dir $$@)
|
---|
122 | $(call MSG_TOOL,bin2c,VBoxSDL,$<,$@)
|
---|
123 | $(QUIET)$(VBOX_BIN2C) Ico64x01 $< $@
|
---|
124 |
|
---|
125 | # Icon include file.
|
---|
126 | $$(PATH_VBoxSDL)/VBoxSDL-icon.rc: $(VBOX_WINDOWS_ICON_FILE) $$(VBoxSDL_PATH)/Makefile.kmk | $$(dir $$@)
|
---|
127 | $(RM) -f $@
|
---|
128 | $(APPEND) $@ 'IDI_VIRTUALBOX ICON DISCARDABLE "$(subst /,\\,$(VBOX_WINDOWS_ICON_FILE))"'
|
---|
129 |
|
---|
130 |
|
---|
131 |
|
---|
132 | #
|
---|
133 | # tstSDL
|
---|
134 | #
|
---|
135 | tstSDL_TEMPLATE = VBOXR3NPEXE
|
---|
136 | tstSDL_SDKS = LIBSDL
|
---|
137 | tstSDL_INST = $(INST_TESTCASE)
|
---|
138 | tstSDL_SOURCES = \
|
---|
139 | VBoxSDLTest.cpp
|
---|
140 | tstSDL_SOURCES.darwin = \
|
---|
141 | VBoxSDLMain-darwin.m
|
---|
142 | tstSDL_DEFS = IN_RING3 IN_RT_R3 _GNU_SOURCE
|
---|
143 | tstSDL_DEFS.win.x86 = _WIN32_WINNT=0x0500
|
---|
144 | ifdef VBOX_OPENGL
|
---|
145 | tstSDL_DEFS.linux = VBOX_OPENGL
|
---|
146 | endif
|
---|
147 | tstSDL_INCS = \
|
---|
148 | $(PATH_tstSDL)
|
---|
149 |
|
---|
150 | tstSDL_LIBS = \
|
---|
151 | $(LIB_RUNTIME)
|
---|
152 | ifneq ($(filter-out win solaris,$(KBUILD_TARGET)),)
|
---|
153 | tstSDL_LIBS += \
|
---|
154 | $(LIB_SDK_LIBSDL_SDLMAIN)
|
---|
155 | endif
|
---|
156 |
|
---|
157 | ifdef VBOX_OPENGL
|
---|
158 | tstSDL_LIBS.linux += GL
|
---|
159 | endif
|
---|
160 | ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11
|
---|
161 | tstSDL_LIBPATH = \
|
---|
162 | $(VBOX_LIBPATH_X11)
|
---|
163 | tstSDL_INCS.freebsd = \
|
---|
164 | /usr/include \
|
---|
165 | /usr/local/include \
|
---|
166 | /usr/X11R6/include ## @todo figure this out.
|
---|
167 | endif
|
---|
168 |
|
---|
169 | tstSDL_LDFLAGS.darwin = \
|
---|
170 | -framework Foundation -framework AppKit
|
---|
171 |
|
---|
172 | tstSDL_CXXFLAGS.win = \
|
---|
173 | -EHsc
|
---|
174 | tstSDL_CXXFLAGS.linux = \
|
---|
175 | -DNDEBUG -DTRIMMED -O -Wall -fno-rtti -fno-exceptions \
|
---|
176 | -Wno-non-virtual-dtor -Wno-long-long -fshort-wchar -pthread -pipe
|
---|
177 |
|
---|
178 |
|
---|
179 | endif # !VBOX_WITH_HARDENING || "$(KBUILD_TARGET)" != "darwin"
|
---|
180 | include $(KBUILD_PATH)/subfooter.kmk
|
---|
181 |
|
---|