VirtualBox

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

Last change on this file since 32267 was 32266, checked in by vboxsync, 15 years ago

Guest Additions/Windows: First working version of unified driver (no NT4 yet).

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