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