VirtualBox

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

Last change on this file since 35263 was 33676, checked in by vboxsync, 14 years ago

scm cleanup run.

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

© 2023 Oracle
ContactPrivacy policyTerms of Use