1 | # $Id: Makefile.kmk 96407 2022-08-22 17:43:14Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for the Skeleton Extension Pack Sample.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2010-2022 Oracle and/or its affiliates.
|
---|
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_VBoxR3ExtPackSkeleton = For the ring-3 context modules in the Skeleton extension pack.
|
---|
38 | TEMPLATE_VBoxR3ExtPackSkeleton_EXTENDS = VBoxR3ExtPack
|
---|
39 | TEMPLATE_VBoxR3ExtPackSkeleton_INST = $(INST_EXTPACK)Skeleton/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)/
|
---|
40 |
|
---|
41 | TEMPLATE_VBoxR0ExtPackSkeleton = For the ring-0 context modules in the Skeleton extension pack.
|
---|
42 | TEMPLATE_VBoxR0ExtPackSkeleton_EXTENDS = VBoxR0ExtPack
|
---|
43 | TEMPLATE_VBoxR0ExtPackSkeleton_INST = $(INST_EXTPACK)Skeleton/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)/
|
---|
44 |
|
---|
45 | TEMPLATE_VBoxRcExtPackSkeleton = For the raw-mode context modules in the Skeleton extension pack.
|
---|
46 | TEMPLATE_VBoxRcExtPackSkeleton_EXTENDS = VBoxRcExtPack
|
---|
47 | TEMPLATE_VBoxRcExtPackSkeleton_INST = $(INST_EXTPACK)Skeleton/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)/
|
---|
48 |
|
---|
49 | TEMPLATE_VBoxInsExtPackSkeleton = For the install targets of an extension pack.
|
---|
50 | TEMPLATE_VBoxInsExtPackSkeleton_EXTENDS = VBoxR0ExtPack
|
---|
51 | TEMPLATE_VBoxInsExtPackSkeleton_INST = $(INST_EXTPACK)Skeleton/
|
---|
52 |
|
---|
53 | #
|
---|
54 | # Globals.
|
---|
55 | #
|
---|
56 | VBOX_SKELETON_NAME = Skeleton
|
---|
57 | VBOX_SKELETON_MANGLED_NAME = Skeleton
|
---|
58 | VBOX_PATH_EXTPACK_SKELETON = $(PATH_STAGE)/$(INST_EXTPACK)Skeleton
|
---|
59 |
|
---|
60 |
|
---|
61 | #
|
---|
62 | # VBoxSkeletonMain - The module which the VirtualBox Main API talks to.
|
---|
63 | #
|
---|
64 | DLLS += VBoxSkeletonMain
|
---|
65 | VBoxSkeletonMain_TEMPLATE = VBoxR3ExtPackSkeleton
|
---|
66 | VBoxSkeletonMain_SOURCES = VBoxSkeletonMain.cpp
|
---|
67 | VBoxSkeletonMain_DEFS =
|
---|
68 |
|
---|
69 | #
|
---|
70 | # VBoxSkeletonMainVM - The module in a VM which the VirtualBox Main API talks to.
|
---|
71 | #
|
---|
72 | DLLS += VBoxSkeletonMainVM
|
---|
73 | VBoxSkeletonMainVM_TEMPLATE = VBoxR3ExtPackSkeleton
|
---|
74 | VBoxSkeletonMainVM_SOURCES = VBoxSkeletonMainVM.cpp
|
---|
75 | VBoxSkeletonMainVM_DEFS =
|
---|
76 |
|
---|
77 | #
|
---|
78 | # Install the description.
|
---|
79 | #
|
---|
80 | INSTALLS += VBoxSkeletonIns
|
---|
81 | VBoxSkeletonIns_TEMPLATE = VBoxInsExtPackSkeleton
|
---|
82 | VBoxSkeletonIns_SOURCES = \
|
---|
83 | $(VBoxSkeletonIns_0_OUTDIR)/ExtPack.xml
|
---|
84 | $(call VBOX_EDIT_VERSION_RULE_FN,VBoxSkeletonIns,ExtPack.xml)
|
---|
85 |
|
---|
86 |
|
---|
87 | #
|
---|
88 | # Packing.
|
---|
89 | #
|
---|
90 | ifndef VBOX_WITHOUT_EXTPACK_SKELETON_PACKING
|
---|
91 | PACKING += $(VBOX_PATH_PACKAGES)/$(VBOX_SKELETON_MANGLED_NAME)-$(VBOX_VERSION_STRING)r$(VBOX_SVN_REV).vbox-extpack
|
---|
92 | endif
|
---|
93 |
|
---|
94 | ifndef VBOX_WITH_EXTPACK_OS_ARCHS
|
---|
95 | ifeq ($(USER),bird) # for now
|
---|
96 | VBOX_WITH_EXTPACK_OS_ARCHS = $(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)
|
---|
97 | endif
|
---|
98 | endif
|
---|
99 |
|
---|
100 | # Build the file list. The macro takes 1=darwin.x86, 2=dist/VirtualBox.app/Contents/MacOS, 3=dylib
|
---|
101 | VBOX_SKELETON_FILES_MACRO = \
|
---|
102 | $(PATH_OUT_BASE)/$(1)/$(KBUILD_TYPE)/$(2)/ExtensionPacks/$(VBOX_SKELETON_MANGLED_NAME)/$(1)/VBoxSkeletonMain.$(3)=>$(1)/VBoxSkeletonMain.$(3) \
|
---|
103 | $(PATH_OUT_BASE)/$(1)/$(KBUILD_TYPE)/$(2)/ExtensionPacks/$(VBOX_SKELETON_MANGLED_NAME)/$(1)/VBoxSkeletonMainVM.$(3)=>$(1)/VBoxSkeletonMainVM.$(3)
|
---|
104 |
|
---|
105 | VBOX_SKELETON_FILES := \
|
---|
106 | $(VBOX_PATH_EXTPACK_SKELETON)/ExtPack.xml=>ExtPack.xml
|
---|
107 |
|
---|
108 | if1of (darwin.amd64, $(VBOX_WITH_EXTPACK_OS_ARCHS))
|
---|
109 | VBOX_SKELETON_FILES += $(call VBOX_SKELETON_FILES_MACRO,darwin.amd64,dist/VirtualBox.app/Contents/MacOS,dylib)
|
---|
110 | endif
|
---|
111 | if1of (darwin.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS))
|
---|
112 | VBOX_SKELETON_FILES += $(call VBOX_SKELETON_FILES_MACRO,darwin.x86,dist/VirtualBox.app/Contents/MacOS,dylib)
|
---|
113 | endif
|
---|
114 | if1of (freebsd.amd64, $(VBOX_WITH_EXTPACK_OS_ARCHS))
|
---|
115 | VBOX_SKELETON_FILES += $(call VBOX_SKELETON_FILES_MACRO,freebsd.amd64,bin,so)
|
---|
116 | endif
|
---|
117 | if1of (freebsd.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS))
|
---|
118 | VBOX_SKELETON_FILES += $(call VBOX_SKELETON_FILES_MACRO,freebsd.x86,bin,so)
|
---|
119 | endif
|
---|
120 | if1of (linux.amd64, $(VBOX_WITH_EXTPACK_OS_ARCHS))
|
---|
121 | VBOX_SKELETON_FILES += $(call VBOX_SKELETON_FILES_MACRO,linux.amd64,bin,so)
|
---|
122 | endif
|
---|
123 | if1of (linux.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS))
|
---|
124 | VBOX_SKELETON_FILES += $(call VBOX_SKELETON_FILES_MACRO,linux.x86,bin,so)
|
---|
125 | endif
|
---|
126 | if1of (os2.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS))
|
---|
127 | VBOX_SKELETON_FILES += $(call VBOX_SKELETON_FILES_MACRO,os2.x86,bin,so)
|
---|
128 | endif
|
---|
129 | if1of (solaris.amd64, $(VBOX_WITH_EXTPACK_OS_ARCHS))
|
---|
130 | VBOX_SKELETON_FILES += $(call VBOX_SKELETON_FILES_MACRO,solaris.amd64,bin,so)
|
---|
131 | endif
|
---|
132 | if1of (solaris.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS))
|
---|
133 | VBOX_SKELETON_FILES += $(call VBOX_SKELETON_FILES_MACRO,solaris.x86,bin,so)
|
---|
134 | endif
|
---|
135 | if1of (win.amd64, $(VBOX_WITH_EXTPACK_OS_ARCHS))
|
---|
136 | VBOX_SKELETON_FILES += $(call VBOX_SKELETON_FILES_MACRO,win.amd64,bin,dll)
|
---|
137 | endif
|
---|
138 | if1of (win.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS))
|
---|
139 | VBOX_SKELETON_FILES += $(call VBOX_SKELETON_FILES_MACRO,win.x86,bin,dll)
|
---|
140 | endif
|
---|
141 |
|
---|
142 | # Pack it all up using a temporary staging directory.
|
---|
143 | $(VBOX_PATH_PACKAGES)/$(VBOX_SKELETON_MANGLED_NAME)-$(VBOX_VERSION_STRING)r$(VBOX_SVN_REV).vbox-extpack: \
|
---|
144 | $$(foreach file, $$(VBOX_SKELETON_FILES), $$(firstword $$(subst =>,$$(SP),$$(file)))) \
|
---|
145 | | $(VBOX_PATH_PACKAGES)/
|
---|
146 | $(RM) -f $(wildcard $(VBOX_PATH_PACKAGES)/$(VBOX_SKELETON_MANGLED_NAME)-*.vbox-extpack) \
|
---|
147 | $(VBoxSkeletonIns_0_OUTDIR)/ExtPack.manifest \
|
---|
148 | $(VBoxSkeletonIns_0_OUTDIR)/ExtPack.signature
|
---|
149 | # Stage all the files
|
---|
150 | $(RM) -Rf $(VBoxSkeletonIns_0_OUTDIR)/Stage/
|
---|
151 | $(foreach file, $(VBOX_SKELETON_FILES),\
|
---|
152 | $(NLTAB)$(MKDIR) -p $(dir $(lastword $(subst =>,$(SP)$(VBoxSkeletonIns_0_OUTDIR)/Stage/,$(file)))) \
|
---|
153 | $(NLTAB)$(CP) $(subst =>,$(SP)$(VBoxSkeletonIns_0_OUTDIR)/Stage/,$(file)) )
|
---|
154 | # Create the manifest
|
---|
155 | $(VBOX_RTMANIFEST) \
|
---|
156 | --manifest $(VBoxSkeletonIns_0_OUTDIR)/Stage/ExtPack.manifest \
|
---|
157 | --chdir $(VBoxSkeletonIns_0_OUTDIR)/Stage/ \
|
---|
158 | $(foreach file, $(VBOX_SKELETON_FILES), $(lastword $(subst =>,$(SP),$(file))))
|
---|
159 | $(APPEND) $(VBoxSkeletonIns_0_OUTDIR)/Stage/ExtPack.signature "todo"
|
---|
160 | $(CHMOD) a+r \
|
---|
161 | $(VBoxSkeletonIns_0_OUTDIR)/Stage/ExtPack.manifest \
|
---|
162 | $(VBoxSkeletonIns_0_OUTDIR)/Stage/ExtPack.signature
|
---|
163 | # Tar it up.
|
---|
164 | tar -cvf - -C $(VBoxSkeletonIns_0_OUTDIR)/Stage/ . | gzip -9c > $@
|
---|
165 | # Clean up
|
---|
166 | $(RM) -Rf $(VBoxSkeletonIns_0_OUTDIR)/Stage/
|
---|
167 |
|
---|
168 | BLDDIRS += $(VBOX_PATH_PACKAGES)/
|
---|
169 |
|
---|
170 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
171 |
|
---|