[40383] | 1 | # $Id: Makefile.kmk 98103 2023-01-17 14:15:46Z vboxsync $
|
---|
| 2 | ## @file
|
---|
| 3 | # Sub-Makefile for the VNC Extension Pack.
|
---|
| 4 | #
|
---|
| 5 |
|
---|
| 6 | #
|
---|
[98103] | 7 | # Copyright (C) 2010-2023 Oracle and/or its affiliates.
|
---|
[40383] | 8 | #
|
---|
[96407] | 9 | # This file is part of VirtualBox base platform packages, as
|
---|
| 10 | # available from https://www.virtualbox.org.
|
---|
[40383] | 11 | #
|
---|
[96407] | 12 | # This program is free software; you can redistribute it and/or
|
---|
| 13 | # modify it under the terms of the GNU General Public License
|
---|
| 14 | # as published by the Free Software Foundation, in version 3 of the
|
---|
| 15 | # License.
|
---|
| 16 | #
|
---|
| 17 | # This program is distributed in the hope that it will be useful, but
|
---|
| 18 | # WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
| 20 | # General Public License for more details.
|
---|
| 21 | #
|
---|
| 22 | # You should have received a copy of the GNU General Public License
|
---|
| 23 | # along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
| 24 | #
|
---|
| 25 | # SPDX-License-Identifier: GPL-3.0-only
|
---|
| 26 | #
|
---|
[40383] | 27 |
|
---|
| 28 | SUB_DEPTH = ../../../..
|
---|
[41477] | 29 | include $(KBUILD_PATH)/subheader.kmk
|
---|
[40383] | 30 |
|
---|
| 31 | #
|
---|
| 32 | # Extend the extension pack templates.
|
---|
| 33 | #
|
---|
| 34 | TEMPLATE_VBoxR3ExtPackVNC = For the ring-3 context modules in the VNC extension pack.
|
---|
| 35 | TEMPLATE_VBoxR3ExtPackVNC_EXTENDS = VBoxR3ExtPack
|
---|
| 36 | TEMPLATE_VBoxR3ExtPackVNC_INST = $(INST_EXTPACK)VNC/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)/
|
---|
| 37 |
|
---|
| 38 | TEMPLATE_VBoxR0ExtPackVNC = For the ring-0 context modules in the VNC extension pack.
|
---|
| 39 | TEMPLATE_VBoxR0ExtPackVNC_EXTENDS = VBoxR0ExtPack
|
---|
| 40 | TEMPLATE_VBoxR0ExtPackVNC_INST = $(INST_EXTPACK)VNC/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)/
|
---|
| 41 |
|
---|
| 42 | TEMPLATE_VBoxRcExtPackVNC = For the raw-mode context modules in the VNC extension pack.
|
---|
| 43 | TEMPLATE_VBoxRcExtPackVNC_EXTENDS = VBoxRcExtPack
|
---|
| 44 | TEMPLATE_VBoxRcExtPackVNC_INST = $(INST_EXTPACK)VNC/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)/
|
---|
| 45 |
|
---|
| 46 | TEMPLATE_VBoxInsExtPackVNC = For the install targets of an extension pack.
|
---|
| 47 | TEMPLATE_VBoxInsExtPackVNC_EXTENDS = VBoxR0ExtPack
|
---|
| 48 | TEMPLATE_VBoxInsExtPackVNC_INST = $(INST_EXTPACK)VNC/
|
---|
| 49 |
|
---|
| 50 | #
|
---|
| 51 | # Globals.
|
---|
| 52 | #
|
---|
| 53 | VBOX_VNC_NAME = VNC
|
---|
| 54 | VBOX_VNC_MANGLED_NAME = VNC
|
---|
| 55 | VBOX_PATH_EXTPACK_VNC = $(PATH_STAGE)/$(INST_EXTPACK)VNC
|
---|
| 56 |
|
---|
| 57 | #
|
---|
| 58 | # VBoxVNCMain - The module which the VirtualBox Main API talks to.
|
---|
| 59 | #
|
---|
| 60 | DLLS += VBoxVNCMain
|
---|
| 61 | VBoxVNCMain_TEMPLATE = VBoxR3ExtPackVNC
|
---|
| 62 | VBoxVNCMain_SOURCES = VBoxVNCMain.cpp
|
---|
| 63 | VBoxVNCMain_DEFS =
|
---|
| 64 |
|
---|
| 65 | #
|
---|
| 66 | # VBoxVNC - The VNC VRDE module.
|
---|
| 67 | #
|
---|
| 68 | DLLS += VBoxVNC
|
---|
| 69 | VBoxVNC_TEMPLATE = VBoxR3ExtPackVNC
|
---|
| 70 | VBoxVNC_SOURCES = VBoxVNC.cpp
|
---|
| 71 | # NOTE: vncserver is covered by GPL, so the extpack must be GPL, too.
|
---|
| 72 | VBoxVNC_LIBS = vncserver
|
---|
| 73 | VBoxVNC_DEFS =
|
---|
| 74 |
|
---|
| 75 | #
|
---|
| 76 | # Install the description.
|
---|
| 77 | #
|
---|
| 78 | INSTALLS += VBoxVNCIns
|
---|
| 79 | VBoxVNCIns_TEMPLATE = VBoxInsExtPackVNC
|
---|
| 80 | VBoxVNCIns_SOURCES = \
|
---|
| 81 | $(VBoxVNCIns_0_OUTDIR)/ExtPack.xml \
|
---|
| 82 | $(PATH_ROOT)/doc/License-gpl-2.html=>ExtPack-license.html \
|
---|
| 83 | $(PATH_ROOT)/doc/License-gpl-2.txt=>ExtPack-license.txt \
|
---|
| 84 | $(PATH_ROOT)/doc/License-gpl-2.rtf=>ExtPack-license.rtf
|
---|
| 85 | $(call VBOX_EDIT_VERSION_RULE_FN,VBoxVNCIns,ExtPack.xml)
|
---|
| 86 |
|
---|
| 87 |
|
---|
| 88 | #
|
---|
| 89 | # Packing.
|
---|
| 90 | #
|
---|
| 91 | ifndef VBOX_WITHOUT_EXTPACK_VNC_PACKING
|
---|
| 92 | PACKING += $(VBOX_PATH_PACKAGES)/$(VBOX_VNC_MANGLED_NAME)-$(VBOX_VERSION_STRING)r$(VBOX_SVN_REV).vbox-extpack
|
---|
| 93 | endif
|
---|
| 94 |
|
---|
| 95 | ifndef VBOX_WITH_EXTPACK_OS_ARCHS
|
---|
| 96 | VBOX_WITH_EXTPACK_OS_ARCHS = $(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)
|
---|
| 97 | endif
|
---|
| 98 |
|
---|
| 99 | # Build the file list. The macro takes 1=darwin.x86, 2=dist/VirtualBox.app/Contents/MacOS, 3=dylib
|
---|
| 100 | VBOX_VNC_FILES_MACRO = \
|
---|
| 101 | $(PATH_OUT_BASE)/$(1)/$(KBUILD_TYPE)/$(2)/ExtensionPacks/$(VBOX_VNC_MANGLED_NAME)/$(1)/VBoxVNCMain.$(3)=>$(1)/VBoxVNCMain.$(3) \
|
---|
| 102 | $(PATH_OUT_BASE)/$(1)/$(KBUILD_TYPE)/$(2)/ExtensionPacks/$(VBOX_VNC_MANGLED_NAME)/$(1)/VBoxVNC.$(3)=>$(1)/VBoxVNC.$(3)
|
---|
| 103 |
|
---|
| 104 | VBOX_VNC_FILES := \
|
---|
| 105 | $(VBOX_PATH_EXTPACK_VNC)/ExtPack.xml=>ExtPack.xml \
|
---|
| 106 | $(VBOX_PATH_EXTPACK_VNC)/ExtPack-license.html=>ExtPack-license.html \
|
---|
| 107 | $(VBOX_PATH_EXTPACK_VNC)/ExtPack-license.rtf=>ExtPack-license.rtf \
|
---|
| 108 | $(VBOX_PATH_EXTPACK_VNC)/ExtPack-license.txt=>ExtPack-license.txt
|
---|
| 109 |
|
---|
| 110 |
|
---|
| 111 | if1of (darwin.amd64, $(VBOX_WITH_EXTPACK_OS_ARCHS))
|
---|
| 112 | VBOX_VNC_FILES += $(call VBOX_VNC_FILES_MACRO,darwin.amd64,dist/VirtualBox.app/Contents/MacOS,dylib)
|
---|
| 113 | endif
|
---|
| 114 | if1of (darwin.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS))
|
---|
| 115 | VBOX_VNC_FILES += $(call VBOX_VNC_FILES_MACRO,darwin.x86,dist/VirtualBox.app/Contents/MacOS,dylib)
|
---|
| 116 | endif
|
---|
| 117 | if1of (freebsd.amd64, $(VBOX_WITH_EXTPACK_OS_ARCHS))
|
---|
| 118 | VBOX_VNC_FILES += $(call VBOX_VNC_FILES_MACRO,freebsd.amd64,bin,so)
|
---|
| 119 | endif
|
---|
| 120 | if1of (freebsd.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS))
|
---|
| 121 | VBOX_VNC_FILES += $(call VBOX_VNC_FILES_MACRO,freebsd.x86,bin,so)
|
---|
| 122 | endif
|
---|
| 123 | if1of (linux.amd64, $(VBOX_WITH_EXTPACK_OS_ARCHS))
|
---|
| 124 | VBOX_VNC_FILES += $(call VBOX_VNC_FILES_MACRO,linux.amd64,bin,so)
|
---|
| 125 | endif
|
---|
| 126 | if1of (linux.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS))
|
---|
| 127 | VBOX_VNC_FILES += $(call VBOX_VNC_FILES_MACRO,linux.x86,bin,so)
|
---|
| 128 | endif
|
---|
| 129 | if1of (os2.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS))
|
---|
| 130 | VBOX_VNC_FILES += $(call VBOX_VNC_FILES_MACRO,os2.x86,bin,so)
|
---|
| 131 | endif
|
---|
| 132 | if1of (solaris.amd64, $(VBOX_WITH_EXTPACK_OS_ARCHS))
|
---|
| 133 | VBOX_VNC_FILES += $(call VBOX_VNC_FILES_MACRO,solaris.amd64,bin,so)
|
---|
| 134 | endif
|
---|
| 135 | if1of (solaris.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS))
|
---|
| 136 | VBOX_VNC_FILES += $(call VBOX_VNC_FILES_MACRO,solaris.x86,bin,so)
|
---|
| 137 | endif
|
---|
| 138 | if1of (win.amd64, $(VBOX_WITH_EXTPACK_OS_ARCHS))
|
---|
| 139 | VBOX_VNC_FILES += $(call VBOX_VNC_FILES_MACRO,win.amd64,bin,dll)
|
---|
| 140 | endif
|
---|
| 141 | if1of (win.x86, $(VBOX_WITH_EXTPACK_OS_ARCHS))
|
---|
| 142 | VBOX_VNC_FILES += $(call VBOX_VNC_FILES_MACRO,win.x86,bin,dll)
|
---|
| 143 | endif
|
---|
| 144 |
|
---|
| 145 | # Pack it all up using a temporary staging directory.
|
---|
| 146 | $(VBOX_PATH_PACKAGES)/$(VBOX_VNC_MANGLED_NAME)-$(VBOX_VERSION_STRING)r$(VBOX_SVN_REV).vbox-extpack: \
|
---|
| 147 | $$(foreach file, $$(VBOX_VNC_FILES), $$(firstword $$(subst =>,$$(SP),$$(file)))) \
|
---|
| 148 | | $(VBOX_PATH_PACKAGES)/
|
---|
| 149 | $(RM) -f $(wildcard $(VBOX_PATH_PACKAGES)/$(VBOX_VNC_MANGLED_NAME)-*.vbox-extpack) \
|
---|
| 150 | $(VBoxVNCIns_0_OUTDIR)/ExtPack.manifest \
|
---|
| 151 | $(VBoxVNCIns_0_OUTDIR)/ExtPack.signature
|
---|
| 152 | # Stage all the files
|
---|
| 153 | $(RM) -Rf $(VBoxVNCIns_0_OUTDIR)/Stage/
|
---|
| 154 | $(foreach file, $(VBOX_VNC_FILES),\
|
---|
| 155 | $(NLTAB)$(MKDIR) -p $(dir $(lastword $(subst =>,$(SP)$(VBoxVNCIns_0_OUTDIR)/Stage/,$(file)))) \
|
---|
| 156 | $(NLTAB)$(CP) $(subst =>,$(SP)$(VBoxVNCIns_0_OUTDIR)/Stage/,$(file)) )
|
---|
| 157 | # Create the manifest
|
---|
| 158 | $(VBOX_RTMANIFEST) \
|
---|
| 159 | --manifest $(VBoxVNCIns_0_OUTDIR)/Stage/ExtPack.manifest \
|
---|
| 160 | --chdir $(VBoxVNCIns_0_OUTDIR)/Stage/ \
|
---|
| 161 | $(foreach file, $(VBOX_VNC_FILES), $(lastword $(subst =>,$(SP),$(file))))
|
---|
| 162 | $(APPEND) $(VBoxVNCIns_0_OUTDIR)/Stage/ExtPack.signature "todo"
|
---|
| 163 | $(CHMOD) a+r \
|
---|
| 164 | $(VBoxVNCIns_0_OUTDIR)/Stage/ExtPack.manifest \
|
---|
| 165 | $(VBoxVNCIns_0_OUTDIR)/Stage/ExtPack.signature
|
---|
| 166 | # Tar it up.
|
---|
| 167 | tar -cvf - -C $(VBoxVNCIns_0_OUTDIR)/Stage/ . | gzip -9c > $@
|
---|
| 168 | # Clean up
|
---|
| 169 | $(RM) -Rf $(VBoxVNCIns_0_OUTDIR)/Stage/
|
---|
| 170 |
|
---|
| 171 | BLDDIRS += $(VBOX_PATH_PACKAGES)/
|
---|
| 172 |
|
---|
[41477] | 173 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
[40383] | 174 |
|
---|