1 | # $Id: Makefile.kmk 29044 2010-05-04 20:38:42Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Makefile for the Cross Platform Guest Additions Driver.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2007 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)
|
---|
23 | #
|
---|
24 | # VBoxGuest - The Guest Additions Driver (mixed case).
|
---|
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.solaris = VBOX_SVN_REV=$(VBOX_SVN_REV)
|
---|
34 | VBoxGuest_DEPS.solaris += $(VBOX_SVN_REV_KMK)
|
---|
35 | VBoxGuest_DEPS.linux += $(VBOX_SVN_REV_HEADER)
|
---|
36 | VBoxGuest_DEPS.freebsd += $(VBOX_SVN_REV_HEADER)
|
---|
37 | VBoxGuest_DEFS = VBGL_VBOXGUEST VBOX_WITH_HGCM
|
---|
38 | VBoxGuest_INCS = .
|
---|
39 | VBoxGuest_INCS.freebsd = $(PATH_VBoxGuest) $(PATH_INS)/gen-sys-hdrs
|
---|
40 | VBoxGuest_INCS.linux = ../../../Runtime/r0drv/linux
|
---|
41 | ifneq ($(KBUILD_TARGET),os2)
|
---|
42 | ifn1of ($(KBUILD_TARGET), linux freebsd solaris)
|
---|
43 | VBoxGuest_SOURCES = VBoxGuest-$(KBUILD_TARGET).cpp
|
---|
44 | else
|
---|
45 | VBoxGuest_SOURCES = VBoxGuest-$(KBUILD_TARGET).c
|
---|
46 | endif
|
---|
47 | VBoxGuest_SOURCES += VBoxGuest.cpp
|
---|
48 | VBoxGuest_LIBS = \
|
---|
49 | $(VBOX_LIB_VBGL_R0BASE) \
|
---|
50 | $(VBOX_LIB_IPRT_GUEST_R0)
|
---|
51 | VBoxGuest_ORDERDEPS.freebsd = \
|
---|
52 | $(PATH_INS)/gen-sys-hdrs/pci_if.h \
|
---|
53 | $(PATH_INS)/gen-sys-hdrs/bus_if.h \
|
---|
54 | $(PATH_INS)/gen-sys-hdrs/device_if.h
|
---|
55 |
|
---|
56 | else # OS/2:
|
---|
57 | # The library order is crucial, so a bit of trickery is necessary.
|
---|
58 | # A library is used to make sure that VBoxGuestA-os2.asm is first in the link. (temporary hack?)
|
---|
59 | VBoxGuest_SOURCES = \
|
---|
60 | VBoxGuestA-os2.asm \
|
---|
61 | VBoxGuest-os2.def
|
---|
62 | #VBoxGuest_LDFLAGS = -s -t -v
|
---|
63 | VBoxGuest_LIBS = \
|
---|
64 | $(TARGET_VBoxGuestLibOs2Hack) \
|
---|
65 | $(VBOX_LIB_VBGL_R0BASE) \
|
---|
66 | $(VBOX_LIB_IPRT_GUEST_R0) \
|
---|
67 | $(VBOX_GCC_LIBGCC) \
|
---|
68 | end
|
---|
69 | ## When debugging init with kDrvTest:
|
---|
70 | #VBoxGuest_NAME = VBoxGst
|
---|
71 |
|
---|
72 | # see
|
---|
73 | LIBRARIES += VBoxGuestLibOs2Hack
|
---|
74 | VBoxGuestLibOs2Hack_TEMPLATE = VBOXGUESTR0LIB
|
---|
75 | VBoxGuestLibOs2Hack_NOINST = true
|
---|
76 | VBoxGuestLibOs2Hack_DEFS = $(VBoxGuest_DEFS)
|
---|
77 | VBoxGuestLibOs2Hack_INCS = \
|
---|
78 | . \
|
---|
79 | $(PATH_ROOT)/src/VBox/Runtime/include # for the os2ddk
|
---|
80 | VBoxGuestLibOs2Hack_SOURCES = \
|
---|
81 | VBoxGuest-os2.cpp \
|
---|
82 | VBoxGuest.cpp
|
---|
83 | endif # OS/2
|
---|
84 |
|
---|
85 | endif # enabled
|
---|
86 |
|
---|
87 | ifeq ($(KBUILD_TARGET),linux)
|
---|
88 | #
|
---|
89 | # Install the source files and script(s).
|
---|
90 | #
|
---|
91 | include $(PATH_SUB_CURRENT)/linux/files_vboxguest
|
---|
92 | # sources and stuff.
|
---|
93 | INSTALLS += vboxguest-src
|
---|
94 | vboxguest-src_INST = $(INST_ADDITIONS)src/vboxguest/
|
---|
95 | vboxguest-src_MODE = a+r,u+w
|
---|
96 | vboxguest-src_SOURCES = $(subst ",,$(FILES_VBOXGUEST_NOBIN))
|
---|
97 | vboxguest-src_SOURCES += $(if $(VBOX_OSE),,$(vboxguest-sh_0_OUTDIR)/dkms.conf)
|
---|
98 | vboxguest-src_CLEAN = $(vboxguest-sh_0_OUTDIR)/dkms.conf
|
---|
99 |
|
---|
100 | $$(vboxguest-sh_0_OUTDIR)/dkms.conf: \
|
---|
101 | $(PATH_SUB_CURRENT)/linux/dkms.conf \
|
---|
102 | $(VBOX_VERSION_STAMP) \
|
---|
103 | | $$(dir $$@)
|
---|
104 | $(call MSG_TOOL,Creating,,$@)
|
---|
105 | $(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g" --output $@ $<
|
---|
106 |
|
---|
107 | # scripts.
|
---|
108 | INSTALLS += vboxguest-sh
|
---|
109 | vboxguest-sh_INST = $(INST_ADDITIONS)src/vboxguest/
|
---|
110 | vboxguest-sh_MODE = a+rx,u+w
|
---|
111 | vboxguest-sh_SOURCES = $(subst ",,$(FILES_VBOXGUEST_BIN))
|
---|
112 | vboxguest-sh_SOURCES += $(if $(VBOX_OSE),,$(PATH_ROOT)/src/VBox/HostDrivers/linux/do_Module.symvers)
|
---|
113 | vboxguest-sh_SOURCES += $(vboxguest-sh_0_OUTDIR)/build_in_tmp
|
---|
114 | vboxguest-sh_CLEAN = $(vboxguest-sh_0_OUTDIR)/build_in_tmp
|
---|
115 |
|
---|
116 | $$(vboxguest-sh_0_OUTDIR)/build_in_tmp: \
|
---|
117 | $(PATH_ROOT)/src/VBox/HostDrivers/linux/build_in_tmp \
|
---|
118 | $(VBOX_VERSION_STAMP) \
|
---|
119 | | $$(dir $$@)
|
---|
120 | $(call MSG_TOOL,Creating,,$@)
|
---|
121 | $(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g; s;_MODULE_;vboxguest;g; s;_BUILDTYPE_;${KBUILD_TYPE};g" --output $@ $<
|
---|
122 | $(QUIET)$(CHMOD) 0755 $@
|
---|
123 |
|
---|
124 | endif # Linux
|
---|
125 |
|
---|
126 | ifeq ($(KBUILD_TARGET),freebsd)
|
---|
127 | #
|
---|
128 | # Install the source files and script(s).
|
---|
129 | #
|
---|
130 | include $(PATH_SUB_CURRENT)/freebsd/files_vboxguest
|
---|
131 | # sources and stuff.
|
---|
132 | INSTALLS += vboxguest-src
|
---|
133 | vboxguest-src_INST = $(INST_ADDITIONS)src/vboxguest/
|
---|
134 | vboxguest-src_MODE = a+r,u+w
|
---|
135 | vboxguest-src_SOURCES = $(subst ",,$(FILES_VBOXGUEST_NOBIN))
|
---|
136 |
|
---|
137 | endif # FreeBSD
|
---|
138 |
|
---|
139 | include $(KBUILD_PATH)/subfooter.kmk
|
---|
140 |
|
---|