VirtualBox

source: vbox/trunk/src/VBox/ExtPacks/BusMouseSample/Makefile.kmk

Last change on this file was 98103, checked in by vboxsync, 15 months ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.8 KB
RevLine 
[35963]1# $Id: Makefile.kmk 98103 2023-01-17 14:15:46Z vboxsync $
2## @file
[44446]3# Sub-Makefile for the Bus Mouse Extension Pack Sample.
[35963]4#
5
6#
[98103]7# Copyright (C) 2010-2023 Oracle and/or its affiliates.
[35963]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
[69275]24# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
[35963]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
31SUB_DEPTH = ../../../..
[41477]32include $(KBUILD_PATH)/subheader.kmk
[35963]33
34#
35# Extend the extension pack templates.
36#
[44446]37TEMPLATE_VBoxR3ExtPackBusMouse = For the ring-3 context modules in the Bus Mouse extension pack.
38TEMPLATE_VBoxR3ExtPackBusMouse_EXTENDS = VBoxR3ExtPack
39TEMPLATE_VBoxR3ExtPackBusMouse_INST = $(INST_EXTPACK)BusMouse/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)/
[35963]40
[44446]41TEMPLATE_VBoxR0ExtPackBusMouse = For the ring-0 context modules in the Bus Mouse extension pack.
42TEMPLATE_VBoxR0ExtPackBusMouse_EXTENDS = VBoxR0ExtPack
43TEMPLATE_VBoxR0ExtPackBusMouse_INST = $(INST_EXTPACK)BusMouse/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)/
[35963]44
[44446]45TEMPLATE_VBoxRcExtPackBusMouse = For the raw-mode context modules in the Bus Mouse extension pack.
46TEMPLATE_VBoxRcExtPackBusMouse_EXTENDS = VBoxRcExtPack
47TEMPLATE_VBoxRcExtPackBusMouse_INST = $(INST_EXTPACK)BusMouse/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)/
[35963]48
[44446]49TEMPLATE_VBoxInsExtPackBusMouse = For the install targets of an extension pack.
50TEMPLATE_VBoxInsExtPackBusMouse_EXTENDS = VBoxR0ExtPack
51TEMPLATE_VBoxInsExtPackBusMouse_INST = $(INST_EXTPACK)BusMouse/
[35963]52
53#
54# Globals.
55#
[44446]56VBOX_BUSMOUSE_NAME = BusMouse
57VBOX_BUSMOUSE_MANGLED_NAME = BusMouse
58VBOX_PATH_EXTPACK_BUSMOUSE = $(PATH_STAGE)/$(INST_EXTPACK)BusMouse
[35963]59
60
61#
[44446]62# VBoxBusMouseMain - The module which the VirtualBox Main API talks to.
[35963]63#
[44446]64DLLS += VBoxBusMouseMain
65VBoxBusMouseMain_TEMPLATE = VBoxR3ExtPackBusMouse
66VBoxBusMouseMain_SOURCES = VBoxBusMouseMain.cpp
67VBoxBusMouseMain_DEFS =
[35963]68
[44446]69
[35963]70#
[68828]71# VBoxBusMouseMainVM - The module in a VM which the VirtualBox Main API talks to.
72#
73DLLS += VBoxBusMouseMainVM
74VBoxBusMouseMainVM_TEMPLATE = VBoxR3ExtPackBusMouse
75VBoxBusMouseMainVM_SOURCES = VBoxBusMouseMainVM.cpp
76VBoxBusMouseMainVM_DEFS =
77
78
79#
[44446]80# The device code.
81#
82DLLS += VBoxBusMouseR3
83VBoxBusMouseR3_TEMPLATE = VBoxR3ExtPackBusMouse
[82155]84VBoxBusMouseR3_SOURCES = DevBusMouse.cpp
[44446]85
[93419]86ifdef VBOX_WITH_R0_MODULES
87 ifdef VBOX_WITH_VBOXR0_AS_DLL
88 DLLS += VBoxBusMouseR0
89 else
90 SYSMODS += VBoxBusMouseR0
91 endif
92 VBoxBusMouseR0_TEMPLATE = VBoxR0ExtPackBusMouse
93 VBoxBusMouseR0_SOURCES = DevBusMouse.cpp
94endif
[44446]95
96ifdef VBOX_WITH_RAW_MODE
97 SYSMODS += VBoxBusMouseRC
98 VBoxBusMouseRC_TEMPLATE = VBoxRcExtPackBusMouse
[82155]99 VBoxBusMouseRC_SOURCES = DevBusMouse.cpp
[44446]100endif
101
102
103#
[35963]104# Install the description.
105#
[44446]106INSTALLS += VBoxBusMouseIns
107VBoxBusMouseIns_TEMPLATE = VBoxInsExtPackBusMouse
108VBoxBusMouseIns_SOURCES = \
109 $(VBoxBusMouseIns_0_OUTDIR)/ExtPack.xml
110$(call VBOX_EDIT_VERSION_RULE_FN,VBoxBusMouseIns,ExtPack.xml)
[35963]111
112
113#
[40382]114# Packing.
[35963]115#
[44446]116ifndef VBOX_WITHOUT_EXTPACK_BUSMOUSE_PACKING
117 PACKING += $(VBOX_PATH_PACKAGES)/$(VBOX_BUSMOUSE_MANGLED_NAME)-$(VBOX_VERSION_STRING)r$(VBOX_SVN_REV).vbox-extpack
[35963]118endif
119
120ifndef VBOX_WITH_EXTPACK_OS_ARCHS
121 ifeq ($(USER),bird) # for now
122 VBOX_WITH_EXTPACK_OS_ARCHS = $(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)
123 endif
124endif
125
126# Build the file list. The macro takes 1=darwin.x86, 2=dist/VirtualBox.app/Contents/MacOS, 3=dylib
[44446]127VBOX_BUSMOUSE_FILES_MACRO = \
128 $(PATH_OUT_BASE)/$(1)/$(KBUILD_TYPE)/$(2)/ExtensionPacks/$(VBOX_BUSMOUSE_MANGLED_NAME)/$(1)/VBoxBusMouseMain.$(3)=>$(1)/VBoxBusMouseMain.$(3) \
[68828]129 $(PATH_OUT_BASE)/$(1)/$(KBUILD_TYPE)/$(2)/ExtensionPacks/$(VBOX_BUSMOUSE_MANGLED_NAME)/$(1)/VBoxBusMouseMainVM.$(3)=>$(1)/VBoxBusMouseMainVM.$(3) \
[44446]130 $(PATH_OUT_BASE)/$(1)/$(KBUILD_TYPE)/$(2)/ExtensionPacks/$(VBOX_BUSMOUSE_MANGLED_NAME)/$(1)/VBoxBusMouseR3.$(3)=>$(1)/VBoxBusMouseR3.$(3) \
131 $(PATH_OUT_BASE)/$(1)/$(KBUILD_TYPE)/$(2)/ExtensionPacks/$(VBOX_BUSMOUSE_MANGLED_NAME)/$(1)/VBoxBusMouseR0.r0=>$(1)/VBoxBusMouseR0.r0
132ifdef VBOX_WITH_RAW_MODE
133 VBOX_BUSMOUSE_FILES_MACRO += \
134 $(PATH_OUT_BASE)/$(1)/$(KBUILD_TYPE)/$(2)/ExtensionPacks/$(VBOX_BUSMOUSE_MANGLED_NAME)/$(1)/VBoxBusMouseRC.rc=>$(1)/VBoxBusMouseRC.rc
135endif
[35963]136
[44446]137VBOX_BUSMOUSE_FILES := \
138 $(VBOX_PATH_EXTPACK_BUSMOUSE)/ExtPack.xml=>ExtPack.xml
[35963]139
140if1of (darwin.amd64, $(VBOX_WITH_EXTPACK_OS_ARCHS))
[44446]141 VBOX_BUSMOUSE_FILES += $(call VBOX_BUSMOUSE_FILES_MACRO,darwin.amd64,dist/VirtualBox.app/Contents/MacOS,dylib)
[35963]142endif
143if1of (darwin.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS))
[44446]144 VBOX_BUSMOUSE_FILES += $(call VBOX_BUSMOUSE_FILES_MACRO,darwin.x86,dist/VirtualBox.app/Contents/MacOS,dylib)
[35963]145endif
146if1of (freebsd.amd64, $(VBOX_WITH_EXTPACK_OS_ARCHS))
[44446]147 VBOX_BUSMOUSE_FILES += $(call VBOX_BUSMOUSE_FILES_MACRO,freebsd.amd64,bin,so)
[35963]148endif
149if1of (freebsd.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS))
[44446]150 VBOX_BUSMOUSE_FILES += $(call VBOX_BUSMOUSE_FILES_MACRO,freebsd.x86,bin,so)
[35963]151endif
152if1of (linux.amd64, $(VBOX_WITH_EXTPACK_OS_ARCHS))
[44446]153 VBOX_BUSMOUSE_FILES += $(call VBOX_BUSMOUSE_FILES_MACRO,linux.amd64,bin,so)
[35963]154endif
155if1of (linux.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS))
[44446]156 VBOX_BUSMOUSE_FILES += $(call VBOX_BUSMOUSE_FILES_MACRO,linux.x86,bin,so)
[35963]157endif
158if1of (os2.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS))
[44446]159 VBOX_BUSMOUSE_FILES += $(call VBOX_BUSMOUSE_FILES_MACRO,os2.x86,bin,so)
[35963]160endif
161if1of (solaris.amd64, $(VBOX_WITH_EXTPACK_OS_ARCHS))
[44446]162 VBOX_BUSMOUSE_FILES += $(call VBOX_BUSMOUSE_FILES_MACRO,solaris.amd64,bin,so)
[35963]163endif
164if1of (solaris.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS))
[44446]165 VBOX_BUSMOUSE_FILES += $(call VBOX_BUSMOUSE_FILES_MACRO,solaris.x86,bin,so)
[35963]166endif
167if1of (win.amd64, $(VBOX_WITH_EXTPACK_OS_ARCHS))
[44446]168 VBOX_BUSMOUSE_FILES += $(call VBOX_BUSMOUSE_FILES_MACRO,win.amd64,bin,dll)
[35963]169endif
170if1of (win.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS))
[44446]171 VBOX_BUSMOUSE_FILES += $(call VBOX_BUSMOUSE_FILES_MACRO,win.x86,bin,dll)
[35963]172endif
173
174# Pack it all up using a temporary staging directory.
[44446]175$(VBOX_PATH_PACKAGES)/$(VBOX_BUSMOUSE_MANGLED_NAME)-$(VBOX_VERSION_STRING)r$(VBOX_SVN_REV).vbox-extpack: \
176 $$(foreach file, $$(VBOX_BUSMOUSE_FILES), $$(firstword $$(subst =>,$$(SP),$$(file)))) \
[35963]177 | $(VBOX_PATH_PACKAGES)/
[44446]178 $(RM) -f $(wildcard $(VBOX_PATH_PACKAGES)/$(VBOX_BUSMOUSE_MANGLED_NAME)-*.vbox-extpack) \
179 $(VBoxBusMouseIns_0_OUTDIR)/ExtPack.manifest \
180 $(VBoxBusMouseIns_0_OUTDIR)/ExtPack.signature
[35963]181# Stage all the files
[44446]182 $(RM) -Rf $(VBoxBusMouseIns_0_OUTDIR)/Stage/
183 $(foreach file, $(VBOX_BUSMOUSE_FILES),\
184 $(NLTAB)$(MKDIR) -p $(dir $(lastword $(subst =>,$(SP)$(VBoxBusMouseIns_0_OUTDIR)/Stage/,$(file)))) \
185 $(NLTAB)$(CP) $(subst =>,$(SP)$(VBoxBusMouseIns_0_OUTDIR)/Stage/,$(file)) )
[35963]186# Create the manifest
187 $(VBOX_RTMANIFEST) \
[44446]188 --manifest $(VBoxBusMouseIns_0_OUTDIR)/Stage/ExtPack.manifest \
189 --chdir $(VBoxBusMouseIns_0_OUTDIR)/Stage/ \
190 $(foreach file, $(VBOX_BUSMOUSE_FILES), $(lastword $(subst =>,$(SP),$(file))))
191 $(APPEND) $(VBoxBusMouseIns_0_OUTDIR)/Stage/ExtPack.signature "todo"
[35963]192 $(CHMOD) a+r \
[44446]193 $(VBoxBusMouseIns_0_OUTDIR)/Stage/ExtPack.manifest \
194 $(VBoxBusMouseIns_0_OUTDIR)/Stage/ExtPack.signature
[35963]195# Tar it up.
[44446]196 tar -cvf - -C $(VBoxBusMouseIns_0_OUTDIR)/Stage/ . | gzip -9c > $@
[35963]197# Clean up
[44446]198 $(RM) -Rf $(VBoxBusMouseIns_0_OUTDIR)/Stage/
[35963]199
[40382]200BLDDIRS += $(VBOX_PATH_PACKAGES)/
[35963]201
[41477]202include $(FILE_KBUILD_SUB_FOOTER)
[35963]203
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use