1 | # $Id: Makefile.kmk 21069 2009-06-30 14:23:40Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Makefile for the Cross Platform Guest Additions Driver.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2007 Sun Microsystems, Inc.
|
---|
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 | # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
18 | # Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
19 | # additional information or have any questions.
|
---|
20 | #
|
---|
21 |
|
---|
22 | SUB_DEPTH = ../../../../..
|
---|
23 | include $(KBUILD_PATH)/subheader.kmk
|
---|
24 |
|
---|
25 |
|
---|
26 | if1of ($(KBUILD_TARGET), \
|
---|
27 | freebsd \
|
---|
28 | $(if $(defined VBOX_WITH_OS2_ADDITIONS),os2,) \
|
---|
29 | $(if $(defined VBOX_WITH_ADDITION_DRIVERS),linux,) \
|
---|
30 | solaris)
|
---|
31 | #
|
---|
32 | # VBoxGuest - The Guest Additions Driver (mixed case).
|
---|
33 | #
|
---|
34 | SYSMODS += VBoxGuest
|
---|
35 | VBoxGuest_TEMPLATE = VBOXGUESTR0
|
---|
36 | VBoxGuest_NAME.freebsd = vboxguest
|
---|
37 | VBoxGuest_NAME.linux = vboxguest
|
---|
38 | VBoxGuest_NAME.solaris = vboxguest
|
---|
39 | VBoxGuest_NOINST.linux = true
|
---|
40 | VBoxGuest_DEFS.solaris = VBOX_SVN_REV=$(VBOX_SVN_REV)
|
---|
41 | VBoxGuest_DEPS.solaris += $(VBOX_SVN_REV_KMK)
|
---|
42 | VBoxGuest_DEFS = VBGL_VBOXGUEST VBOX_WITH_HGCM
|
---|
43 | VBoxGuest_INCS = .
|
---|
44 | VBoxGuest_INCS.freebsd = $(PATH_VBoxGuest)
|
---|
45 | VBoxGuest_INCS.linux = ../../../Runtime/r0drv/linux
|
---|
46 | ifneq ($(KBUILD_TARGET),os2)
|
---|
47 | ifn1of ($(KBUILD_TARGET), linux freebsd solaris)
|
---|
48 | VBoxGuest_SOURCES = VBoxGuest-$(KBUILD_TARGET).cpp
|
---|
49 | else
|
---|
50 | VBoxGuest_SOURCES = VBoxGuest-$(KBUILD_TARGET).c
|
---|
51 | endif
|
---|
52 | VBoxGuest_SOURCES += VBoxGuest.cpp
|
---|
53 | VBoxGuest_LIBS = \
|
---|
54 | $(VBOX_LIB_VBGL_R0BASE) \
|
---|
55 | $(VBOX_LIB_IPRT_GUEST_R0)
|
---|
56 | VBoxGuest_INTERMEDIATES.freebsd = \
|
---|
57 | $(PATH_VBoxGuest)/pci_if.h \
|
---|
58 | $(PATH_VBoxGuest)/bus_if.h \
|
---|
59 | $(PATH_VBoxGuest)/device_if.h
|
---|
60 | VBoxGuest_CLEAN.freebsd = $(VBoxGuest_INTERMEDIATES.freebsd)
|
---|
61 |
|
---|
62 | else # OS/2:
|
---|
63 | # The library order is crucial, so a bit of trickery is necessary.
|
---|
64 | # A library is used to make sure that VBoxGuestA-os2.asm is first in the link. (temporary hack?)
|
---|
65 | VBoxGuest_SOURCES = \
|
---|
66 | VBoxGuestA-os2.asm \
|
---|
67 | VBoxGuest-os2.def
|
---|
68 | #VBoxGuest_LDFLAGS = -s -t -v
|
---|
69 | VBoxGuest_LIBS = \
|
---|
70 | $(TARGET_VBoxGuestLibOs2Hack) \
|
---|
71 | $(VBOX_LIB_VBGL_R0BASE) \
|
---|
72 | $(VBOX_LIB_IPRT_GUEST_R0) \
|
---|
73 | $(VBOX_GCC_LIBGCC) \
|
---|
74 | end
|
---|
75 | ## When debugging init with kDrvTest:
|
---|
76 | #VBoxGuest_NAME = VBoxGst
|
---|
77 |
|
---|
78 | # see
|
---|
79 | LIBRARIES += VBoxGuestLibOs2Hack
|
---|
80 | VBoxGuestLibOs2Hack_TEMPLATE = VBOXGUESTR0LIB
|
---|
81 | VBoxGuestLibOs2Hack_NOINST = true
|
---|
82 | VBoxGuestLibOs2Hack_DEFS = $(VBoxGuest_DEFS)
|
---|
83 | VBoxGuestLibOs2Hack_INCS = \
|
---|
84 | . \
|
---|
85 | $(PATH_ROOT)/src/VBox/Runtime/include # for the os2ddk
|
---|
86 | VBoxGuestLibOs2Hack_SOURCES = \
|
---|
87 | VBoxGuest-os2.cpp \
|
---|
88 | VBoxGuest.cpp
|
---|
89 | endif # OS/2
|
---|
90 |
|
---|
91 | ifeq ($(KBUILD_TARGET),freebsd)
|
---|
92 | #
|
---|
93 | # FreeBSD: Genereate bus, device and pci interface headers. (explain why)
|
---|
94 | #
|
---|
95 | # We cannot give a output path to the awk program, it will always generate
|
---|
96 | # the header next to the source. So, we'll have to temporarily copy the
|
---|
97 | # source file to the destination direction for it to work out correctly.
|
---|
98 | #
|
---|
99 | VBOX_AWK := /usr/bin/awk
|
---|
100 | $$(PATH_VBoxGuest)/bus_if.h: $(VBOX_FREEBSD_SRC)/kern/bus_if.m
|
---|
101 | $(call MSG_TOOL,awk,VBoxGuest,$<,$@)
|
---|
102 | $(QUIET)$(CP) -f $(VBOX_FREEBSD_SRC)/kern/bus_if.m $(PATH_VBoxGuest)/bus_if.m
|
---|
103 | $(QUIET)$(VBOX_AWK) -f $(VBOX_FREEBSD_SRC)/tools/makeobjops.awk $(PATH_VBoxGuest)/bus_if.m -h -p
|
---|
104 | $(QUIET)$(RM) $(PATH_VBoxGuest)/bus_if.m
|
---|
105 |
|
---|
106 | $$(PATH_VBoxGuest)/device_if.h: $(VBOX_FREEBSD_SRC)/kern/device_if.m
|
---|
107 | $(call MSG_TOOL,awk,VBoxGuest,$<,$@)
|
---|
108 | $(QUIET)$(CP) -f $(VBOX_FREEBSD_SRC)/kern/device_if.m $(PATH_VBoxGuest)/device_if.m
|
---|
109 | $(QUIET)$(VBOX_AWK) -f $(VBOX_FREEBSD_SRC)/tools/makeobjops.awk $(PATH_VBoxGuest)/device_if.m -h -p
|
---|
110 | $(QUIET)$(RM) $(PATH_VBoxGuest)/device_if.m
|
---|
111 |
|
---|
112 | $$(PATH_VBoxGuest)/pci_if.h: $(VBOX_FREEBSD_SRC)/dev/pci/pci_if.m
|
---|
113 | $(call MSG_TOOL,awk,VBoxGuest,$<,$@)
|
---|
114 | $(QUIET)$(CP) -f $(VBOX_FREEBSD_SRC)/dev/pci/pci_if.m $(PATH_VBoxGuest)/pci_if.m
|
---|
115 | $(QUIET)$(VBOX_AWK) -f $(VBOX_FREEBSD_SRC)/tools/makeobjops.awk $(PATH_VBoxGuest)/pci_if.m -h -p
|
---|
116 | $(QUIET)$(RM) $(PATH_VBoxGuest)/pci_if.m
|
---|
117 | endif # FreeBSD
|
---|
118 |
|
---|
119 | endif # enabled
|
---|
120 |
|
---|
121 | include $(KBUILD_PATH)/subfooter.kmk
|
---|
122 |
|
---|