VirtualBox

source: vbox/trunk/src/VBox/Additions/common/VBoxGuest/Makefile.kmk@ 47631

Last change on this file since 47631 was 45459, checked in by vboxsync, 12 years ago

BUGZ:4686 OS X guest: VBoxGuest device driver + VBoxService and VBoxControl now work.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 8.9 KB
Line 
1# $Id: Makefile.kmk 45459 2013-04-10 15:24:23Z vboxsync $
2## @file
3# Makefile for the Cross Platform Guest Additions Driver.
4#
5
6#
7# Copyright (C) 2007-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
18SUB_DEPTH = ../../../../..
19include $(KBUILD_PATH)/subheader.kmk
20
21
22if1of ($(KBUILD_TARGET), darwin freebsd haiku $(if $(defined VBOX_WITH_ADDITION_DRIVERS),linux,) os2 solaris win)
23 #
24 # VBoxGuest - The Guest Additions Driver.
25 #
26 SYSMODS += VBoxGuest
27 VBoxGuest_TEMPLATE = VBOXGUESTR0
28 VBoxGuest_NAME.freebsd = vboxguest
29 VBoxGuest_NAME.haiku = vboxguest
30 VBoxGuest_NAME.linux = vboxguest
31 VBoxGuest_NAME.solaris = vboxguest
32 VBoxGuest_INST.darwin = $(INST_ADDITIONS)VBoxGuest.kext/Contents/MacOS/
33 ifdef VBOX_SIGN_ADDITIONS # See Additions/WINNT/Makefile.kmk?
34 VBoxGuest_INSTTYPE.win = none
35 VBoxGuest_DEBUG_INSTTYPE.win = both
36 endif
37 VBoxGuest_DEFS.haiku = VBOX_SVN_REV=$(VBOX_SVN_REV) _KERNEL_MODE=1
38 VBoxGuest_DEFS.linux = KBUILD_MODNAME=KBUILD_STR\(vboxguest\) KBUILD_BASENAME=KBUILD_STR\(vboxguest\) DEBUG_HASH=2 DEBUG_HASH2=3 EXPORT_SYMTAB
39 VBoxGuest_DEFS.solaris = VBOX_SVN_REV=$(VBOX_SVN_REV)
40 VBoxGuest_DEFS.win = # VBOX_WITH_VRDP_SESSION_HANDLING
41 ifeq ($(KBUILD_TYPE),release)
42 # Allow stopping/removing the driver without a reboot
43 # in debug mode; this is very useful for testing the shutdown stuff!
44 VBoxGuest_DEFS.win += VBOX_REBOOT_ON_UNINSTALL
45 endif
46 ifdef VBOX_WITH_GUEST_BUGCHECK_DETECTION
47 VBoxGuest_DEFS.win += VBOX_WITH_GUEST_BUGCHECK_DETECTION
48 endif
49 #VBoxGuest_DEFS.win += LOG_ENABLED LOG_TO_BACKDOOR
50 VBoxGuest_DEFS.win += \
51 $(if $(VBOX_WITH_DPC_LATENCY_CHECKER),VBOX_WITH_DPC_LATENCY_CHECKER,)
52 VBoxGuest_DEPS.solaris += $(VBOX_SVN_REV_KMK)
53 VBoxGuest_DEPS.linux += $(VBOX_SVN_REV_HEADER)
54 VBoxGuest_DEPS.haiku += $(VBOX_SVN_REV_HEADER)
55 VBoxGuest_DEPS.freebsd += $(VBOX_SVN_REV_HEADER)
56 VBoxGuest_DEPS.darwin += $(VBOX_SVN_REV_HEADER)
57 VBoxGuest_DEFS = VBGL_VBOXGUEST VBOX_WITH_HGCM
58 VBoxGuest_INCS = .
59 VBoxGuest_INCS.freebsd = $(VBoxGuest_0_OUTDIR) $(PATH_STAGE)/gen-sys-hdrs
60 VBoxGuest_INCS.linux = ../../../Runtime/r0drv/linux
61 ifeq ($(KBUILD_HOST),solaris)
62 VBoxGuest_LDFLAGS.solaris += -N misc/ctf
63 else
64 VBoxGuest_SOURCES.solaris = solaris/deps.asm
65 VBoxGuest_solaris/deps.asm_ASFLAGS = -f bin -g null
66 endif
67 ifneq ($(KBUILD_TARGET),os2)
68 ifeq ($(KBUILD_TARGET),win)
69 VBoxGuest_LDFLAGS.x86 = -Entry:DriverEntry@8
70 VBoxGuest_LDFLAGS.amd64 = -Entry:DriverEntry
71 VBoxGuest_LIBS = \
72 $(PATH_SDK_$(VBOX_WINDDK_GST)_LIB)/ntoskrnl.lib \
73 $(PATH_SDK_$(VBOX_WINDDK_GST)_LIB)/hal.lib
74 ifdef VBOX_WITH_GUEST_BUGCHECK_DETECTION
75 VBoxGuest_LIBS += \
76 $(PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB)/aux_klib.lib \
77 $(PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB)/ksecdd.lib \
78 $(PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB)/BufferOverflowK.lib
79 VBoxGuest.cpp_SDKS = $(VBOX_WINDDK_GST_WLH)
80 endif
81 endif # win
82 ifn1of ($(KBUILD_TARGET), linux freebsd solaris haiku)
83 VBoxGuest_SOURCES = VBoxGuest-$(KBUILD_TARGET).cpp
84 else
85 VBoxGuest_SOURCES = VBoxGuest-$(KBUILD_TARGET).c
86 endif
87 VBoxGuest_SOURCES += \
88 VBoxGuest.cpp \
89 VBoxGuest2.cpp
90 ifeq ($(KBUILD_TARGET), win)
91 VBoxGuest_SOURCES += \
92 VBoxGuest-$(KBUILD_TARGET)-pnp.cpp \
93 win/VBoxGuest.rc
94 endif
95 VBoxGuest_LIBS += \
96 $(VBOX_LIB_VBGL_R0BASE) \
97 $(VBOX_LIB_IPRT_GUEST_R0)
98 VBoxGuest_ORDERDEPS.freebsd = \
99 $(PATH_STAGE)/gen-sys-hdrs/pci_if.h \
100 $(PATH_STAGE)/gen-sys-hdrs/bus_if.h \
101 $(PATH_STAGE)/gen-sys-hdrs/device_if.h
102 ifeq ($(KBUILD_TARGET),haiku)
103 # Haiku drivers cannot export symbols for other drivers, but modules can.
104 # Therefore vboxguest is a module containing the ring-0 guest lib, and vboxdev/vboxsf
105 # use this module to access the guest lib
106 SYSMODS += VBoxDev
107 VBoxDev_TEMPLATE = VBOXGUESTR0
108 VBoxDev_NAME = vboxdev
109 VBoxDev_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV) _KERNEL_MODE=1 VBGL_VBOXGUEST VBOX_WITH_HGCM IN_RING0
110 VBoxDev_SOURCES = VBoxDev-haiku.c VBoxGuest-haiku-stubs.c
111 endif
112 else # OS/2:
113 # The library order is crucial, so a bit of trickery is necessary.
114 # A library is used to make sure that VBoxGuestA-os2.asm is first in the link. (temporary hack?)
115 VBoxGuest_SOURCES = \
116 VBoxGuestA-os2.asm \
117 VBoxGuest-os2.def
118 #VBoxGuest_LDFLAGS = -s -t -v
119 VBoxGuest_LIBS = \
120 $(TARGET_VBoxGuestLibOs2Hack) \
121 $(VBOX_LIB_VBGL_R0BASE) \
122 $(VBOX_LIB_IPRT_GUEST_R0) \
123 $(VBOX_GCC_LIBGCC) \
124 end
125 ## When debugging init with kDrvTest:
126 #VBoxGuest_NAME = VBoxGst
127
128 # see
129 LIBRARIES += VBoxGuestLibOs2Hack
130 VBoxGuestLibOs2Hack_TEMPLATE = VBOXGUESTR0LIB
131 VBoxGuestLibOs2Hack_INSTTYPE = none
132 VBoxGuestLibOs2Hack_DEFS = $(VBoxGuest_DEFS)
133 VBoxGuestLibOs2Hack_INCS = \
134 . \
135 $(PATH_ROOT)/src/VBox/Runtime/include # for the os2ddk
136 VBoxGuestLibOs2Hack_SOURCES = \
137 VBoxGuest-os2.cpp \
138 VBoxGuest.cpp \
139 VBoxGuest2.cpp
140 endif # OS/2
141
142 VBoxGuest2.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
143 VBoxGuest.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
144
145 ifeq ($(KBUILD_TARGET),win)
146 #
147 # Windows NT4 driver.
148 #
149 SYSMODS.x86 += VBoxGuestNT
150 VBoxGuestNT_EXTENDS = VBoxGuest
151 VBoxGuestNT_INSTTYPE.win = both
152 VBoxGuestNT_SDKS = ReorderCompilerIncs $(VBOX_WINDDK_GST_NT4)
153 VBoxGuestNT_DEFS = $(VBoxGuest_DEFS) TARGET_NT4
154 VBoxGuestNT_SOURCES = \
155 VBoxGuest.cpp \
156 VBoxGuest2.cpp \
157 VBoxGuest-$(KBUILD_TARGET).cpp \
158 VBoxGuest-$(KBUILD_TARGET)-legacy.cpp \
159 win/VBoxGuest.rc
160 VBoxGuestNT_LIBS = \
161 $(PATH_SDK_$(VBOX_WINDDK_GST_NT4)_LIB)/exsup.lib \
162 $(PATH_SDK_$(VBOX_WINDDK_GST_NT4)_LIB)/ntoskrnl.lib \
163 $(PATH_SDK_$(VBOX_WINDDK_GST_NT4)_LIB)/hal.lib \
164 $(VBOX_LIB_VBGL_R0BASE) \
165 $(VBOX_LIB_IPRT_GUEST_R0_NT4)
166 endif # win
167endif # enabled
168
169
170ifeq ($(KBUILD_TARGET), darwin)
171 # Files necessary to make a darwin kernel extension bundle.
172 INSTALLS += VBoxGuest.kext
173 VBoxGuest.kext_INST = $(INST_ADDITIONS)/VBoxGuest.kext/Contents/
174 VBoxGuest.kext_SOURCES = $(VBoxGuest.kext_0_OUTDIR)/Info.plist
175 VBoxGuest.kext_CLEAN = $(VBoxGuest.kext_0_OUTDIR)/Info.plist
176
177$$(VBoxGuest.kext_0_OUTDIR)/Info.plist: \
178 $(PATH_SUB_CURRENT)/darwin/Info.plist \
179 $(VBOX_VERSION_MK) | $$(dir $$@)
180 $(call MSG_GENERATE,VBoxGuest,$@,$<)
181 $(QUIET)$(RM) -f $@
182 $(QUIET)$(SED) \
183 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
184 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
185 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
186 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
187 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
188 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
189 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
190 --output $@ \
191 $<
192endif # darwin
193
194
195ifeq ($(KBUILD_TARGET),linux)
196 #
197 # Install the source files and script(s).
198 #
199 include $(PATH_SUB_CURRENT)/linux/files_vboxguest
200 # sources and stuff.
201 INSTALLS += vboxguest-src
202 vboxguest-src_INST = $(INST_ADDITIONS)src/vboxguest/
203 vboxguest-src_MODE = a+r,u+w
204 vboxguest-src_SOURCES = $(subst ",,$(FILES_VBOXGUEST_NOBIN))
205
206 INSTALLS += vboxguest-conf
207 vboxguest-conf_INST = $(INST_ADDITIONS)src/
208 vboxguest-conf_MODE = a+r,u+w
209 vboxguest-conf_SOURCES = $(vboxguest-sh_0_OUTDIR)/dkms.conf
210 vboxguest-conf_CLEAN = $(vboxguest-sh_0_OUTDIR)/dkms.conf
211
212 INSTALLS += vboxguest-scripts
213 vboxguest-scripts_INST = $(INST_ADDITIONS)src/
214 vboxguest-scripts_MODE = a+rx,u+w
215 vboxguest-scripts_SOURCES = ../../../HostDrivers/linux/do_dkms \
216 ../../../HostDrivers/linux/build_in_tmp
217
218 $$(vboxguest-sh_0_OUTDIR)/dkms.conf: \
219 $(PATH_SUB_CURRENT)/linux/dkms.conf \
220 $(VBOX_VERSION_STAMP) \
221 | $$(dir $$@)
222 $(call MSG_TOOL,Creating,,$@)
223 $(QUIET)$(SED) \
224 -e "s;_VERSION_;${VBOX_VERSION_STRING};g" \
225 -e "s;_BUILDTYPE_;$(KBUILD_TYPE);g" \
226 --output $@ $<
227
228 # scripts.
229 INSTALLS += vboxguest-sh
230 vboxguest-sh_INST = $(INST_ADDITIONS)src/vboxguest/
231 vboxguest-sh_MODE = a+rx,u+w
232 vboxguest-sh_SOURCES = $(subst ",,$(FILES_VBOXGUEST_BIN))
233 vboxguest-sh_SOURCES += $(PATH_ROOT)/src/VBox/HostDrivers/linux/do_Module.symvers
234
235endif # Linux
236
237ifeq ($(KBUILD_TARGET),freebsd)
238 #
239 # Install the source files and script(s).
240 #
241 include $(PATH_SUB_CURRENT)/freebsd/files_vboxguest
242 # sources and stuff.
243 INSTALLS += vboxguest-src
244 vboxguest-src_INST = $(INST_ADDITIONS)src/vboxguest/
245 vboxguest-src_MODE = a+r,u+w
246 vboxguest-src_SOURCES = $(subst ",,$(FILES_VBOXGUEST_NOBIN))
247
248endif # FreeBSD
249
250ifeq ($(KBUILD_TARGET),win)
251#
252# VBoxGuestInst - The installer.
253#
254#PROGRAMS += VBoxGuestInst
255VBoxGuestInst_TEMPLATE= NewVBoxGuestR3Exe
256VBoxGuestInst_SOURCES = win/VBoxGuestInst.cpp
257endif
258
259include $(FILE_KBUILD_SUB_FOOTER)
260
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette