VirtualBox

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

Last change on this file since 48938 was 48034, checked in by vboxsync, 11 years ago

Guest Additions: add release logger to VBoxGuest driver (enabled for darwin only); make VBoxGuest.kext workable on 64 bit system.

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