VirtualBox

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

Last change on this file since 32877 was 32693, checked in by vboxsync, 14 years ago

build fix

  • 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 32693 2010-09-22 10:36:52Z 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 VBoxGuest2.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
82 VBoxGuest.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
83 VBoxGuest_LIBS += \
84 $(VBOX_LIB_VBGL_R0BASE) \
85 $(VBOX_LIB_IPRT_GUEST_R0)
86 VBoxGuest_ORDERDEPS.freebsd = \
87 $(PATH_INS)/gen-sys-hdrs/pci_if.h \
88 $(PATH_INS)/gen-sys-hdrs/bus_if.h \
89 $(PATH_INS)/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_NOINST = true
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 endif # OS/2
118
119 ifeq ($(KBUILD_TARGET),win)
120 #
121 # Windows NT4 driver.
122 #
123 SYSMODS.x86 += VBoxGuestNT
124 VBoxGuestNT_EXTENDS = VBoxGuest
125 VBoxGuestNT_NOINST.win = $(NO_SUCH_VARIABLE)
126 VBoxGuestNT_DEFS = $(VBoxGuest_DEFS) TARGET_NT4
127 VBoxGuestNT_SOURCES = \
128 VBoxGuest.cpp \
129 VBoxGuest2.cpp \
130 VBoxGuest-$(KBUILD_TARGET).cpp \
131 VBoxGuest-$(KBUILD_TARGET)-legacy.cpp \
132 win/VBoxGuest.rc
133 VBoxGuestNT_LIBS = \
134 $(PATH_SDK_W2K3DDK_LIB)/exsup.lib \
135 $(PATH_SDK_W2K3DDK_LIB)/ntoskrnl.lib \
136 $(PATH_SDK_W2K3DDK_LIB)/hal.lib \
137 $(VBOX_LIB_VBGL_R0BASE) \
138 $(VBOX_LIB_IPRT_GUEST_R0_NT4)
139 endif # win
140endif # enabled
141
142ifeq ($(KBUILD_TARGET),linux)
143 #
144 # Install the source files and script(s).
145 #
146 include $(PATH_SUB_CURRENT)/linux/files_vboxguest
147 # sources and stuff.
148 INSTALLS += vboxguest-src
149 vboxguest-src_INST = $(INST_ADDITIONS)src/vboxguest/
150 vboxguest-src_MODE = a+r,u+w
151 vboxguest-src_SOURCES = $(subst ",,$(FILES_VBOXGUEST_NOBIN))
152
153 INSTALLS += vboxguest-dkms-conf
154 vboxguest-dkms-conf_INST = $(INST_ADDITIONS)src/
155 vboxguest-dkms-conf_MODE = a+r,u+w
156 vboxguest-dkms-conf_SOURCES = $(vboxguest-sh_0_OUTDIR)/dkms.conf
157 vboxguest-dkms-conf_CLEAN = $(vboxguest-sh_0_OUTDIR)/dkms.conf
158
159 INSTALLS += vboxguest-dkms-sh
160 vboxguest-dkms-sh_INST = $(INST_ADDITIONS)src/
161 vboxguest-dkms-sh_MODE = a+rx,u+w
162 vboxguest-dkms-sh_SOURCES = $(vboxguest-sh_0_OUTDIR)/do_dkms
163 vboxguest-dkms-sh_CLEAN = $(vboxguest-sh_0_OUTDIR)/do_dkms
164
165 $$(vboxguest-sh_0_OUTDIR)/dkms.conf: \
166 $(PATH_SUB_CURRENT)/linux/dkms.conf \
167 $(VBOX_VERSION_STAMP) \
168 | $$(dir $$@)
169 $(call MSG_TOOL,Creating,,$@)
170 $(QUIET)$(SED) \
171 -e "s;_VERSION_;${VBOX_VERSION_STRING};g" \
172 -e "s;_BUILDTYPE_;$(KBUILD_TYPE);g" \
173 --output $@ $<
174
175 $$(vboxguest-sh_0_OUTDIR)/do_dkms: \
176 $(PATH_ROOT)/src/VBox/HostDrivers/linux/do_dkms \
177 $(VBOX_VERSION_STAMP) \
178 | $$(dir $$@)
179 $(call MSG_TOOL,Creating,,$@)
180 $(QUIET)$(SED) \
181 -e "s;_VERSION_;${VBOX_VERSION_STRING};g" \
182 -e "s;_MODULE_;vboxguest;g" \
183 -e "s;_OLDMODULES_;vboxguest vboxadd vboxsf vboxvfs vboxvideo;g" \
184 --output $@ $<
185
186 # scripts.
187 INSTALLS += vboxguest-sh
188 vboxguest-sh_INST = $(INST_ADDITIONS)src/vboxguest/
189 vboxguest-sh_MODE = a+rx,u+w
190 vboxguest-sh_SOURCES = $(subst ",,$(FILES_VBOXGUEST_BIN))
191 vboxguest-sh_SOURCES += $(PATH_ROOT)/src/VBox/HostDrivers/linux/do_Module.symvers
192 vboxguest-sh_SOURCES += $(vboxguest-sh_0_OUTDIR)/build_in_tmp
193 vboxguest-sh_CLEAN = $(vboxguest-sh_0_OUTDIR)/build_in_tmp
194
195 $$(vboxguest-sh_0_OUTDIR)/build_in_tmp: \
196 $(PATH_ROOT)/src/VBox/HostDrivers/linux/build_in_tmp \
197 $(VBOX_VERSION_STAMP) \
198 | $$(dir $$@)
199 $(call MSG_TOOL,Creating,,$@)
200 $(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g; s;_MODULE_;vboxguest;g; s;_BUILDTYPE_;${KBUILD_TYPE};g" --output $@ $<
201 $(QUIET)$(CHMOD) 0755 $@
202
203endif # Linux
204
205ifeq ($(KBUILD_TARGET),freebsd)
206 #
207 # Install the source files and script(s).
208 #
209 include $(PATH_SUB_CURRENT)/freebsd/files_vboxguest
210 # sources and stuff.
211 INSTALLS += vboxguest-src
212 vboxguest-src_INST = $(INST_ADDITIONS)src/vboxguest/
213 vboxguest-src_MODE = a+r,u+w
214 vboxguest-src_SOURCES = $(subst ",,$(FILES_VBOXGUEST_NOBIN))
215
216endif # FreeBSD
217
218ifeq ($(KBUILD_TARGET),win)
219#
220# VBoxGuestInst - The installer.
221#
222#PROGRAMS += VBoxGuestInst
223VBoxGuestInst_TEMPLATE= VBOXGUESTR3EXE
224VBoxGuestInst_SOURCES = win/VBoxGuestInst.cpp
225endif
226
227include $(KBUILD_PATH)/subfooter.kmk
228
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette