1 | # $Id: Makefile.kmk 66072 2017-03-13 20:15:33Z 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 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.netbsd = 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.solaris = VBOX_SVN_REV=$(VBOX_SVN_REV)
|
---|
39 | VBoxGuest_DEFS.win = VBOX_GUESTDRV_WITH_RELEASE_LOGGER
|
---|
40 | VBoxGuest_DEFS.darwin = VBOX_GUESTDRV_WITH_RELEASE_LOGGER
|
---|
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.haiku += $(VBOX_SVN_REV_HEADER)
|
---|
54 | VBoxGuest_DEPS.freebsd += $(VBOX_SVN_REV_HEADER)
|
---|
55 | VBoxGuest_DEPS.netbsd += $(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.netbsd = $(VBoxGuest_0_OUTDIR)
|
---|
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 netbsd solaris haiku)
|
---|
83 | VBoxGuest_SOURCES = VBoxGuest-$(KBUILD_TARGET).cpp
|
---|
84 | else
|
---|
85 | VBoxGuest_SOURCES = VBoxGuest-$(KBUILD_TARGET).c
|
---|
86 | VBoxGuest_$(KBUILD_TARGET).c_DEPS = $(VBOX_SVN_REV_HEADER)
|
---|
87 | endif
|
---|
88 | VBoxGuest_SOURCES += \
|
---|
89 | VBoxGuest.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 | endif # OS/2
|
---|
140 |
|
---|
141 | VBoxGuest.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
|
---|
142 |
|
---|
143 | ifeq ($(KBUILD_TARGET),win)
|
---|
144 | #
|
---|
145 | # Windows NT4 driver.
|
---|
146 | #
|
---|
147 | SYSMODS.x86 += VBoxGuestNT
|
---|
148 | VBoxGuestNT_EXTENDS = VBoxGuest
|
---|
149 | VBoxGuestNT_INSTTYPE.win = both
|
---|
150 | VBoxGuestNT_SDKS = ReorderCompilerIncs $(VBOX_WINDDK_GST_NT4)
|
---|
151 | VBoxGuestNT_DEFS = $(VBoxGuest_DEFS) TARGET_NT4
|
---|
152 | VBoxGuestNT_SOURCES = \
|
---|
153 | VBoxGuest.cpp \
|
---|
154 | VBoxGuest-$(KBUILD_TARGET).cpp \
|
---|
155 | VBoxGuest-$(KBUILD_TARGET)-legacy.cpp \
|
---|
156 | win/VBoxGuest.rc
|
---|
157 | VBoxGuestNT_LIBS = \
|
---|
158 | $(PATH_SDK_$(VBOX_WINDDK_GST_NT4)_LIB)/exsup.lib \
|
---|
159 | $(PATH_SDK_$(VBOX_WINDDK_GST_NT4)_LIB)/ntoskrnl.lib \
|
---|
160 | $(PATH_SDK_$(VBOX_WINDDK_GST_NT4)_LIB)/hal.lib \
|
---|
161 | $(VBOX_LIB_VBGL_R0BASE) \
|
---|
162 | $(VBOX_LIB_IPRT_GUEST_R0_NT4)
|
---|
163 | endif # win
|
---|
164 | endif # enabled
|
---|
165 |
|
---|
166 |
|
---|
167 | ifeq ($(KBUILD_TARGET), darwin)
|
---|
168 | # Files necessary to make a darwin kernel extension bundle.
|
---|
169 | INSTALLS += VBoxGuest.kext
|
---|
170 | VBoxGuest.kext_INST = $(INST_ADDITIONS)/VBoxGuest.kext/Contents/
|
---|
171 | VBoxGuest.kext_SOURCES = $(VBoxGuest.kext_0_OUTDIR)/Info.plist
|
---|
172 | VBoxGuest.kext_CLEAN = $(VBoxGuest.kext_0_OUTDIR)/Info.plist
|
---|
173 |
|
---|
174 | $$(VBoxGuest.kext_0_OUTDIR)/Info.plist: \
|
---|
175 | $(PATH_SUB_CURRENT)/darwin/Info.plist \
|
---|
176 | $(VBOX_VERSION_MK) | $$(dir $$@)
|
---|
177 | $(call MSG_GENERATE,VBoxGuest,$@,$<)
|
---|
178 | $(QUIET)$(RM) -f $@
|
---|
179 | $(QUIET)$(SED) \
|
---|
180 | -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
|
---|
181 | -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
|
---|
182 | -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
|
---|
183 | -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
|
---|
184 | -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
|
---|
185 | -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
|
---|
186 | -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
|
---|
187 | --output $@ \
|
---|
188 | $<
|
---|
189 | endif # darwin
|
---|
190 |
|
---|
191 |
|
---|
192 | ifeq ($(KBUILD_TARGET),linux)
|
---|
193 | #
|
---|
194 | # Install the source files and script(s).
|
---|
195 | #
|
---|
196 | include $(PATH_SUB_CURRENT)/linux/files_vboxguest
|
---|
197 | # sources and stuff.
|
---|
198 | INSTALLS += vboxguest-src
|
---|
199 | vboxguest-src_INST = $(INST_ADDITIONS)src/vboxguest/
|
---|
200 | vboxguest-src_MODE = a+r,u+w
|
---|
201 | vboxguest-src_SOURCES = $(subst ",,$(FILES_VBOXGUEST_NOBIN))
|
---|
202 |
|
---|
203 | INSTALLS += vboxguest-scripts
|
---|
204 | vboxguest-scripts_INST = $(INST_ADDITIONS)src/
|
---|
205 | vboxguest-scripts_MODE = a+rx,u+w
|
---|
206 | vboxguest-scripts_SOURCES = ../../../HostDrivers/linux/build_in_tmp
|
---|
207 |
|
---|
208 | # scripts.
|
---|
209 | INSTALLS += vboxguest-sh
|
---|
210 | vboxguest-sh_INST = $(INST_ADDITIONS)src/vboxguest/
|
---|
211 | vboxguest-sh_MODE = a+rx,u+w
|
---|
212 | vboxguest-sh_SOURCES = $(subst ",,$(FILES_VBOXGUEST_BIN))
|
---|
213 |
|
---|
214 | endif # Linux
|
---|
215 |
|
---|
216 | ifeq ($(KBUILD_TARGET),freebsd)
|
---|
217 | #
|
---|
218 | # Install the source files and script(s).
|
---|
219 | #
|
---|
220 | include $(PATH_SUB_CURRENT)/freebsd/files_vboxguest
|
---|
221 | # sources and stuff.
|
---|
222 | INSTALLS += vboxguest-src
|
---|
223 | vboxguest-src_INST = $(INST_ADDITIONS)src/vboxguest/
|
---|
224 | vboxguest-src_MODE = a+r,u+w
|
---|
225 | vboxguest-src_SOURCES = $(subst ",,$(FILES_VBOXGUEST_NOBIN))
|
---|
226 |
|
---|
227 | endif # FreeBSD
|
---|
228 |
|
---|
229 | ifeq ($(KBUILD_TARGET),win)
|
---|
230 | #
|
---|
231 | # VBoxGuestInst - The installer.
|
---|
232 | #
|
---|
233 | #PROGRAMS += VBoxGuestInst
|
---|
234 | VBoxGuestInst_TEMPLATE= VBoxGuestR3Exe
|
---|
235 | VBoxGuestInst_SOURCES = win/VBoxGuestInst.cpp
|
---|
236 | endif
|
---|
237 |
|
---|
238 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
239 |
|
---|