1 | # $Id: Makefile.kmk 76553 2019-01-01 01:45:53Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for the Bus Mouse Extension Pack Sample.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2010-2019 Oracle Corporation
|
---|
8 | #
|
---|
9 | # Permission is hereby granted, free of charge, to any person
|
---|
10 | # obtaining a copy of this software and associated documentation
|
---|
11 | # files (the "Software"), to deal in the Software without
|
---|
12 | # restriction, including without limitation the rights to use,
|
---|
13 | # copy, modify, merge, publish, distribute, sublicense, and/or sell
|
---|
14 | # copies of the Software, and to permit persons to whom the
|
---|
15 | # Software is furnished to do so, subject to the following
|
---|
16 | # conditions:
|
---|
17 | #
|
---|
18 | # The above copyright notice and this permission notice shall be
|
---|
19 | # included in all copies or substantial portions of the Software.
|
---|
20 | #
|
---|
21 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
---|
22 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
---|
23 | # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
---|
24 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
---|
25 | # HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
---|
26 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
---|
27 | # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
---|
28 | # OTHER DEALINGS IN THE SOFTWARE.
|
---|
29 | #
|
---|
30 |
|
---|
31 | SUB_DEPTH = ../../../..
|
---|
32 | include $(KBUILD_PATH)/subheader.kmk
|
---|
33 |
|
---|
34 | #
|
---|
35 | # Extend the extension pack templates.
|
---|
36 | #
|
---|
37 | TEMPLATE_VBoxR3ExtPackBusMouse = For the ring-3 context modules in the Bus Mouse extension pack.
|
---|
38 | TEMPLATE_VBoxR3ExtPackBusMouse_EXTENDS = VBoxR3ExtPack
|
---|
39 | TEMPLATE_VBoxR3ExtPackBusMouse_INST = $(INST_EXTPACK)BusMouse/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)/
|
---|
40 |
|
---|
41 | TEMPLATE_VBoxR0ExtPackBusMouse = For the ring-0 context modules in the Bus Mouse extension pack.
|
---|
42 | TEMPLATE_VBoxR0ExtPackBusMouse_EXTENDS = VBoxR0ExtPack
|
---|
43 | TEMPLATE_VBoxR0ExtPackBusMouse_INST = $(INST_EXTPACK)BusMouse/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)/
|
---|
44 |
|
---|
45 | TEMPLATE_VBoxRcExtPackBusMouse = For the raw-mode context modules in the Bus Mouse extension pack.
|
---|
46 | TEMPLATE_VBoxRcExtPackBusMouse_EXTENDS = VBoxRcExtPack
|
---|
47 | TEMPLATE_VBoxRcExtPackBusMouse_INST = $(INST_EXTPACK)BusMouse/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)/
|
---|
48 |
|
---|
49 | TEMPLATE_VBoxInsExtPackBusMouse = For the install targets of an extension pack.
|
---|
50 | TEMPLATE_VBoxInsExtPackBusMouse_EXTENDS = VBoxR0ExtPack
|
---|
51 | TEMPLATE_VBoxInsExtPackBusMouse_INST = $(INST_EXTPACK)BusMouse/
|
---|
52 |
|
---|
53 | #
|
---|
54 | # Globals.
|
---|
55 | #
|
---|
56 | VBOX_BUSMOUSE_NAME = BusMouse
|
---|
57 | VBOX_BUSMOUSE_MANGLED_NAME = BusMouse
|
---|
58 | VBOX_PATH_EXTPACK_BUSMOUSE = $(PATH_STAGE)/$(INST_EXTPACK)BusMouse
|
---|
59 |
|
---|
60 |
|
---|
61 | #
|
---|
62 | # VBoxBusMouseMain - The module which the VirtualBox Main API talks to.
|
---|
63 | #
|
---|
64 | DLLS += VBoxBusMouseMain
|
---|
65 | VBoxBusMouseMain_TEMPLATE = VBoxR3ExtPackBusMouse
|
---|
66 | VBoxBusMouseMain_SOURCES = VBoxBusMouseMain.cpp
|
---|
67 | VBoxBusMouseMain_DEFS =
|
---|
68 |
|
---|
69 |
|
---|
70 | #
|
---|
71 | # VBoxBusMouseMainVM - The module in a VM which the VirtualBox Main API talks to.
|
---|
72 | #
|
---|
73 | DLLS += VBoxBusMouseMainVM
|
---|
74 | VBoxBusMouseMainVM_TEMPLATE = VBoxR3ExtPackBusMouse
|
---|
75 | VBoxBusMouseMainVM_SOURCES = VBoxBusMouseMainVM.cpp
|
---|
76 | VBoxBusMouseMainVM_DEFS =
|
---|
77 |
|
---|
78 |
|
---|
79 | #
|
---|
80 | # The device code.
|
---|
81 | #
|
---|
82 | DLLS += VBoxBusMouseR3
|
---|
83 | VBoxBusMouseR3_TEMPLATE = VBoxR3ExtPackBusMouse
|
---|
84 | VBoxBusMouseR3_SOURCES = BusMouse.cpp
|
---|
85 |
|
---|
86 | SYSMODS += VBoxBusMouseR0
|
---|
87 | VBoxBusMouseR0_TEMPLATE = VBoxR0ExtPackBusMouse
|
---|
88 | VBoxBusMouseR0_SOURCES = BusMouse.cpp
|
---|
89 |
|
---|
90 | ifdef VBOX_WITH_RAW_MODE
|
---|
91 | SYSMODS += VBoxBusMouseRC
|
---|
92 | VBoxBusMouseRC_TEMPLATE = VBoxRcExtPackBusMouse
|
---|
93 | VBoxBusMouseRC_SOURCES = BusMouse.cpp
|
---|
94 | endif
|
---|
95 |
|
---|
96 |
|
---|
97 | #
|
---|
98 | # Install the description.
|
---|
99 | #
|
---|
100 | INSTALLS += VBoxBusMouseIns
|
---|
101 | VBoxBusMouseIns_TEMPLATE = VBoxInsExtPackBusMouse
|
---|
102 | VBoxBusMouseIns_SOURCES = \
|
---|
103 | $(VBoxBusMouseIns_0_OUTDIR)/ExtPack.xml
|
---|
104 | $(call VBOX_EDIT_VERSION_RULE_FN,VBoxBusMouseIns,ExtPack.xml)
|
---|
105 |
|
---|
106 |
|
---|
107 | #
|
---|
108 | # Packing.
|
---|
109 | #
|
---|
110 | ifndef VBOX_WITHOUT_EXTPACK_BUSMOUSE_PACKING
|
---|
111 | PACKING += $(VBOX_PATH_PACKAGES)/$(VBOX_BUSMOUSE_MANGLED_NAME)-$(VBOX_VERSION_STRING)r$(VBOX_SVN_REV).vbox-extpack
|
---|
112 | endif
|
---|
113 |
|
---|
114 | ifndef VBOX_WITH_EXTPACK_OS_ARCHS
|
---|
115 | ifeq ($(USER),bird) # for now
|
---|
116 | VBOX_WITH_EXTPACK_OS_ARCHS = $(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)
|
---|
117 | endif
|
---|
118 | endif
|
---|
119 |
|
---|
120 | # Build the file list. The macro takes 1=darwin.x86, 2=dist/VirtualBox.app/Contents/MacOS, 3=dylib
|
---|
121 | VBOX_BUSMOUSE_FILES_MACRO = \
|
---|
122 | $(PATH_OUT_BASE)/$(1)/$(KBUILD_TYPE)/$(2)/ExtensionPacks/$(VBOX_BUSMOUSE_MANGLED_NAME)/$(1)/VBoxBusMouseMain.$(3)=>$(1)/VBoxBusMouseMain.$(3) \
|
---|
123 | $(PATH_OUT_BASE)/$(1)/$(KBUILD_TYPE)/$(2)/ExtensionPacks/$(VBOX_BUSMOUSE_MANGLED_NAME)/$(1)/VBoxBusMouseMainVM.$(3)=>$(1)/VBoxBusMouseMainVM.$(3) \
|
---|
124 | $(PATH_OUT_BASE)/$(1)/$(KBUILD_TYPE)/$(2)/ExtensionPacks/$(VBOX_BUSMOUSE_MANGLED_NAME)/$(1)/VBoxBusMouseR3.$(3)=>$(1)/VBoxBusMouseR3.$(3) \
|
---|
125 | $(PATH_OUT_BASE)/$(1)/$(KBUILD_TYPE)/$(2)/ExtensionPacks/$(VBOX_BUSMOUSE_MANGLED_NAME)/$(1)/VBoxBusMouseR0.r0=>$(1)/VBoxBusMouseR0.r0
|
---|
126 | ifdef VBOX_WITH_RAW_MODE
|
---|
127 | VBOX_BUSMOUSE_FILES_MACRO += \
|
---|
128 | $(PATH_OUT_BASE)/$(1)/$(KBUILD_TYPE)/$(2)/ExtensionPacks/$(VBOX_BUSMOUSE_MANGLED_NAME)/$(1)/VBoxBusMouseRC.rc=>$(1)/VBoxBusMouseRC.rc
|
---|
129 | endif
|
---|
130 |
|
---|
131 | VBOX_BUSMOUSE_FILES := \
|
---|
132 | $(VBOX_PATH_EXTPACK_BUSMOUSE)/ExtPack.xml=>ExtPack.xml
|
---|
133 |
|
---|
134 | if1of (darwin.amd64, $(VBOX_WITH_EXTPACK_OS_ARCHS))
|
---|
135 | VBOX_BUSMOUSE_FILES += $(call VBOX_BUSMOUSE_FILES_MACRO,darwin.amd64,dist/VirtualBox.app/Contents/MacOS,dylib)
|
---|
136 | endif
|
---|
137 | if1of (darwin.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS))
|
---|
138 | VBOX_BUSMOUSE_FILES += $(call VBOX_BUSMOUSE_FILES_MACRO,darwin.x86,dist/VirtualBox.app/Contents/MacOS,dylib)
|
---|
139 | endif
|
---|
140 | if1of (freebsd.amd64, $(VBOX_WITH_EXTPACK_OS_ARCHS))
|
---|
141 | VBOX_BUSMOUSE_FILES += $(call VBOX_BUSMOUSE_FILES_MACRO,freebsd.amd64,bin,so)
|
---|
142 | endif
|
---|
143 | if1of (freebsd.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS))
|
---|
144 | VBOX_BUSMOUSE_FILES += $(call VBOX_BUSMOUSE_FILES_MACRO,freebsd.x86,bin,so)
|
---|
145 | endif
|
---|
146 | if1of (linux.amd64, $(VBOX_WITH_EXTPACK_OS_ARCHS))
|
---|
147 | VBOX_BUSMOUSE_FILES += $(call VBOX_BUSMOUSE_FILES_MACRO,linux.amd64,bin,so)
|
---|
148 | endif
|
---|
149 | if1of (linux.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS))
|
---|
150 | VBOX_BUSMOUSE_FILES += $(call VBOX_BUSMOUSE_FILES_MACRO,linux.x86,bin,so)
|
---|
151 | endif
|
---|
152 | if1of (os2.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS))
|
---|
153 | VBOX_BUSMOUSE_FILES += $(call VBOX_BUSMOUSE_FILES_MACRO,os2.x86,bin,so)
|
---|
154 | endif
|
---|
155 | if1of (solaris.amd64, $(VBOX_WITH_EXTPACK_OS_ARCHS))
|
---|
156 | VBOX_BUSMOUSE_FILES += $(call VBOX_BUSMOUSE_FILES_MACRO,solaris.amd64,bin,so)
|
---|
157 | endif
|
---|
158 | if1of (solaris.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS))
|
---|
159 | VBOX_BUSMOUSE_FILES += $(call VBOX_BUSMOUSE_FILES_MACRO,solaris.x86,bin,so)
|
---|
160 | endif
|
---|
161 | if1of (win.amd64, $(VBOX_WITH_EXTPACK_OS_ARCHS))
|
---|
162 | VBOX_BUSMOUSE_FILES += $(call VBOX_BUSMOUSE_FILES_MACRO,win.amd64,bin,dll)
|
---|
163 | endif
|
---|
164 | if1of (win.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS))
|
---|
165 | VBOX_BUSMOUSE_FILES += $(call VBOX_BUSMOUSE_FILES_MACRO,win.x86,bin,dll)
|
---|
166 | endif
|
---|
167 |
|
---|
168 | # Pack it all up using a temporary staging directory.
|
---|
169 | $(VBOX_PATH_PACKAGES)/$(VBOX_BUSMOUSE_MANGLED_NAME)-$(VBOX_VERSION_STRING)r$(VBOX_SVN_REV).vbox-extpack: \
|
---|
170 | $$(foreach file, $$(VBOX_BUSMOUSE_FILES), $$(firstword $$(subst =>,$$(SP),$$(file)))) \
|
---|
171 | | $(VBOX_PATH_PACKAGES)/
|
---|
172 | $(RM) -f $(wildcard $(VBOX_PATH_PACKAGES)/$(VBOX_BUSMOUSE_MANGLED_NAME)-*.vbox-extpack) \
|
---|
173 | $(VBoxBusMouseIns_0_OUTDIR)/ExtPack.manifest \
|
---|
174 | $(VBoxBusMouseIns_0_OUTDIR)/ExtPack.signature
|
---|
175 | # Stage all the files
|
---|
176 | $(RM) -Rf $(VBoxBusMouseIns_0_OUTDIR)/Stage/
|
---|
177 | $(foreach file, $(VBOX_BUSMOUSE_FILES),\
|
---|
178 | $(NLTAB)$(MKDIR) -p $(dir $(lastword $(subst =>,$(SP)$(VBoxBusMouseIns_0_OUTDIR)/Stage/,$(file)))) \
|
---|
179 | $(NLTAB)$(CP) $(subst =>,$(SP)$(VBoxBusMouseIns_0_OUTDIR)/Stage/,$(file)) )
|
---|
180 | # Create the manifest
|
---|
181 | $(VBOX_RTMANIFEST) \
|
---|
182 | --manifest $(VBoxBusMouseIns_0_OUTDIR)/Stage/ExtPack.manifest \
|
---|
183 | --chdir $(VBoxBusMouseIns_0_OUTDIR)/Stage/ \
|
---|
184 | $(foreach file, $(VBOX_BUSMOUSE_FILES), $(lastword $(subst =>,$(SP),$(file))))
|
---|
185 | $(APPEND) $(VBoxBusMouseIns_0_OUTDIR)/Stage/ExtPack.signature "todo"
|
---|
186 | $(CHMOD) a+r \
|
---|
187 | $(VBoxBusMouseIns_0_OUTDIR)/Stage/ExtPack.manifest \
|
---|
188 | $(VBoxBusMouseIns_0_OUTDIR)/Stage/ExtPack.signature
|
---|
189 | # Tar it up.
|
---|
190 | tar -cvf - -C $(VBoxBusMouseIns_0_OUTDIR)/Stage/ . | gzip -9c > $@
|
---|
191 | # Clean up
|
---|
192 | $(RM) -Rf $(VBoxBusMouseIns_0_OUTDIR)/Stage/
|
---|
193 |
|
---|
194 | BLDDIRS += $(VBOX_PATH_PACKAGES)/
|
---|
195 |
|
---|
196 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
197 |
|
---|