23
23
include $(KBUILD_PATH)/subheader.kmk
26
if1of ($(KBUILD_TARGET), \
28
$(if $(defined VBOX_WITH_OS2_ADDITIONS),os2,) \
29
$(if $(defined VBOX_WITH_ADDITION_DRIVERS),linux,) \
30
solaris) # linux is not yet using this code, just for syntax checking changes.
26
if1of ($(KBUILD_TARGET), freebsd $(if $(defined VBOX_WITH_ADDITION_DRIVERS),linux,) os2 solaris)
32
28
# VBoxGuest - The Guest Additions Driver (mixed case).
37
33
VBoxGuest_NAME.linux = vboxguest
38
34
VBoxGuest_NAME.solaris = vboxguest
39
35
VBoxGuest_NOINST.linux = true
36
VBoxGuest_DEFS.linux = KBUILD_MODNAME=KBUILD_STR\(vboxguest\) KBUILD_BASENAME=KBUILD_STR\(vboxguest\) DEBUG_HASH=2 DEBUG_HASH2=3 EXPORT_SYMTAB
40
37
VBoxGuest_DEFS.solaris = VBOX_SVN_REV=$(VBOX_SVN_REV)
41
38
VBoxGuest_DEPS.solaris += $(VBOX_SVN_REV_KMK)
42
39
VBoxGuest_DEFS = VBGL_VBOXGUEST VBOX_WITH_HGCM
44
VBoxGuest_INCS.freebsd = $(PATH_VBoxGuest)
41
VBoxGuest_INCS.freebsd = $(PATH_VBoxGuest) $(PATH_INS)/gen-sys-hdrs
42
VBoxGuest_INCS.linux = ../../../Runtime/r0drv/linux
45
43
ifneq ($(KBUILD_TARGET),os2)
46
44
ifn1of ($(KBUILD_TARGET), linux freebsd solaris)
47
45
VBoxGuest_SOURCES = VBoxGuest-$(KBUILD_TARGET).cpp
49
47
VBoxGuest_SOURCES = VBoxGuest-$(KBUILD_TARGET).c
51
49
VBoxGuest_SOURCES += VBoxGuest.cpp
53
51
$(VBOX_LIB_VBGL_R0BASE) \
54
52
$(VBOX_LIB_IPRT_GUEST_R0)
55
VBoxGuest_INTERMEDIATES.freebsd = \
56
$(PATH_VBoxGuest)/pci_if.h \
57
$(PATH_VBoxGuest)/bus_if.h \
58
$(PATH_VBoxGuest)/device_if.h
59
VBoxGuest_CLEAN.freebsd = $(VBoxGuest_INTERMEDIATES.freebsd)
53
VBoxGuest_ORDERDEPS.freebsd = \
54
$(PATH_INS)/gen-sys-hdrs/pci_if.h \
55
$(PATH_INS)/gen-sys-hdrs/bus_if.h \
56
$(PATH_INS)/gen-sys-hdrs/device_if.h
62
59
# The library order is crucial, so a bit of trickery is necessary.
90
ifeq ($(KBUILD_TARGET),freebsd)
92
# FreeBSD: Genereate bus, device and pci interface headers. (explain why)
94
# We cannot give a output path to the awk program, it will always generate
95
# the header next to the source. So, we'll have to temporarily copy the
96
# source file to the destination direction for it to work out correctly.
98
VBOX_AWK := /usr/bin/awk
99
$$(PATH_VBoxGuest)/bus_if.h: $(VBOX_FREEBSD_SRC)/kern/bus_if.m
100
$(call MSG_TOOL,awk,VBoxGuest,$<,$@)
101
$(QUIET)$(CP) -f $(VBOX_FREEBSD_SRC)/kern/bus_if.m $(PATH_VBoxGuest)/bus_if.m
102
$(QUIET)$(VBOX_AWK) -f $(VBOX_FREEBSD_SRC)/tools/makeobjops.awk $(PATH_VBoxGuest)/bus_if.m -h -p
103
$(QUIET)$(RM) $(PATH_VBoxGuest)/bus_if.m
105
$$(PATH_VBoxGuest)/device_if.h: $(VBOX_FREEBSD_SRC)/kern/device_if.m
106
$(call MSG_TOOL,awk,VBoxGuest,$<,$@)
107
$(QUIET)$(CP) -f $(VBOX_FREEBSD_SRC)/kern/device_if.m $(PATH_VBoxGuest)/device_if.m
108
$(QUIET)$(VBOX_AWK) -f $(VBOX_FREEBSD_SRC)/tools/makeobjops.awk $(PATH_VBoxGuest)/device_if.m -h -p
109
$(QUIET)$(RM) $(PATH_VBoxGuest)/device_if.m
111
$$(PATH_VBoxGuest)/pci_if.h: $(VBOX_FREEBSD_SRC)/dev/pci/pci_if.m
112
$(call MSG_TOOL,awk,VBoxGuest,$<,$@)
113
$(QUIET)$(CP) -f $(VBOX_FREEBSD_SRC)/dev/pci/pci_if.m $(PATH_VBoxGuest)/pci_if.m
114
$(QUIET)$(VBOX_AWK) -f $(VBOX_FREEBSD_SRC)/tools/makeobjops.awk $(PATH_VBoxGuest)/pci_if.m -h -p
115
$(QUIET)$(RM) $(PATH_VBoxGuest)/pci_if.m
89
ifeq ($(KBUILD_TARGET),linux)
91
# Install the source files and script(s).
93
include $(PATH_SUB_CURRENT)/linux/files_vboxguest
95
INSTALLS += vboxguest-src
96
vboxguest-src_INST = $(INST_ADDITIONS)src/vboxguest/
97
vboxguest-src_MODE = a+r,u+w
98
vboxguest-src_SOURCES = $(subst ",,$(FILES_VBOXGUEST_NOBIN))
99
vboxguest-src_SOURCES += $(if $(VBOX_OSE),,$(vboxguest-sh_0_OUTDIR)/dkms.conf)
100
vboxguest-src_CLEAN = $(vboxguest-sh_0_OUTDIR)/dkms.conf
102
$$(vboxguest-sh_0_OUTDIR)/dkms.conf: \
103
$(PATH_SUB_CURRENT)/linux/dkms.conf \
104
$(VBOX_VERSION_STAMP) \
106
$(call MSG_TOOL,Creating,,$@)
107
$(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g" --output $@ $<
110
INSTALLS += vboxguest-sh
111
vboxguest-sh_INST = $(INST_ADDITIONS)src/vboxguest/
112
vboxguest-sh_MODE = a+rx,u+w
113
vboxguest-sh_SOURCES = $(subst ",,$(FILES_VBOXGUEST_BIN))
114
vboxguest-sh_SOURCES += $(if $(VBOX_OSE),,$(PATH_ROOT)/src/VBox/HostDrivers/linux/do_Module.symvers)
115
vboxguest-sh_SOURCES += $(vboxguest-sh_0_OUTDIR)/build_in_tmp
116
vboxguest-sh_CLEAN = $(vboxguest-sh_0_OUTDIR)/build_in_tmp
118
$$(vboxguest-sh_0_OUTDIR)/build_in_tmp: \
119
$(PATH_ROOT)/src/VBox/HostDrivers/linux/build_in_tmp \
120
$(VBOX_VERSION_STAMP) \
122
$(call MSG_TOOL,Creating,,$@)
123
$(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g; s;_MODULE_;vboxguest;g" --output $@ $<
124
$(QUIET)$(CHMOD) 0755 $@
120
128
include $(KBUILD_PATH)/subfooter.kmk