VirtualBox

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

Last change on this file since 41683 was 41683, checked in by vboxsync, 13 years ago

Additions/common/VBoxGuest: make the Solaris module linkable with GNU ld on a Linux build host.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.4 KB
Line 
1# $Id: Makefile.kmk 41683 2012-06-13 13:01:05Z 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
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 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_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 = $(VBoxGuest_0_OUTDIR) $(PATH_STAGE)/gen-sys-hdrs
53 VBoxGuest_INCS.linux = ../../../Runtime/r0drv/linux
54 ifeq ($(KBUILD_HOST),solaris)
55 VBoxGuest_LDFLAGS.solaris += -N misc/ctf
56 else
57 VBoxGuest_SOURCES.solaris = solaris/deps.s
58 solaris/deps.s_ASFLAGS = -f bin -g null
59 endif
60 ifneq ($(KBUILD_TARGET),os2)
61 ifeq ($(KBUILD_TARGET),win)
62 VBoxGuest_LDFLAGS.x86 = -Entry:DriverEntry@8
63 VBoxGuest_LDFLAGS.amd64 = -Entry:DriverEntry
64 VBoxGuest_LIBS = \
65 $(PATH_SDK_W2K3DDK_LIB)/ntoskrnl.lib \
66 $(PATH_SDK_W2K3DDK_LIB)/hal.lib
67 ifdef VBOX_WITH_GUEST_BUGCHECK_DETECTION
68 VBoxGuest_LIBS += \
69 $(PATH_SDK_WINDDKWLH_LIB)/aux_klib.lib \
70 $(PATH_SDK_WINDDKWLH_LIB)/ksecdd.lib \
71 $(PATH_SDK_WINDDKWLH_LIB)/BufferOverflowK.lib
72 VBoxGuest.cpp_SDKS = WINDDKWLH
73 endif
74 endif # win
75 ifn1of ($(KBUILD_TARGET), linux freebsd solaris)
76 VBoxGuest_SOURCES = VBoxGuest-$(KBUILD_TARGET).cpp
77 else
78 VBoxGuest_SOURCES = VBoxGuest-$(KBUILD_TARGET).c
79 endif
80 VBoxGuest_SOURCES += \
81 VBoxGuest.cpp \
82 VBoxGuest2.cpp
83 ifeq ($(KBUILD_TARGET), win)
84 VBoxGuest_SOURCES += \
85 VBoxGuest-$(KBUILD_TARGET)-pnp.cpp \
86 win/VBoxGuest.rc
87 endif
88 VBoxGuest_LIBS += \
89 $(VBOX_LIB_VBGL_R0BASE) \
90 $(VBOX_LIB_IPRT_GUEST_R0)
91 VBoxGuest_ORDERDEPS.freebsd = \
92 $(PATH_STAGE)/gen-sys-hdrs/pci_if.h \
93 $(PATH_STAGE)/gen-sys-hdrs/bus_if.h \
94 $(PATH_STAGE)/gen-sys-hdrs/device_if.h
95 else # OS/2:
96 # The library order is crucial, so a bit of trickery is necessary.
97 # A library is used to make sure that VBoxGuestA-os2.asm is first in the link. (temporary hack?)
98 VBoxGuest_SOURCES = \
99 VBoxGuestA-os2.asm \
100 VBoxGuest-os2.def
101 #VBoxGuest_LDFLAGS = -s -t -v
102 VBoxGuest_LIBS = \
103 $(TARGET_VBoxGuestLibOs2Hack) \
104 $(VBOX_LIB_VBGL_R0BASE) \
105 $(VBOX_LIB_IPRT_GUEST_R0) \
106 $(VBOX_GCC_LIBGCC) \
107 end
108 ## When debugging init with kDrvTest:
109 #VBoxGuest_NAME = VBoxGst
110
111 # see
112 LIBRARIES += VBoxGuestLibOs2Hack
113 VBoxGuestLibOs2Hack_TEMPLATE = VBOXGUESTR0LIB
114 VBoxGuestLibOs2Hack_INSTTYPE = none
115 VBoxGuestLibOs2Hack_DEFS = $(VBoxGuest_DEFS)
116 VBoxGuestLibOs2Hack_INCS = \
117 . \
118 $(PATH_ROOT)/src/VBox/Runtime/include # for the os2ddk
119 VBoxGuestLibOs2Hack_SOURCES = \
120 VBoxGuest-os2.cpp \
121 VBoxGuest.cpp \
122 VBoxGuest2.cpp
123 endif # OS/2
124
125 VBoxGuest2.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
126 VBoxGuest.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
127
128 ifeq ($(KBUILD_TARGET),win)
129 #
130 # Windows NT4 driver.
131 #
132 SYSMODS.x86 += VBoxGuestNT
133 VBoxGuestNT_EXTENDS = VBoxGuest
134 VBoxGuestNT_INSTTYPE.win = both
135 VBoxGuestNT_DEFS = $(VBoxGuest_DEFS) TARGET_NT4
136 VBoxGuestNT_SOURCES = \
137 VBoxGuest.cpp \
138 VBoxGuest2.cpp \
139 VBoxGuest-$(KBUILD_TARGET).cpp \
140 VBoxGuest-$(KBUILD_TARGET)-legacy.cpp \
141 win/VBoxGuest.rc
142 VBoxGuestNT_LIBS = \
143 $(PATH_SDK_W2K3DDK_LIB)/exsup.lib \
144 $(PATH_SDK_W2K3DDK_LIB)/ntoskrnl.lib \
145 $(PATH_SDK_W2K3DDK_LIB)/hal.lib \
146 $(VBOX_LIB_VBGL_R0BASE) \
147 $(VBOX_LIB_IPRT_GUEST_R0_NT4)
148 endif # win
149endif # enabled
150
151ifeq ($(KBUILD_TARGET),linux)
152 #
153 # Install the source files and script(s).
154 #
155 include $(PATH_SUB_CURRENT)/linux/files_vboxguest
156 # sources and stuff.
157 INSTALLS += vboxguest-src
158 vboxguest-src_INST = $(INST_ADDITIONS)src/vboxguest/
159 vboxguest-src_MODE = a+r,u+w
160 vboxguest-src_SOURCES = $(subst ",,$(FILES_VBOXGUEST_NOBIN))
161
162 INSTALLS += vboxguest-conf
163 vboxguest-conf_INST = $(INST_ADDITIONS)src/
164 vboxguest-conf_MODE = a+r,u+w
165 vboxguest-conf_SOURCES = $(vboxguest-sh_0_OUTDIR)/dkms.conf
166 vboxguest-conf_CLEAN = $(vboxguest-sh_0_OUTDIR)/dkms.conf
167
168 INSTALLS += vboxguest-scripts
169 vboxguest-scripts_INST = $(INST_ADDITIONS)src/
170 vboxguest-scripts_MODE = a+rx,u+w
171 vboxguest-scripts_SOURCES = ../../../HostDrivers/linux/do_dkms \
172 ../../../HostDrivers/linux/build_in_tmp
173
174 $$(vboxguest-sh_0_OUTDIR)/dkms.conf: \
175 $(PATH_SUB_CURRENT)/linux/dkms.conf \
176 $(VBOX_VERSION_STAMP) \
177 | $$(dir $$@)
178 $(call MSG_TOOL,Creating,,$@)
179 $(QUIET)$(SED) \
180 -e "s;_VERSION_;${VBOX_VERSION_STRING};g" \
181 -e "s;_BUILDTYPE_;$(KBUILD_TYPE);g" \
182 --output $@ $<
183
184 # scripts.
185 INSTALLS += vboxguest-sh
186 vboxguest-sh_INST = $(INST_ADDITIONS)src/vboxguest/
187 vboxguest-sh_MODE = a+rx,u+w
188 vboxguest-sh_SOURCES = $(subst ",,$(FILES_VBOXGUEST_BIN))
189 vboxguest-sh_SOURCES += $(PATH_ROOT)/src/VBox/HostDrivers/linux/do_Module.symvers
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
215
216if defined(VBOX_WITH_TESTCASES) && !defined(VBOX_ONLY_ADDITIONS) && !defined(VBOX_ONLY_SDK)
217 ifn1of ($(KBUILD_TARGET), solaris win) # No variadic macros in Visual C++ 2002; Unresolved RTR0AssertPanicSystem on Solaris 11 / gcc 4.5.2.
218 PROGRAMS += tstVBoxGuest-solaris
219 tstVBoxGuest-solaris_TEMPLATE = VBOXR3TSTEXE
220 tstVBoxGuest-solaris_SOURCES = \
221 VBoxGuest-solaris-streams.c \
222 testcase/tstVBoxGuest-solaris.c
223 tstVBoxGuest-solaris_DEFS = TESTCASE
224 tstVBoxGuest-solaris_LIBS = $(LIB_RUNTIME)
225 endif
226endif
227
228include $(FILE_KBUILD_SUB_FOOTER)
229
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