VirtualBox

source: vbox/trunk/src/VBox/Additions/freebsd/Makefile.kmk@ 83547

Last change on this file since 83547 was 82968, checked in by vboxsync, 5 years ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 6.5 KB
Line 
1# $Id: Makefile.kmk 82968 2020-02-04 10:35:17Z vboxsync $
2## @file
3# Sub-Makefile for the FreeBSD guest additions base directory.
4#
5
6#
7# Copyright (C) 2008-2020 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
18SUB_DEPTH = ../../../..
19include $(KBUILD_PATH)/subheader.kmk
20
21ifneq ($(KBUILD_HOST),freebsd)
22$(error "The FreeBSD guest additions installer can only be built on FreeBSD!")
23endif
24
25# Include sub-makefiles.
26#include $(PATH_SUB_CURRENT)/vboxvfs/Makefile.kmk
27include $(PATH_SUB_CURRENT)/drm/Makefile.kmk
28
29#
30# Globals
31#
32VBOX_FBSD_ADD_INS_OUT_DIR := $(PATH_TARGET)/Additions/Installer/freebsd
33BLDDIRS += \
34 $(VBOX_FBSD_ADD_INS_OUT_DIR) \
35 $(VBOX_FBSD_ADD_INS_OUT_DIR)/module
36VBOX_PATH_FREEBSD_ADDITION_INSTALLER := $(PATH_SUB_CURRENT)/Installer
37VBOX_PATH_X11_ADDITION_INSTALLER := $(PATH_ROOT)/src/VBox/Additions/x11/Installer
38
39
40#
41# Targets
42#
43ifndef VBOX_OSE
44 BLDDIRS += $(VBOX_FBSD_ADD_INS_OUT_DIR) $(VBOX_FBSD_ADD_INS_OUT_DIR)/module
45 PACKING += $(PATH_STAGE_BIN)/additions/VBoxFreeBSDAdditions.tbz
46 OTHER_CLEAN += $(PACKING)
47endif
48
49
50#
51# Files to install
52#
53VBOX_FBSD_ADD_STRIP_BIN = \
54 VBoxService \
55 VBoxClient \
56 VBoxControl \
57 vboxmouse_drv_70.so \
58 vboxmouse_drv_71.so \
59 vboxmouse_drv_14.so \
60 vboxmouse_drv_15.so \
61 vboxmouse_drv_16.so \
62 vboxmouse_drv_17.so \
63 vboxvideo_drv_70.so \
64 vboxvideo_drv_71.so \
65 vboxvideo_drv_13.so \
66 vboxvideo_drv_14.so \
67 vboxvideo_drv_15.so \
68 vboxvideo_drv_16.so \
69 vboxvideo_drv_17.so
70
71VBOX_FBSD_ADD_MODULES = \
72 vboxguest \
73 vboxvideo_drm
74
75#
76# All the bin files that go into the archives.
77#
78VBOX_FBSD_ADD_DBG_SYM_FILES := $(addsuffix .dbgsym,$(VBOX_FBSD_ADD_STRIP_BIN))
79VBOX_FBSD_ADD_INS_FILES := $(addprefix $(VBOX_FBSD_ADD_INS_OUT_DIR)/,$(VBOX_FBSD_ADD_STRIP_BIN) $(VBOX_FBSD_ADD_STRIP_OBJ) $(VBOX_FBSD_ADD_DBG_SYM_FILES))
80VBOX_FBSD_ADD_INS_MODULES := $(addprefix $(VBOX_FBSD_ADD_INS_OUT_DIR)/module/,$(VBOX_FBSD_ADD_MODULES))
81
82# Cleanup of the installer directory files
83OTHER_CLEAN += $(VBOX_FBSD_ADD_INS_FILES)) $(VBOX_FBSD_ADD_INS_MODULES)
84
85# pattern rule for copying the debug info from the VBOX_FBSD_ADD_STRIP_BIN files to the installation directory
86$(addprefix $(VBOX_FBSD_ADD_INS_OUT_DIR)/,$(VBOX_FBSD_ADD_DBG_SYM_FILES)): \
87 $(VBOX_FBSD_ADD_INS_OUT_DIR)/%.dbgsym : $(PATH_STAGE_BIN)/additions/% | $$(dir $$@)
88 $(call MSG_TOOL,copydbg,$<,$@)
89 $(QUIET)objcopy --only-keep-debug $< $@
90
91# pattern rule for stripping and copying the VBOX_FBSD_ADD_STRIP_BIN files to the installation directory
92$(addprefix $(VBOX_FBSD_ADD_INS_OUT_DIR)/,$(VBOX_FBSD_ADD_STRIP_BIN)): \
93 $(VBOX_FBSD_ADD_INS_OUT_DIR)/% : $(PATH_STAGE_BIN)/additions/% \
94 $(VBOX_FBSD_ADD_INS_OUT_DIR)/%.dbgsym \
95 | $$(dir $$@)
96 $(call MSG_INST_FILE,$<,$@)
97 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
98 $(QUIET)objcopy --add-gnu-debuglink=$(addsuffix .dbgsym,$@) $@
99
100# pattern rule for stripping and copying the VBOX_FBSD_ADD_STRIP_OBJ files to the installation directory
101$(addprefix $(VBOX_FBSD_ADD_INS_OUT_DIR)/,$(VBOX_FBSD_ADD_STRIP_OBJ)): \
102 $(VBOX_FBSD_ADD_INS_OUT_DIR)/% : $(PATH_STAGE_BIN)/additions/% | $$(dir $$@)
103 $(call MSG_INST_FILE,$<,$@)
104ifeq ($(VBOX_DO_STRIP),)
105 $(QUIET)$(INSTALL) -m 0644 $< $@
106else # strip to temp file because of umask.
107 $(QUIET)objcopy --strip-unneeded -R .comment $< [email protected]
108 $(QUIET)$(INSTALL) -m 0644 [email protected] $@
109 $(QUIET)$(RM) -f -- [email protected]
110endif
111
112# pattern rule for copying the VBOX_FBSD_ADD_MODULES files to the installation directory
113$(VBOX_FBSD_ADD_INS_MODULES): \
114 $(VBOX_FBSD_ADD_INS_OUT_DIR)/module/% : $(PATH_STAGE_BIN)/additions/src/% | $(VBOX_FBSD_ADD_INS_OUT_DIR)/module/
115 $(call MSG_INST_FILE,$<,$@)
116# Remove target directories first, otherwise the behaviour of cp will not be
117# what we want if it already exists. See the cp manual page for more details.
118 $(QUIET)$(RM) -Rf $@
119 $(QUIET)cp -af $< $(VBOX_FBSD_ADD_INS_OUT_DIR)/module
120
121
122INSTALLS += $(if $(VBOX_OSE),, fbsd_add_inst-nobin)
123fbsd_add_inst-nobin_INST = obj/Additions/Installer/freebsd
124fbsd_add_inst-nobin_MODE = a+r,u+w
125fbsd_add_inst-nobin_SOURCES = \
126 ../x11/Installer/98vboxadd-xclient \
127 ../x11/Installer/vboxclient.desktop \
128 ../x11/Installer/vboxvideo.ids \
129 ../x11/Installer/x11config.pl \
130 ../x11/Installer/x11config15.pl
131
132
133INSTALLS += GuestDrivers-src
134GuestDrivers-src_INST = bin/additions/src/
135GuestDrivers-src_MODE = a+r,u+w
136GuestDrivers-src_SOURCES = Makefile
137
138# this file needs editing before it can be included in the generic installer.
139$(VBOX_FBSD_ADD_INS_OUT_DIR)/install.sh: \
140 $(VBOX_PATH_FREEBSD_ADDITION_INSTALLER)/install.sh | $$(dir $$@)
141 $(QUIET)$(SED) \
142 -e "s;_VERSION_;$(VBOX_VERSION_STRING);g" \
143 -e "s;_BUILD_;$(shell date);g" \
144 -e "s;_OSE_;$(VBOX_OSE);g" \
145 -e "s;_BUILDTYPE_;$(KBUILD_TYPE);g" \
146 -e "s;_ARCH_;$(KBUILD_TARGET_ARCH);g" \
147 --output $(VBOX_FBSD_ADD_INS_OUT_DIR)/install_.sh \
148 $<
149 $(QUIET)$(INSTALL) -m 0755 $(VBOX_FBSD_ADD_INS_OUT_DIR)/install_.sh $@
150 $(QUIET)$(RM) $(VBOX_FBSD_ADD_INS_OUT_DIR)/install_.sh
151OTHERS_CLEAN += $(VBOX_FBSD_ADD_INS_OUT_DIR)/install.sh
152
153
154include $(FILE_KBUILD_SUB_FOOTER)
155
156
157#
158# Build the FreeBSD Guest Additions installer package.
159#
160# Note that $(PATH_SUB_CURRENT) was changed by subfooter.kmk above and
161# any references should be made via variables assigned a know value via := .
162#
163# We need to depend on all source files for the additions and shared
164# folders kernel modules.
165## @todo Replace the wildcard stuff by the correct file lists now that
166# we've got everything included.
167#
168$(PATH_STAGE_BIN)/additions/VBoxFreeBSDAdditions.tbz: \
169 $$(fbsd_add_inst-nobin_2_STAGE_TARGETS) \
170 $$(fbsd_add_inst-bin_2_STAGE_TARGETS) \
171 $(VBOX_FBSD_ADD_INS_FILES) \
172 $(VBOX_FBSD_ADD_INS_MODULES) \
173 $(VBOX_FBSD_ADD_INS_OUT_DIR)/install.sh \
174 $(wildcard $(PATH_STAGE_BIN)/additions/src/*) \
175 $(wildcard $(PATH_STAGE_BIN)/additions/src/*/*) \
176 $(wildcard $(PATH_STAGE_BIN)/additions/src/*/*/*) \
177 $(wildcard $(PATH_STAGE_BIN)/additions/src/*/*/*/*) \
178 $(VBOX_VERSION_STAMP) $(VBOX_SVN_REV_HEADER)
179 pkg_create \
180 -I $(VBOX_PATH_FREEBSD_ADDITION_INSTALLER)/install.sh \
181 -c $(VBOX_PATH_FREEBSD_ADDITION_INSTALLER)/pkg-comment \
182 -d $(VBOX_PATH_FREEBSD_ADDITION_INSTALLER)/pkg-descr \
183 -f $(VBOX_PATH_FREEBSD_ADDITION_INSTALLER)/pkg-plist \
184 $@
185
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette