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