1 | # $Id: Makefile.kmk 63339 2016-08-11 13:02:31Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Makefile for the Cross Platform Guest Additions Driver.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2007-2016 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 |
|
---|
18 | SUB_DEPTH = ../../../../..
|
---|
19 | include $(KBUILD_PATH)/subheader.kmk
|
---|
20 |
|
---|
21 |
|
---|
22 | if1of ($(KBUILD_TARGET), darwin freebsd haiku $(if $(defined VBOX_WITH_ADDITION_DRIVERS),linux,) netbsd 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.netbsd = vboxguest
|
---|
32 | VBoxGuest_NAME.solaris = vboxguest
|
---|
33 | VBoxGuest_INST.darwin = $(INST_ADDITIONS)VBoxGuest.kext/Contents/MacOS/
|
---|
34 | ifdef VBOX_SIGN_ADDITIONS # See Additions/WINNT/Makefile.kmk?
|
---|
35 | VBoxGuest_INSTTYPE.win = none
|
---|
36 | VBoxGuest_DEBUG_INSTTYPE.win = both
|
---|
37 | endif
|
---|
38 | VBoxGuest_DEFS.haiku = VBOX_SVN_REV=$(VBOX_SVN_REV) _KERNEL_MODE=1
|
---|
39 | VBoxGuest_DEFS.linux = KBUILD_MODNAME=KBUILD_STR\(vboxguest\) KBUILD_BASENAME=KBUILD_STR\(vboxguest\) DEBUG_HASH=2 DEBUG_HASH2=3 EXPORT_SYMTAB
|
---|
40 | VBoxGuest_DEFS.solaris = VBOX_SVN_REV=$(VBOX_SVN_REV)
|
---|
41 | VBoxGuest_DEFS.win = VBOX_GUESTDRV_WITH_RELEASE_LOGGER
|
---|
42 | VBoxGuest_DEFS.darwin = VBOX_GUESTDRV_WITH_RELEASE_LOGGER
|
---|
43 | ifeq ($(KBUILD_TYPE),release)
|
---|
44 | # Allow stopping/removing the driver without a reboot
|
---|
45 | # in debug mode; this is very useful for testing the shutdown stuff!
|
---|
46 | VBoxGuest_DEFS.win += VBOX_REBOOT_ON_UNINSTALL
|
---|
47 | endif
|
---|
48 | ifdef VBOX_WITH_GUEST_BUGCHECK_DETECTION
|
---|
49 | VBoxGuest_DEFS.win += VBOX_WITH_GUEST_BUGCHECK_DETECTION
|
---|
50 | endif
|
---|
51 | #VBoxGuest_DEFS.win += LOG_ENABLED LOG_TO_BACKDOOR
|
---|
52 | VBoxGuest_DEFS.win += \
|
---|
53 | $(if $(VBOX_WITH_DPC_LATENCY_CHECKER),VBOX_WITH_DPC_LATENCY_CHECKER,)
|
---|
54 | VBoxGuest_DEPS.solaris += $(VBOX_SVN_REV_KMK)
|
---|
55 | VBoxGuest_DEPS.linux += $(VBOX_SVN_REV_HEADER)
|
---|
56 | VBoxGuest_DEPS.haiku += $(VBOX_SVN_REV_HEADER)
|
---|
57 | VBoxGuest_DEPS.freebsd += $(VBOX_SVN_REV_HEADER)
|
---|
58 | VBoxGuest_DEPS.netbsd += $(VBOX_SVN_REV_HEADER)
|
---|
59 | VBoxGuest_DEPS.darwin += $(VBOX_SVN_REV_HEADER)
|
---|
60 | VBoxGuest_DEFS = VBGL_VBOXGUEST VBOX_WITH_HGCM
|
---|
61 | VBoxGuest_INCS = .
|
---|
62 | VBoxGuest_INCS.freebsd = $(VBoxGuest_0_OUTDIR) $(PATH_STAGE)/gen-sys-hdrs
|
---|
63 | VBoxGuest_INCS.netbsd = $(VBoxGuest_0_OUTDIR)
|
---|
64 | VBoxGuest_INCS.linux = ../../../Runtime/r0drv/linux
|
---|
65 | ifeq ($(KBUILD_HOST),solaris)
|
---|
66 | VBoxGuest_LDFLAGS.solaris += -N misc/ctf
|
---|
67 | else
|
---|
68 | VBoxGuest_SOURCES.solaris = solaris/deps.asm
|
---|
69 | VBoxGuest_solaris/deps.asm_ASFLAGS = -f bin -g null
|
---|
70 | endif
|
---|
71 | ifneq ($(KBUILD_TARGET),os2)
|
---|
72 | ifeq ($(KBUILD_TARGET),win)
|
---|
73 | VBoxGuest_LDFLAGS.x86 = -Entry:DriverEntry@8
|
---|
74 | VBoxGuest_LDFLAGS.amd64 = -Entry:DriverEntry
|
---|
75 | VBoxGuest_LIBS = \
|
---|
76 | $(PATH_SDK_$(VBOX_WINDDK_GST)_LIB)/ntoskrnl.lib \
|
---|
77 | $(PATH_SDK_$(VBOX_WINDDK_GST)_LIB)/hal.lib
|
---|
78 | ifdef VBOX_WITH_GUEST_BUGCHECK_DETECTION
|
---|
79 | VBoxGuest_LIBS += \
|
---|
80 | $(PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB)/aux_klib.lib \
|
---|
81 | $(PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB)/ksecdd.lib \
|
---|
82 | $(PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB)/BufferOverflowK.lib
|
---|
83 | VBoxGuest.cpp_SDKS = $(VBOX_WINDDK_GST_WLH)
|
---|
84 | endif
|
---|
85 | endif # win
|
---|
86 | ifn1of ($(KBUILD_TARGET), linux freebsd netbsd solaris haiku)
|
---|
87 | VBoxGuest_SOURCES = VBoxGuest-$(KBUILD_TARGET).cpp
|
---|
88 | else
|
---|
89 | VBoxGuest_SOURCES = VBoxGuest-$(KBUILD_TARGET).c
|
---|
90 | VBoxGuest_$(KBUILD_TARGET).c_DEPS = $(VBOX_SVN_REV_HEADER)
|
---|
91 | endif
|
---|
92 | VBoxGuest_SOURCES += \
|
---|
93 | VBoxGuest.cpp
|
---|
94 | ifeq ($(KBUILD_TARGET), win)
|
---|
95 | VBoxGuest_SOURCES += \
|
---|
96 | VBoxGuest-$(KBUILD_TARGET)-pnp.cpp \
|
---|
97 | win/VBoxGuest.rc
|
---|
98 | endif
|
---|
99 | VBoxGuest_LIBS += \
|
---|
100 | $(VBOX_LIB_VBGL_R0BASE) \
|
---|
101 | $(VBOX_LIB_IPRT_GUEST_R0)
|
---|
102 | VBoxGuest_ORDERDEPS.freebsd = \
|
---|
103 | $(PATH_STAGE)/gen-sys-hdrs/pci_if.h \
|
---|
104 | $(PATH_STAGE)/gen-sys-hdrs/bus_if.h \
|
---|
105 | $(PATH_STAGE)/gen-sys-hdrs/device_if.h
|
---|
106 | ifeq ($(KBUILD_TARGET),haiku)
|
---|
107 | # Haiku drivers cannot export symbols for other drivers, but modules can.
|
---|
108 | # Therefore vboxguest is a module containing the ring-0 guest lib, and vboxdev/vboxsf
|
---|
109 | # use this module to access the guest lib
|
---|
110 | SYSMODS += VBoxDev
|
---|
111 | VBoxDev_TEMPLATE = VBOXGUESTR0
|
---|
112 | VBoxDev_NAME = vboxdev
|
---|
113 | VBoxDev_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV) _KERNEL_MODE=1 VBGL_VBOXGUEST VBOX_WITH_HGCM IN_RING0
|
---|
114 | VBoxDev_SOURCES = VBoxDev-haiku.c VBoxGuest-haiku-stubs.c
|
---|
115 | endif
|
---|
116 | else # OS/2:
|
---|
117 | # The library order is crucial, so a bit of trickery is necessary.
|
---|
118 | # A library is used to make sure that VBoxGuestA-os2.asm is first in the link. (temporary hack?)
|
---|
119 | VBoxGuest_SOURCES = \
|
---|
120 | VBoxGuestA-os2.asm \
|
---|
121 | VBoxGuest-os2.def
|
---|
122 | #VBoxGuest_LDFLAGS = -s -t -v
|
---|
123 | VBoxGuest_LIBS = \
|
---|
124 | $(TARGET_VBoxGuestLibOs2Hack) \
|
---|
125 | $(VBOX_LIB_VBGL_R0BASE) \
|
---|
126 | $(VBOX_LIB_IPRT_GUEST_R0) \
|
---|
127 | $(VBOX_GCC_LIBGCC) \
|
---|
128 | end
|
---|
129 | ## When debugging init with kDrvTest:
|
---|
130 | #VBoxGuest_NAME = VBoxGst
|
---|
131 |
|
---|
132 | # see
|
---|
133 | LIBRARIES += VBoxGuestLibOs2Hack
|
---|
134 | VBoxGuestLibOs2Hack_TEMPLATE = VBOXGUESTR0LIB
|
---|
135 | VBoxGuestLibOs2Hack_INSTTYPE = none
|
---|
136 | VBoxGuestLibOs2Hack_DEFS = $(VBoxGuest_DEFS)
|
---|
137 | VBoxGuestLibOs2Hack_INCS = \
|
---|
138 | . \
|
---|
139 | $(PATH_ROOT)/src/VBox/Runtime/include # for the os2ddk
|
---|
140 | VBoxGuestLibOs2Hack_SOURCES = \
|
---|
141 | VBoxGuest-os2.cpp \
|
---|
142 | VBoxGuest.cpp
|
---|
143 | endif # OS/2
|
---|
144 |
|
---|
145 | VBoxGuest.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
|
---|
146 |
|
---|
147 | ifeq ($(KBUILD_TARGET),win)
|
---|
148 | #
|
---|
149 | # Windows NT4 driver.
|
---|
150 | #
|
---|
151 | SYSMODS.x86 += VBoxGuestNT
|
---|
152 | VBoxGuestNT_EXTENDS = VBoxGuest
|
---|
153 | VBoxGuestNT_INSTTYPE.win = both
|
---|
154 | VBoxGuestNT_SDKS = ReorderCompilerIncs $(VBOX_WINDDK_GST_NT4)
|
---|
155 | VBoxGuestNT_DEFS = $(VBoxGuest_DEFS) TARGET_NT4
|
---|
156 | VBoxGuestNT_SOURCES = \
|
---|
157 | VBoxGuest.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
|
---|
168 | endif # enabled
|
---|
169 |
|
---|
170 |
|
---|
171 | ifeq ($(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 | $<
|
---|
193 | endif # darwin
|
---|
194 |
|
---|
195 |
|
---|
196 | ifeq ($(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-scripts
|
---|
208 | vboxguest-scripts_INST = $(INST_ADDITIONS)src/
|
---|
209 | vboxguest-scripts_MODE = a+rx,u+w
|
---|
210 | vboxguest-scripts_SOURCES = ../../../HostDrivers/linux/build_in_tmp
|
---|
211 |
|
---|
212 | # scripts.
|
---|
213 | INSTALLS += vboxguest-sh
|
---|
214 | vboxguest-sh_INST = $(INST_ADDITIONS)src/vboxguest/
|
---|
215 | vboxguest-sh_MODE = a+rx,u+w
|
---|
216 | vboxguest-sh_SOURCES = $(subst ",,$(FILES_VBOXGUEST_BIN))
|
---|
217 |
|
---|
218 | endif # Linux
|
---|
219 |
|
---|
220 | ifeq ($(KBUILD_TARGET),freebsd)
|
---|
221 | #
|
---|
222 | # Install the source files and script(s).
|
---|
223 | #
|
---|
224 | include $(PATH_SUB_CURRENT)/freebsd/files_vboxguest
|
---|
225 | # sources and stuff.
|
---|
226 | INSTALLS += vboxguest-src
|
---|
227 | vboxguest-src_INST = $(INST_ADDITIONS)src/vboxguest/
|
---|
228 | vboxguest-src_MODE = a+r,u+w
|
---|
229 | vboxguest-src_SOURCES = $(subst ",,$(FILES_VBOXGUEST_NOBIN))
|
---|
230 |
|
---|
231 | endif # FreeBSD
|
---|
232 |
|
---|
233 | ifeq ($(KBUILD_TARGET),win)
|
---|
234 | #
|
---|
235 | # VBoxGuestInst - The installer.
|
---|
236 | #
|
---|
237 | #PROGRAMS += VBoxGuestInst
|
---|
238 | VBoxGuestInst_TEMPLATE= VBoxGuestR3Exe
|
---|
239 | VBoxGuestInst_SOURCES = win/VBoxGuestInst.cpp
|
---|
240 | endif
|
---|
241 |
|
---|
242 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
243 |
|
---|