VirtualBox

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

Last change on this file since 37826 was 36060, checked in by vboxsync, 14 years ago

VBoxGuest-win: PNP cleanup: process only required PNP IRPs according to MSDN.

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