VirtualBox

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

Last change on this file since 68643 was 68642, checked in by vboxsync, 7 years ago

Moved VBoxGuestLib/ to VBoxGuest/lib/

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