VirtualBox

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

Last change on this file since 63206 was 63108, checked in by vboxsync, 8 years ago

GA/common,Config.kmk: Use strict kBuild templates for building all the NT GA bits.

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

© 2023 Oracle
ContactPrivacy policyTerms of Use