VirtualBox

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

Last change on this file since 39252 was 39252, checked in by vboxsync, 13 years ago

NOINST -> INSTTYPE=none; adding DEBUG_INSTTYPE=both if the NOINST was because of code signing. This will make the .PDBs be installed into stage/debug/ for signed drivers (i.e. with .INF files).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.6 KB
Line 
1# $Id: Makefile.kmk 39252 2011-11-09 14:00:21Z vboxsync $
2## @file
3# Makefile for the Cross Platform Guest Additions Driver.
4#
5
6#
7# Copyright (C) 2007-2010 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), freebsd $(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.linux = vboxguest
30 VBoxGuest_NAME.solaris = vboxguest
31 ifdef VBOX_SIGN_ADDITIONS # See Additions/WINNT/Makefile.kmk?
32 VBoxGuest_INSTTYPE.win = none
33 VBoxGuest_DEBUG_INSTTYPE.win = both
34 endif
35 VBoxGuest_DEFS.linux = KBUILD_MODNAME=KBUILD_STR\(vboxguest\) KBUILD_BASENAME=KBUILD_STR\(vboxguest\) DEBUG_HASH=2 DEBUG_HASH2=3 EXPORT_SYMTAB
36 VBoxGuest_DEFS.solaris = VBOX_SVN_REV=$(VBOX_SVN_REV)
37 VBoxGuest_DEFS.win = # VBOX_WITH_VRDP_SESSION_HANDLING
38 ifeq ($(KBUILD_TYPE),release)
39 # Allow stopping/removing the driver without a reboot
40 # in debug mode; this is very useful for testing the shutdown stuff!
41 VBoxGuest_DEFS.win += VBOX_REBOOT_ON_UNINSTALL
42 endif
43 ifdef VBOX_WITH_GUEST_BUGCHECK_DETECTION
44 VBoxGuest_DEFS.win += VBOX_WITH_GUEST_BUGCHECK_DETECTION
45 endif
46 #VBoxGuest_DEFS.win += LOG_ENABLED LOG_TO_BACKDOOR
47 VBoxGuest_DEPS.solaris += $(VBOX_SVN_REV_KMK)
48 VBoxGuest_DEPS.linux += $(VBOX_SVN_REV_HEADER)
49 VBoxGuest_DEPS.freebsd += $(VBOX_SVN_REV_HEADER)
50 VBoxGuest_DEFS = VBGL_VBOXGUEST VBOX_WITH_HGCM
51 VBoxGuest_INCS = .
52 VBoxGuest_INCS.freebsd = $(VBoxGuest_0_OUTDIR) $(PATH_STAGE)/gen-sys-hdrs
53 VBoxGuest_INCS.linux = ../../../Runtime/r0drv/linux
54 VBoxGuest_LDFLAGS.solaris += -N misc/ctf
55 ifneq ($(KBUILD_TARGET),os2)
56 ifeq ($(KBUILD_TARGET),win)
57 VBoxGuest_LDFLAGS.x86 = -Entry:DriverEntry@8
58 VBoxGuest_LDFLAGS.amd64 = -Entry:DriverEntry
59 VBoxGuest_LIBS = \
60 $(PATH_SDK_W2K3DDK_LIB)/ntoskrnl.lib \
61 $(PATH_SDK_W2K3DDK_LIB)/hal.lib
62 ifdef VBOX_WITH_GUEST_BUGCHECK_DETECTION
63 VBoxGuest_LIBS += \
64 $(PATH_SDK_WINDDKWLH_LIB)/aux_klib.lib \
65 $(PATH_SDK_WINDDKWLH_LIB)/ksecdd.lib \
66 $(PATH_SDK_WINDDKWLH_LIB)/BufferOverflowK.lib
67 VBoxGuest.cpp_SDKS = WINDDKWLH
68 endif
69 endif # win
70 ifn1of ($(KBUILD_TARGET), linux freebsd solaris)
71 VBoxGuest_SOURCES = VBoxGuest-$(KBUILD_TARGET).cpp
72 else
73 VBoxGuest_SOURCES = VBoxGuest-$(KBUILD_TARGET).c
74 endif
75 VBoxGuest_SOURCES += \
76 VBoxGuest.cpp \
77 VBoxGuest2.cpp
78 ifeq ($(KBUILD_TARGET), win)
79 VBoxGuest_SOURCES += \
80 VBoxGuest-$(KBUILD_TARGET)-pnp.cpp \
81 win/VBoxGuest.rc
82 endif
83 VBoxGuest_LIBS += \
84 $(VBOX_LIB_VBGL_R0BASE) \
85 $(VBOX_LIB_IPRT_GUEST_R0)
86 VBoxGuest_ORDERDEPS.freebsd = \
87 $(PATH_STAGE)/gen-sys-hdrs/pci_if.h \
88 $(PATH_STAGE)/gen-sys-hdrs/bus_if.h \
89 $(PATH_STAGE)/gen-sys-hdrs/device_if.h
90 else # OS/2:
91 # The library order is crucial, so a bit of trickery is necessary.
92 # A library is used to make sure that VBoxGuestA-os2.asm is first in the link. (temporary hack?)
93 VBoxGuest_SOURCES = \
94 VBoxGuestA-os2.asm \
95 VBoxGuest-os2.def
96 #VBoxGuest_LDFLAGS = -s -t -v
97 VBoxGuest_LIBS = \
98 $(TARGET_VBoxGuestLibOs2Hack) \
99 $(VBOX_LIB_VBGL_R0BASE) \
100 $(VBOX_LIB_IPRT_GUEST_R0) \
101 $(VBOX_GCC_LIBGCC) \
102 end
103 ## When debugging init with kDrvTest:
104 #VBoxGuest_NAME = VBoxGst
105
106 # see
107 LIBRARIES += VBoxGuestLibOs2Hack
108 VBoxGuestLibOs2Hack_TEMPLATE = VBOXGUESTR0LIB
109 VBoxGuestLibOs2Hack_INSTTYPE = none
110 VBoxGuestLibOs2Hack_DEFS = $(VBoxGuest_DEFS)
111 VBoxGuestLibOs2Hack_INCS = \
112 . \
113 $(PATH_ROOT)/src/VBox/Runtime/include # for the os2ddk
114 VBoxGuestLibOs2Hack_SOURCES = \
115 VBoxGuest-os2.cpp \
116 VBoxGuest.cpp \
117 VBoxGuest2.cpp
118 endif # OS/2
119
120 VBoxGuest2.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
121 VBoxGuest.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
122
123 ifeq ($(KBUILD_TARGET),win)
124 #
125 # Windows NT4 driver.
126 #
127 SYSMODS.x86 += VBoxGuestNT
128 VBoxGuestNT_EXTENDS = VBoxGuest
129 VBoxGuestNT_INSTTYPE.win = both
130 VBoxGuestNT_DEFS = $(VBoxGuest_DEFS) TARGET_NT4
131 VBoxGuestNT_SOURCES = \
132 VBoxGuest.cpp \
133 VBoxGuest2.cpp \
134 VBoxGuest-$(KBUILD_TARGET).cpp \
135 VBoxGuest-$(KBUILD_TARGET)-legacy.cpp \
136 win/VBoxGuest.rc
137 VBoxGuestNT_LIBS = \
138 $(PATH_SDK_W2K3DDK_LIB)/exsup.lib \
139 $(PATH_SDK_W2K3DDK_LIB)/ntoskrnl.lib \
140 $(PATH_SDK_W2K3DDK_LIB)/hal.lib \
141 $(VBOX_LIB_VBGL_R0BASE) \
142 $(VBOX_LIB_IPRT_GUEST_R0_NT4)
143 endif # win
144endif # enabled
145
146ifeq ($(KBUILD_TARGET),linux)
147 #
148 # Install the source files and script(s).
149 #
150 include $(PATH_SUB_CURRENT)/linux/files_vboxguest
151 # sources and stuff.
152 INSTALLS += vboxguest-src
153 vboxguest-src_INST = $(INST_ADDITIONS)src/vboxguest/
154 vboxguest-src_MODE = a+r,u+w
155 vboxguest-src_SOURCES = $(subst ",,$(FILES_VBOXGUEST_NOBIN))
156
157 INSTALLS += vboxguest-dkms-conf
158 vboxguest-dkms-conf_INST = $(INST_ADDITIONS)src/
159 vboxguest-dkms-conf_MODE = a+r,u+w
160 vboxguest-dkms-conf_SOURCES = $(vboxguest-sh_0_OUTDIR)/dkms.conf
161 vboxguest-dkms-conf_CLEAN = $(vboxguest-sh_0_OUTDIR)/dkms.conf
162
163 INSTALLS += vboxguest-dkms-sh
164 vboxguest-dkms-sh_INST = $(INST_ADDITIONS)src/
165 vboxguest-dkms-sh_MODE = a+rx,u+w
166 vboxguest-dkms-sh_SOURCES = $(vboxguest-sh_0_OUTDIR)/do_dkms
167 vboxguest-dkms-sh_CLEAN = $(vboxguest-sh_0_OUTDIR)/do_dkms
168
169 $$(vboxguest-sh_0_OUTDIR)/dkms.conf: \
170 $(PATH_SUB_CURRENT)/linux/dkms.conf \
171 $(VBOX_VERSION_STAMP) \
172 | $$(dir $$@)
173 $(call MSG_TOOL,Creating,,$@)
174 $(QUIET)$(SED) \
175 -e "s;_VERSION_;${VBOX_VERSION_STRING};g" \
176 -e "s;_BUILDTYPE_;$(KBUILD_TYPE);g" \
177 --output $@ $<
178
179 $$(vboxguest-sh_0_OUTDIR)/do_dkms: \
180 $(PATH_ROOT)/src/VBox/HostDrivers/linux/do_dkms \
181 $(VBOX_VERSION_STAMP) \
182 | $$(dir $$@)
183 $(call MSG_TOOL,Creating,,$@)
184 $(QUIET)$(SED) \
185 -e "s;_VERSION_;${VBOX_VERSION_STRING};g" \
186 -e "s;_MODULE_;vboxguest;g" \
187 -e "s;_OLDMODULES_;vboxguest vboxadd vboxsf vboxvfs vboxvideo;g" \
188 --output $@ $<
189 $(QUIET)$(CHMOD) a+rx,u+w $@
190
191 # scripts.
192 INSTALLS += vboxguest-sh
193 vboxguest-sh_INST = $(INST_ADDITIONS)src/vboxguest/
194 vboxguest-sh_MODE = a+rx,u+w
195 vboxguest-sh_SOURCES = $(subst ",,$(FILES_VBOXGUEST_BIN))
196 vboxguest-sh_SOURCES += $(PATH_ROOT)/src/VBox/HostDrivers/linux/do_Module.symvers
197 vboxguest-sh_SOURCES += $(vboxguest-sh_0_OUTDIR)/build_in_tmp
198 vboxguest-sh_CLEAN = $(vboxguest-sh_0_OUTDIR)/build_in_tmp
199
200 $$(vboxguest-sh_0_OUTDIR)/build_in_tmp: \
201 $(PATH_ROOT)/src/VBox/HostDrivers/linux/build_in_tmp \
202 $(VBOX_VERSION_STAMP) \
203 | $$(dir $$@)
204 $(call MSG_TOOL,Creating,,$@)
205 $(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g; s;_MODULE_;vboxguest;g; s;_BUILDTYPE_;${KBUILD_TYPE};g" --output $@ $<
206 $(QUIET)$(CHMOD) 0755 $@
207
208endif # Linux
209
210ifeq ($(KBUILD_TARGET),freebsd)
211 #
212 # Install the source files and script(s).
213 #
214 include $(PATH_SUB_CURRENT)/freebsd/files_vboxguest
215 # sources and stuff.
216 INSTALLS += vboxguest-src
217 vboxguest-src_INST = $(INST_ADDITIONS)src/vboxguest/
218 vboxguest-src_MODE = a+r,u+w
219 vboxguest-src_SOURCES = $(subst ",,$(FILES_VBOXGUEST_NOBIN))
220
221endif # FreeBSD
222
223ifeq ($(KBUILD_TARGET),win)
224#
225# VBoxGuestInst - The installer.
226#
227#PROGRAMS += VBoxGuestInst
228VBoxGuestInst_TEMPLATE= VBOXGUESTR3EXE
229VBoxGuestInst_SOURCES = win/VBoxGuestInst.cpp
230endif
231
232include $(KBUILD_PATH)/subfooter.kmk
233
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