Makefile.kmk revision dd4229306cc4ad8b39518abc8d1ca5a6d1e1ca4f
0N/A# $Id$
1879N/A## @file
0N/A# Sub-Makefile for the Skeleton Extension Pack Sample.
0N/A#
0N/A
0N/A#
0N/A# Copyright (C) 2010-2012 Oracle Corporation
0N/A#
0N/A# Permission is hereby granted, free of charge, to any person
0N/A# obtaining a copy of this software and associated documentation
0N/A# files (the "Software"), to deal in the Software without
0N/A# restriction, including without limitation the rights to use,
0N/A# copy, modify, merge, publish, distribute, sublicense, and/or sell
0N/A# copies of the Software, and to permit persons to whom the
0N/A# Software is furnished to do so, subject to the following
0N/A# conditions:
0N/A#
0N/A# The above copyright notice and this permission notice shall be
1472N/A# included in all copies or substantial portions of the Software.
1472N/A#
1472N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
0N/A# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
0N/A# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
0N/A# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
1879N/A# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
1879N/A# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1879N/A# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
0N/A# OTHER DEALINGS IN THE SOFTWARE.
0N/A#
0N/A
0N/ASUB_DEPTH = ../../../..
0N/Ainclude $(KBUILD_PATH)/subheader.kmk
0N/A
0N/A#
0N/A# Extend the extension pack templates.
0N/A#
0N/ATEMPLATE_VBoxR3ExtPackSkeleton = For the ring-3 context modules in the Skeleton extension pack.
0N/ATEMPLATE_VBoxR3ExtPackSkeleton_EXTENDS = VBoxR3ExtPack
0N/ATEMPLATE_VBoxR3ExtPackSkeleton_INST = $(INST_EXTPACK)Skeleton/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)/
0N/A
0N/ATEMPLATE_VBoxR0ExtPackSkeleton = For the ring-0 context modules in the Skeleton extension pack.
0N/ATEMPLATE_VBoxR0ExtPackSkeleton_EXTENDS = VBoxR0ExtPack
0N/ATEMPLATE_VBoxR0ExtPackSkeleton_INST = $(INST_EXTPACK)Skeleton/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)/
0N/A
0N/ATEMPLATE_VBoxRcExtPackSkeleton = For the raw-mode context modules in the Skeleton extension pack.
0N/ATEMPLATE_VBoxRcExtPackSkeleton_EXTENDS = VBoxRcExtPack
0N/ATEMPLATE_VBoxRcExtPackSkeleton_INST = $(INST_EXTPACK)Skeleton/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)/
0N/A
0N/ATEMPLATE_VBoxInsExtPackSkeleton = For the install targets of an extension pack.
0N/ATEMPLATE_VBoxInsExtPackSkeleton_EXTENDS = VBoxR0ExtPack
0N/ATEMPLATE_VBoxInsExtPackSkeleton_INST = $(INST_EXTPACK)Skeleton/
0N/A
0N/A#
0N/A# Globals.
0N/A#
0N/AVBOX_SKELETON_NAME = Skeleton
0N/AVBOX_SKELETON_MANGLED_NAME = Skeleton
0N/AVBOX_PATH_EXTPACK_SKELETON = $(PATH_STAGE)/$(INST_EXTPACK)Skeleton
0N/A
0N/A
0N/A#
0N/A# VBoxSkeletonMain - The module which the VirtualBox Main API talks to.
0N/A#
0N/ADLLS += VBoxSkeletonMain
0N/AVBoxSkeletonMain_TEMPLATE = VBoxR3ExtPackSkeleton
0N/AVBoxSkeletonMain_SOURCES = VBoxSkeletonMain.cpp
0N/AVBoxSkeletonMain_DEFS =
0N/A
0N/A#
0N/A# Install the description.
0N/A#
0N/AINSTALLS += VBoxSkeletonIns
0N/AVBoxSkeletonIns_TEMPLATE = VBoxInsExtPackSkeleton
0N/AVBoxSkeletonIns_SOURCES = \
0N/A $(VBoxSkeletonIns_0_OUTDIR)/ExtPack.xml
0N/A$(call VBOX_EDIT_VERSION_RULE_FN,VBoxSkeletonIns,ExtPack.xml)
0N/A
0N/A
0N/A#
0N/A# Packing.
0N/A#
0N/Aifndef VBOX_WITHOUT_EXTPACK_SKELETON_PACKING
0N/A PACKING += $(VBOX_PATH_PACKAGES)/$(VBOX_SKELETON_MANGLED_NAME)-$(VBOX_VERSION_STRING)r$(VBOX_SVN_REV).vbox-extpack
0N/Aendif
0N/A
0N/Aifndef VBOX_WITH_EXTPACK_OS_ARCHS
0N/A ifeq ($(USER),bird) # for now
0N/A VBOX_WITH_EXTPACK_OS_ARCHS = $(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)
0N/A endif
0N/Aendif
0N/A
0N/A# Build the file list. The macro takes 1=darwin.x86, 2=dist/VirtualBox.app/Contents/MacOS, 3=dylib
0N/AVBOX_SKELETON_FILES_MACRO = \
0N/A $(PATH_OUT_BASE)/$(1)/$(KBUILD_TYPE)/$(2)/ExtensionPacks/$(VBOX_SKELETON_MANGLED_NAME)/$(1)/VBoxSkeletonMain.$(3)=>$(1)/VBoxSkeletonMain.$(3)
0N/A
0N/AVBOX_SKELETON_FILES := \
0N/A $(VBOX_PATH_EXTPACK_SKELETON)/ExtPack.xml=>ExtPack.xml
0N/A
0N/Aif1of (darwin.amd64, $(VBOX_WITH_EXTPACK_OS_ARCHS))
0N/A VBOX_SKELETON_FILES += $(call VBOX_SKELETON_FILES_MACRO,darwin.amd64,dist/VirtualBox.app/Contents/MacOS,dylib)
0N/Aendif
0N/Aif1of (darwin.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS))
0N/A VBOX_SKELETON_FILES += $(call VBOX_SKELETON_FILES_MACRO,darwin.x86,dist/VirtualBox.app/Contents/MacOS,dylib)
0N/Aendif
0N/Aif1of (freebsd.amd64, $(VBOX_WITH_EXTPACK_OS_ARCHS))
0N/A VBOX_SKELETON_FILES += $(call VBOX_SKELETON_FILES_MACRO,freebsd.amd64,bin,so)
0N/Aendif
0N/Aif1of (freebsd.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS))
0N/A VBOX_SKELETON_FILES += $(call VBOX_SKELETON_FILES_MACRO,freebsd.x86,bin,so)
0N/Aendif
0N/Aif1of (linux.amd64, $(VBOX_WITH_EXTPACK_OS_ARCHS))
0N/A VBOX_SKELETON_FILES += $(call VBOX_SKELETON_FILES_MACRO,linux.amd64,bin,so)
0N/Aendif
0N/Aif1of (linux.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS))
0N/A VBOX_SKELETON_FILES += $(call VBOX_SKELETON_FILES_MACRO,linux.x86,bin,so)
0N/Aendif
0N/Aif1of (os2.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS))
0N/A VBOX_SKELETON_FILES += $(call VBOX_SKELETON_FILES_MACRO,os2.x86,bin,so)
0N/Aendif
0N/Aif1of (solaris.amd64, $(VBOX_WITH_EXTPACK_OS_ARCHS))
0N/A VBOX_SKELETON_FILES += $(call VBOX_SKELETON_FILES_MACRO,solaris.amd64,bin,so)
0N/Aendif
0N/Aif1of (solaris.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS))
0N/A VBOX_SKELETON_FILES += $(call VBOX_SKELETON_FILES_MACRO,solaris.x86,bin,so)
0N/Aendif
0N/Aif1of (win.amd64, $(VBOX_WITH_EXTPACK_OS_ARCHS))
0N/A VBOX_SKELETON_FILES += $(call VBOX_SKELETON_FILES_MACRO,win.amd64,bin,dll)
0N/Aendif
0N/Aif1of (win.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS))
0N/A VBOX_SKELETON_FILES += $(call VBOX_SKELETON_FILES_MACRO,win.x86,bin,dll)
0N/Aendif
0N/A
0N/A# Pack it all up using a temporary staging directory.
0N/A$(VBOX_PATH_PACKAGES)/$(VBOX_SKELETON_MANGLED_NAME)-$(VBOX_VERSION_STRING)r$(VBOX_SVN_REV).vbox-extpack: \
0N/A $$(foreach file, $$(VBOX_SKELETON_FILES), $$(firstword $$(subst =>,$$(SP),$$(file)))) \
0N/A | $(VBOX_PATH_PACKAGES)/
0N/A $(RM) -f $(wildcard $(VBOX_PATH_PACKAGES)/$(VBOX_SKELETON_MANGLED_NAME)-*.vbox-extpack) \
0N/A $(VBoxSkeletonIns_0_OUTDIR)/ExtPack.manifest \
0N/A $(VBoxSkeletonIns_0_OUTDIR)/ExtPack.signature
0N/A# Stage all the files
0N/A $(RM) -Rf $(VBoxSkeletonIns_0_OUTDIR)/Stage/
0N/A $(foreach file, $(VBOX_SKELETON_FILES),\
0N/A $(NLTAB)$(MKDIR) -p $(dir $(lastword $(subst =>,$(SP)$(VBoxSkeletonIns_0_OUTDIR)/Stage/,$(file)))) \
0N/A $(NLTAB)$(CP) $(subst =>,$(SP)$(VBoxSkeletonIns_0_OUTDIR)/Stage/,$(file)) )
0N/A# Create the manifest
0N/A $(VBOX_RTMANIFEST) \
0N/A --manifest $(VBoxSkeletonIns_0_OUTDIR)/Stage/ExtPack.manifest \
0N/A --chdir $(VBoxSkeletonIns_0_OUTDIR)/Stage/ \
0N/A $(foreach file, $(VBOX_SKELETON_FILES), $(lastword $(subst =>,$(SP),$(file))))
0N/A $(APPEND) $(VBoxSkeletonIns_0_OUTDIR)/Stage/ExtPack.signature "todo"
0N/A $(CHMOD) a+r \
0N/A $(VBoxSkeletonIns_0_OUTDIR)/Stage/ExtPack.manifest \
0N/A $(VBoxSkeletonIns_0_OUTDIR)/Stage/ExtPack.signature
0N/A# Tar it up.
0N/A tar -cvf - -C $(VBoxSkeletonIns_0_OUTDIR)/Stage/ . | gzip -9c > $@
0N/A# Clean up
0N/A $(RM) -Rf $(VBoxSkeletonIns_0_OUTDIR)/Stage/
0N/A
0N/ABLDDIRS += $(VBOX_PATH_PACKAGES)/
0N/A
0N/Ainclude $(KBUILD_PATH)/subfooter.kmk
0N/A
1879N/A