1 | # $Id: Makefile.kmk 41972 2012-06-29 13:35:30Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Makefile for the Cross Platform Guest Additions Driver.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2007-2012 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 |
|
---|
18 | SUB_DEPTH = ../../../../..
|
---|
19 | include $(KBUILD_PATH)/subheader.kmk
|
---|
20 |
|
---|
21 |
|
---|
22 | if1of ($(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_DEFS.win += \
|
---|
48 | $(if $(VBOX_WITH_DPC_LATENCY_CHECKER),VBOX_WITH_DPC_LATENCY_CHECKER,)
|
---|
49 | VBoxGuest_DEPS.solaris += $(VBOX_SVN_REV_KMK)
|
---|
50 | VBoxGuest_DEPS.linux += $(VBOX_SVN_REV_HEADER)
|
---|
51 | VBoxGuest_DEPS.freebsd += $(VBOX_SVN_REV_HEADER)
|
---|
52 | VBoxGuest_DEFS = VBGL_VBOXGUEST VBOX_WITH_HGCM
|
---|
53 | VBoxGuest_INCS = .
|
---|
54 | VBoxGuest_INCS.freebsd = $(VBoxGuest_0_OUTDIR) $(PATH_STAGE)/gen-sys-hdrs
|
---|
55 | VBoxGuest_INCS.linux = ../../../Runtime/r0drv/linux
|
---|
56 | ifeq ($(KBUILD_HOST),solaris)
|
---|
57 | VBoxGuest_LDFLAGS.solaris += -N misc/ctf
|
---|
58 | else
|
---|
59 | VBoxGuest_SOURCES.solaris = solaris/deps.asm
|
---|
60 | VBoxGuest_solaris/deps.asm_ASFLAGS = -f bin -g null
|
---|
61 | endif
|
---|
62 | ifneq ($(KBUILD_TARGET),os2)
|
---|
63 | ifeq ($(KBUILD_TARGET),win)
|
---|
64 | VBoxGuest_LDFLAGS.x86 = -Entry:DriverEntry@8
|
---|
65 | VBoxGuest_LDFLAGS.amd64 = -Entry:DriverEntry
|
---|
66 | VBoxGuest_LIBS = \
|
---|
67 | $(PATH_SDK_W2K3DDK_LIB)/ntoskrnl.lib \
|
---|
68 | $(PATH_SDK_W2K3DDK_LIB)/hal.lib
|
---|
69 | ifdef VBOX_WITH_GUEST_BUGCHECK_DETECTION
|
---|
70 | VBoxGuest_LIBS += \
|
---|
71 | $(PATH_SDK_WINDDKWLH_LIB)/aux_klib.lib \
|
---|
72 | $(PATH_SDK_WINDDKWLH_LIB)/ksecdd.lib \
|
---|
73 | $(PATH_SDK_WINDDKWLH_LIB)/BufferOverflowK.lib
|
---|
74 | VBoxGuest.cpp_SDKS = WINDDKWLH
|
---|
75 | endif
|
---|
76 | endif # win
|
---|
77 | ifn1of ($(KBUILD_TARGET), linux freebsd solaris)
|
---|
78 | VBoxGuest_SOURCES = VBoxGuest-$(KBUILD_TARGET).cpp
|
---|
79 | else
|
---|
80 | VBoxGuest_SOURCES = VBoxGuest-$(KBUILD_TARGET).c
|
---|
81 | endif
|
---|
82 | VBoxGuest_SOURCES += \
|
---|
83 | VBoxGuest.cpp \
|
---|
84 | VBoxGuest2.cpp
|
---|
85 | ifeq ($(KBUILD_TARGET), win)
|
---|
86 | VBoxGuest_SOURCES += \
|
---|
87 | VBoxGuest-$(KBUILD_TARGET)-pnp.cpp \
|
---|
88 | win/VBoxGuest.rc
|
---|
89 | endif
|
---|
90 | VBoxGuest_LIBS += \
|
---|
91 | $(VBOX_LIB_VBGL_R0BASE) \
|
---|
92 | $(VBOX_LIB_IPRT_GUEST_R0)
|
---|
93 | VBoxGuest_ORDERDEPS.freebsd = \
|
---|
94 | $(PATH_STAGE)/gen-sys-hdrs/pci_if.h \
|
---|
95 | $(PATH_STAGE)/gen-sys-hdrs/bus_if.h \
|
---|
96 | $(PATH_STAGE)/gen-sys-hdrs/device_if.h
|
---|
97 | else # OS/2:
|
---|
98 | # The library order is crucial, so a bit of trickery is necessary.
|
---|
99 | # A library is used to make sure that VBoxGuestA-os2.asm is first in the link. (temporary hack?)
|
---|
100 | VBoxGuest_SOURCES = \
|
---|
101 | VBoxGuestA-os2.asm \
|
---|
102 | VBoxGuest-os2.def
|
---|
103 | #VBoxGuest_LDFLAGS = -s -t -v
|
---|
104 | VBoxGuest_LIBS = \
|
---|
105 | $(TARGET_VBoxGuestLibOs2Hack) \
|
---|
106 | $(VBOX_LIB_VBGL_R0BASE) \
|
---|
107 | $(VBOX_LIB_IPRT_GUEST_R0) \
|
---|
108 | $(VBOX_GCC_LIBGCC) \
|
---|
109 | end
|
---|
110 | ## When debugging init with kDrvTest:
|
---|
111 | #VBoxGuest_NAME = VBoxGst
|
---|
112 |
|
---|
113 | # see
|
---|
114 | LIBRARIES += VBoxGuestLibOs2Hack
|
---|
115 | VBoxGuestLibOs2Hack_TEMPLATE = VBOXGUESTR0LIB
|
---|
116 | VBoxGuestLibOs2Hack_INSTTYPE = none
|
---|
117 | VBoxGuestLibOs2Hack_DEFS = $(VBoxGuest_DEFS)
|
---|
118 | VBoxGuestLibOs2Hack_INCS = \
|
---|
119 | . \
|
---|
120 | $(PATH_ROOT)/src/VBox/Runtime/include # for the os2ddk
|
---|
121 | VBoxGuestLibOs2Hack_SOURCES = \
|
---|
122 | VBoxGuest-os2.cpp \
|
---|
123 | VBoxGuest.cpp \
|
---|
124 | VBoxGuest2.cpp
|
---|
125 | endif # OS/2
|
---|
126 |
|
---|
127 | VBoxGuest2.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
|
---|
128 | VBoxGuest.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
|
---|
129 |
|
---|
130 | ifeq ($(KBUILD_TARGET),win)
|
---|
131 | #
|
---|
132 | # Windows NT4 driver.
|
---|
133 | #
|
---|
134 | SYSMODS.x86 += VBoxGuestNT
|
---|
135 | VBoxGuestNT_EXTENDS = VBoxGuest
|
---|
136 | VBoxGuestNT_INSTTYPE.win = both
|
---|
137 | VBoxGuestNT_DEFS = $(VBoxGuest_DEFS) TARGET_NT4
|
---|
138 | VBoxGuestNT_SOURCES = \
|
---|
139 | VBoxGuest.cpp \
|
---|
140 | VBoxGuest2.cpp \
|
---|
141 | VBoxGuest-$(KBUILD_TARGET).cpp \
|
---|
142 | VBoxGuest-$(KBUILD_TARGET)-legacy.cpp \
|
---|
143 | win/VBoxGuest.rc
|
---|
144 | VBoxGuestNT_LIBS = \
|
---|
145 | $(PATH_SDK_W2K3DDK_LIB)/exsup.lib \
|
---|
146 | $(PATH_SDK_W2K3DDK_LIB)/ntoskrnl.lib \
|
---|
147 | $(PATH_SDK_W2K3DDK_LIB)/hal.lib \
|
---|
148 | $(VBOX_LIB_VBGL_R0BASE) \
|
---|
149 | $(VBOX_LIB_IPRT_GUEST_R0_NT4)
|
---|
150 | endif # win
|
---|
151 | endif # enabled
|
---|
152 |
|
---|
153 | ifeq ($(KBUILD_TARGET),linux)
|
---|
154 | #
|
---|
155 | # Install the source files and script(s).
|
---|
156 | #
|
---|
157 | include $(PATH_SUB_CURRENT)/linux/files_vboxguest
|
---|
158 | # sources and stuff.
|
---|
159 | INSTALLS += vboxguest-src
|
---|
160 | vboxguest-src_INST = $(INST_ADDITIONS)src/vboxguest/
|
---|
161 | vboxguest-src_MODE = a+r,u+w
|
---|
162 | vboxguest-src_SOURCES = $(subst ",,$(FILES_VBOXGUEST_NOBIN))
|
---|
163 |
|
---|
164 | INSTALLS += vboxguest-conf
|
---|
165 | vboxguest-conf_INST = $(INST_ADDITIONS)src/
|
---|
166 | vboxguest-conf_MODE = a+r,u+w
|
---|
167 | vboxguest-conf_SOURCES = $(vboxguest-sh_0_OUTDIR)/dkms.conf
|
---|
168 | vboxguest-conf_CLEAN = $(vboxguest-sh_0_OUTDIR)/dkms.conf
|
---|
169 |
|
---|
170 | INSTALLS += vboxguest-scripts
|
---|
171 | vboxguest-scripts_INST = $(INST_ADDITIONS)src/
|
---|
172 | vboxguest-scripts_MODE = a+rx,u+w
|
---|
173 | vboxguest-scripts_SOURCES = ../../../HostDrivers/linux/do_dkms \
|
---|
174 | ../../../HostDrivers/linux/build_in_tmp
|
---|
175 |
|
---|
176 | $$(vboxguest-sh_0_OUTDIR)/dkms.conf: \
|
---|
177 | $(PATH_SUB_CURRENT)/linux/dkms.conf \
|
---|
178 | $(VBOX_VERSION_STAMP) \
|
---|
179 | | $$(dir $$@)
|
---|
180 | $(call MSG_TOOL,Creating,,$@)
|
---|
181 | $(QUIET)$(SED) \
|
---|
182 | -e "s;_VERSION_;${VBOX_VERSION_STRING};g" \
|
---|
183 | -e "s;_BUILDTYPE_;$(KBUILD_TYPE);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 |
|
---|
193 | endif # Linux
|
---|
194 |
|
---|
195 | ifeq ($(KBUILD_TARGET),freebsd)
|
---|
196 | #
|
---|
197 | # Install the source files and script(s).
|
---|
198 | #
|
---|
199 | include $(PATH_SUB_CURRENT)/freebsd/files_vboxguest
|
---|
200 | # sources and stuff.
|
---|
201 | INSTALLS += vboxguest-src
|
---|
202 | vboxguest-src_INST = $(INST_ADDITIONS)src/vboxguest/
|
---|
203 | vboxguest-src_MODE = a+r,u+w
|
---|
204 | vboxguest-src_SOURCES = $(subst ",,$(FILES_VBOXGUEST_NOBIN))
|
---|
205 |
|
---|
206 | endif # FreeBSD
|
---|
207 |
|
---|
208 | ifeq ($(KBUILD_TARGET),win)
|
---|
209 | #
|
---|
210 | # VBoxGuestInst - The installer.
|
---|
211 | #
|
---|
212 | #PROGRAMS += VBoxGuestInst
|
---|
213 | VBoxGuestInst_TEMPLATE= VBOXGUESTR3EXE
|
---|
214 | VBoxGuestInst_SOURCES = win/VBoxGuestInst.cpp
|
---|
215 | endif
|
---|
216 |
|
---|
217 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
218 |
|
---|