1 | # $Id: Makefile.kmk 43363 2012-09-20 09:56:07Z 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 |
|
---|
18 | SUB_DEPTH = ../../../../..
|
---|
19 | include $(KBUILD_PATH)/subheader.kmk
|
---|
20 |
|
---|
21 |
|
---|
22 | if1of ($(KBUILD_TARGET), 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 | ifdef VBOX_SIGN_ADDITIONS # See Additions/WINNT/Makefile.kmk?
|
---|
33 | VBoxGuest_INSTTYPE.win = none
|
---|
34 | VBoxGuest_DEBUG_INSTTYPE.win = both
|
---|
35 | endif
|
---|
36 | VBoxGuest_DEFS.haiku = VBOX_SVN_REV=$(VBOX_SVN_REV) _KERNEL_MODE=1
|
---|
37 | VBoxGuest_DEFS.linux = KBUILD_MODNAME=KBUILD_STR\(vboxguest\) KBUILD_BASENAME=KBUILD_STR\(vboxguest\) DEBUG_HASH=2 DEBUG_HASH2=3 EXPORT_SYMTAB
|
---|
38 | VBoxGuest_DEFS.solaris = VBOX_SVN_REV=$(VBOX_SVN_REV)
|
---|
39 | VBoxGuest_DEFS.win = # VBOX_WITH_VRDP_SESSION_HANDLING
|
---|
40 | ifeq ($(KBUILD_TYPE),release)
|
---|
41 | # Allow stopping/removing the driver without a reboot
|
---|
42 | # in debug mode; this is very useful for testing the shutdown stuff!
|
---|
43 | VBoxGuest_DEFS.win += VBOX_REBOOT_ON_UNINSTALL
|
---|
44 | endif
|
---|
45 | ifdef VBOX_WITH_GUEST_BUGCHECK_DETECTION
|
---|
46 | VBoxGuest_DEFS.win += VBOX_WITH_GUEST_BUGCHECK_DETECTION
|
---|
47 | endif
|
---|
48 | #VBoxGuest_DEFS.win += LOG_ENABLED LOG_TO_BACKDOOR
|
---|
49 | VBoxGuest_DEFS.win += \
|
---|
50 | $(if $(VBOX_WITH_DPC_LATENCY_CHECKER),VBOX_WITH_DPC_LATENCY_CHECKER,)
|
---|
51 | VBoxGuest_DEPS.solaris += $(VBOX_SVN_REV_KMK)
|
---|
52 | VBoxGuest_DEPS.linux += $(VBOX_SVN_REV_HEADER)
|
---|
53 | VBoxGuest_DEPS.freebsd += $(VBOX_SVN_REV_HEADER)
|
---|
54 | VBoxGuest_DEPS.haiku += $(VBOX_SVN_REV_HEADER)
|
---|
55 | VBoxGuest_DEFS = VBGL_VBOXGUEST VBOX_WITH_HGCM
|
---|
56 | VBoxGuest_INCS = .
|
---|
57 | VBoxGuest_INCS.freebsd = $(VBoxGuest_0_OUTDIR) $(PATH_STAGE)/gen-sys-hdrs
|
---|
58 | VBoxGuest_INCS.linux = ../../../Runtime/r0drv/linux
|
---|
59 | ifeq ($(KBUILD_HOST),solaris)
|
---|
60 | VBoxGuest_LDFLAGS.solaris += -N misc/ctf
|
---|
61 | else
|
---|
62 | VBoxGuest_SOURCES.solaris = solaris/deps.asm
|
---|
63 | VBoxGuest_solaris/deps.asm_ASFLAGS = -f bin -g null
|
---|
64 | endif
|
---|
65 | ifneq ($(KBUILD_TARGET),os2)
|
---|
66 | ifeq ($(KBUILD_TARGET),win)
|
---|
67 | VBoxGuest_LDFLAGS.x86 = -Entry:DriverEntry@8
|
---|
68 | VBoxGuest_LDFLAGS.amd64 = -Entry:DriverEntry
|
---|
69 | VBoxGuest_LIBS = \
|
---|
70 | $(PATH_SDK_$(VBOX_WINDDK_GST)_LIB)/ntoskrnl.lib \
|
---|
71 | $(PATH_SDK_$(VBOX_WINDDK_GST)_LIB)/hal.lib
|
---|
72 | ifdef VBOX_WITH_GUEST_BUGCHECK_DETECTION
|
---|
73 | VBoxGuest_LIBS += \
|
---|
74 | $(PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB)/aux_klib.lib \
|
---|
75 | $(PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB)/ksecdd.lib \
|
---|
76 | $(PATH_SDK_$(VBOX_WINDDK_GST_WLH)_LIB)/BufferOverflowK.lib
|
---|
77 | VBoxGuest.cpp_SDKS = $(VBOX_WINDDK_GST_WLH)
|
---|
78 | endif
|
---|
79 | endif # win
|
---|
80 | ifn1of ($(KBUILD_TARGET), linux freebsd solaris haiku)
|
---|
81 | VBoxGuest_SOURCES = VBoxGuest-$(KBUILD_TARGET).cpp
|
---|
82 | else
|
---|
83 | VBoxGuest_SOURCES = VBoxGuest-$(KBUILD_TARGET).c
|
---|
84 | endif
|
---|
85 | VBoxGuest_SOURCES += \
|
---|
86 | VBoxGuest.cpp \
|
---|
87 | VBoxGuest2.cpp
|
---|
88 | ifeq ($(KBUILD_TARGET), win)
|
---|
89 | VBoxGuest_SOURCES += \
|
---|
90 | VBoxGuest-$(KBUILD_TARGET)-pnp.cpp \
|
---|
91 | win/VBoxGuest.rc
|
---|
92 | endif
|
---|
93 | VBoxGuest_LIBS += \
|
---|
94 | $(VBOX_LIB_VBGL_R0BASE) \
|
---|
95 | $(VBOX_LIB_IPRT_GUEST_R0)
|
---|
96 | VBoxGuest_ORDERDEPS.freebsd = \
|
---|
97 | $(PATH_STAGE)/gen-sys-hdrs/pci_if.h \
|
---|
98 | $(PATH_STAGE)/gen-sys-hdrs/bus_if.h \
|
---|
99 | $(PATH_STAGE)/gen-sys-hdrs/device_if.h
|
---|
100 | ifeq ($(KBUILD_TARGET),haiku)
|
---|
101 | # Haiku drivers cannot export symbols for other drivers, but modules can.
|
---|
102 | # Therefore vboxguest is a module containing the ring-0 guest lib, and vboxdev/vboxsf
|
---|
103 | # use this module to access the guest lib
|
---|
104 | SYSMODS += VBoxDev
|
---|
105 | VBoxDev_TEMPLATE = VBOXGUESTR0
|
---|
106 | VBoxDev_NAME = vboxdev
|
---|
107 | VBoxDev_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV) _KERNEL_MODE=1 VBGL_VBOXGUEST VBOX_WITH_HGCM IN_RING0
|
---|
108 | VBoxDev_SOURCES = VBoxDev-haiku.c VBoxGuest-haiku-stubs.c
|
---|
109 | endif
|
---|
110 | else # OS/2:
|
---|
111 | # The library order is crucial, so a bit of trickery is necessary.
|
---|
112 | # A library is used to make sure that VBoxGuestA-os2.asm is first in the link. (temporary hack?)
|
---|
113 | VBoxGuest_SOURCES = \
|
---|
114 | VBoxGuestA-os2.asm \
|
---|
115 | VBoxGuest-os2.def
|
---|
116 | #VBoxGuest_LDFLAGS = -s -t -v
|
---|
117 | VBoxGuest_LIBS = \
|
---|
118 | $(TARGET_VBoxGuestLibOs2Hack) \
|
---|
119 | $(VBOX_LIB_VBGL_R0BASE) \
|
---|
120 | $(VBOX_LIB_IPRT_GUEST_R0) \
|
---|
121 | $(VBOX_GCC_LIBGCC) \
|
---|
122 | end
|
---|
123 | ## When debugging init with kDrvTest:
|
---|
124 | #VBoxGuest_NAME = VBoxGst
|
---|
125 |
|
---|
126 | # see
|
---|
127 | LIBRARIES += VBoxGuestLibOs2Hack
|
---|
128 | VBoxGuestLibOs2Hack_TEMPLATE = VBOXGUESTR0LIB
|
---|
129 | VBoxGuestLibOs2Hack_INSTTYPE = none
|
---|
130 | VBoxGuestLibOs2Hack_DEFS = $(VBoxGuest_DEFS)
|
---|
131 | VBoxGuestLibOs2Hack_INCS = \
|
---|
132 | . \
|
---|
133 | $(PATH_ROOT)/src/VBox/Runtime/include # for the os2ddk
|
---|
134 | VBoxGuestLibOs2Hack_SOURCES = \
|
---|
135 | VBoxGuest-os2.cpp \
|
---|
136 | VBoxGuest.cpp \
|
---|
137 | VBoxGuest2.cpp
|
---|
138 | endif # OS/2
|
---|
139 |
|
---|
140 | VBoxGuest2.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
|
---|
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 | VBoxGuest2.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
|
---|
165 | endif # enabled
|
---|
166 |
|
---|
167 | ifeq ($(KBUILD_TARGET),linux)
|
---|
168 | #
|
---|
169 | # Install the source files and script(s).
|
---|
170 | #
|
---|
171 | include $(PATH_SUB_CURRENT)/linux/files_vboxguest
|
---|
172 | # sources and stuff.
|
---|
173 | INSTALLS += vboxguest-src
|
---|
174 | vboxguest-src_INST = $(INST_ADDITIONS)src/vboxguest/
|
---|
175 | vboxguest-src_MODE = a+r,u+w
|
---|
176 | vboxguest-src_SOURCES = $(subst ",,$(FILES_VBOXGUEST_NOBIN))
|
---|
177 |
|
---|
178 | INSTALLS += vboxguest-conf
|
---|
179 | vboxguest-conf_INST = $(INST_ADDITIONS)src/
|
---|
180 | vboxguest-conf_MODE = a+r,u+w
|
---|
181 | vboxguest-conf_SOURCES = $(vboxguest-sh_0_OUTDIR)/dkms.conf
|
---|
182 | vboxguest-conf_CLEAN = $(vboxguest-sh_0_OUTDIR)/dkms.conf
|
---|
183 |
|
---|
184 | INSTALLS += vboxguest-scripts
|
---|
185 | vboxguest-scripts_INST = $(INST_ADDITIONS)src/
|
---|
186 | vboxguest-scripts_MODE = a+rx,u+w
|
---|
187 | vboxguest-scripts_SOURCES = ../../../HostDrivers/linux/do_dkms \
|
---|
188 | ../../../HostDrivers/linux/build_in_tmp
|
---|
189 |
|
---|
190 | $$(vboxguest-sh_0_OUTDIR)/dkms.conf: \
|
---|
191 | $(PATH_SUB_CURRENT)/linux/dkms.conf \
|
---|
192 | $(VBOX_VERSION_STAMP) \
|
---|
193 | | $$(dir $$@)
|
---|
194 | $(call MSG_TOOL,Creating,,$@)
|
---|
195 | $(QUIET)$(SED) \
|
---|
196 | -e "s;_VERSION_;${VBOX_VERSION_STRING};g" \
|
---|
197 | -e "s;_BUILDTYPE_;$(KBUILD_TYPE);g" \
|
---|
198 | --output $@ $<
|
---|
199 |
|
---|
200 | # scripts.
|
---|
201 | INSTALLS += vboxguest-sh
|
---|
202 | vboxguest-sh_INST = $(INST_ADDITIONS)src/vboxguest/
|
---|
203 | vboxguest-sh_MODE = a+rx,u+w
|
---|
204 | vboxguest-sh_SOURCES = $(subst ",,$(FILES_VBOXGUEST_BIN))
|
---|
205 | vboxguest-sh_SOURCES += $(PATH_ROOT)/src/VBox/HostDrivers/linux/do_Module.symvers
|
---|
206 |
|
---|
207 | endif # Linux
|
---|
208 |
|
---|
209 | ifeq ($(KBUILD_TARGET),freebsd)
|
---|
210 | #
|
---|
211 | # Install the source files and script(s).
|
---|
212 | #
|
---|
213 | include $(PATH_SUB_CURRENT)/freebsd/files_vboxguest
|
---|
214 | # sources and stuff.
|
---|
215 | INSTALLS += vboxguest-src
|
---|
216 | vboxguest-src_INST = $(INST_ADDITIONS)src/vboxguest/
|
---|
217 | vboxguest-src_MODE = a+r,u+w
|
---|
218 | vboxguest-src_SOURCES = $(subst ",,$(FILES_VBOXGUEST_NOBIN))
|
---|
219 |
|
---|
220 | endif # FreeBSD
|
---|
221 |
|
---|
222 | ifeq ($(KBUILD_TARGET),win)
|
---|
223 | #
|
---|
224 | # VBoxGuestInst - The installer.
|
---|
225 | #
|
---|
226 | #PROGRAMS += VBoxGuestInst
|
---|
227 | VBoxGuestInst_TEMPLATE= NewVBoxGuestR3Exe
|
---|
228 | VBoxGuestInst_SOURCES = win/VBoxGuestInst.cpp
|
---|
229 | endif
|
---|
230 |
|
---|
231 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
232 |
|
---|