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