VirtualBox

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

Last change on this file since 45733 was 41477, checked in by vboxsync, 13 years ago

/Makefile.kmk: Cosmetic changes.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 6.6 KB
Line 
1# $Id: Makefile.kmk 41477 2012-05-29 11:43:27Z vboxsync $
2## @file
3# Sub-Makefile for the FreeBSD guest additions base directory.
4#
5
6#
7# Copyright (C) 2008-2012 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 VBoxOGLarrayspu.so \
71 VBoxOGLcrutil.so \
72 VBoxOGLerrorspu.so \
73 VBoxOGLfeedbackspu.so \
74 VBoxOGLpackspu.so \
75 VBoxOGLpassthroughspu.so \
76 VBoxOGL.so
77
78VBOX_FBSD_ADD_MODULES = \
79 vboxguest \
80 vboxvideo_drm
81
82#
83# All the bin files that go into the archives.
84#
85VBOX_FBSD_ADD_DBG_SYM_FILES := $(addsuffix .dbgsym,$(VBOX_FBSD_ADD_STRIP_BIN))
86VBOX_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))
87VBOX_FBSD_ADD_INS_MODULES := $(addprefix $(VBOX_FBSD_ADD_INS_OUT_DIR)/module/,$(VBOX_FBSD_ADD_MODULES))
88
89# Cleanup of the the installer directory files
90OTHER_CLEAN += $(VBOX_FBSD_ADD_INS_FILES)) $(VBOX_FBSD_ADD_INS_MODULES)
91
92# pattern rule for copying the debug info from the VBOX_FBSD_ADD_STRIP_BIN files to the installation directory
93$(addprefix $(VBOX_FBSD_ADD_INS_OUT_DIR)/,$(VBOX_FBSD_ADD_DBG_SYM_FILES)): \
94 $(VBOX_FBSD_ADD_INS_OUT_DIR)/%.dbgsym : $(PATH_STAGE_BIN)/additions/% | $$(dir $$@)
95 $(call MSG_TOOL,copydbg,$<,$@)
96 $(QUIET)objcopy --only-keep-debug $< $@
97
98# pattern rule for stripping and copying the VBOX_FBSD_ADD_STRIP_BIN files to the installation directory
99$(addprefix $(VBOX_FBSD_ADD_INS_OUT_DIR)/,$(VBOX_FBSD_ADD_STRIP_BIN)): \
100 $(VBOX_FBSD_ADD_INS_OUT_DIR)/% : $(PATH_STAGE_BIN)/additions/% \
101 $(VBOX_FBSD_ADD_INS_OUT_DIR)/%.dbgsym \
102 | $$(dir $$@)
103 $(call MSG_INST_FILE,$<,$@)
104 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
105 $(QUIET)objcopy --add-gnu-debuglink=$(addsuffix .dbgsym,$@) $@
106
107# pattern rule for stripping and copying the VBOX_FBSD_ADD_STRIP_OBJ files to the installation directory
108$(addprefix $(VBOX_FBSD_ADD_INS_OUT_DIR)/,$(VBOX_FBSD_ADD_STRIP_OBJ)): \
109 $(VBOX_FBSD_ADD_INS_OUT_DIR)/% : $(PATH_STAGE_BIN)/additions/% | $$(dir $$@)
110 $(call MSG_INST_FILE,$<,$@)
111ifeq ($(VBOX_DO_STRIP),)
112 $(QUIET)$(INSTALL) -m 0644 $< $@
113else # strip to temp file because of umask.
114 $(QUIET)objcopy --strip-unneeded -R .comment $< [email protected]
115 $(QUIET)$(INSTALL) -m 0644 [email protected] $@
116 $(QUIET)$(RM) -f -- [email protected]
117endif
118
119# pattern rule for copying the VBOX_FBSD_ADD_MODULES files to the installation directory
120$(VBOX_FBSD_ADD_INS_MODULES): \
121 $(VBOX_FBSD_ADD_INS_OUT_DIR)/module/% : $(PATH_STAGE_BIN)/additions/src/% | $(VBOX_FBSD_ADD_INS_OUT_DIR)/module/
122 $(call MSG_INST_FILE,$<,$@)
123# Remove target directories first, otherwise the behaviour of cp will not be
124# what we want if it already exists. See the cp manual page for more details.
125 $(QUIET)$(RM) -Rf $@
126 $(QUIET)cp -af $< $(VBOX_FBSD_ADD_INS_OUT_DIR)/module
127
128
129INSTALLS += $(if $(VBOX_OSE),, fbsd_add_inst-nobin)
130fbsd_add_inst-nobin_INST = obj/Additions/Installer/freebsd
131fbsd_add_inst-nobin_MODE = a+r,u+w
132fbsd_add_inst-nobin_SOURCES = \
133 ../x11/Installer/98vboxadd-xclient \
134 ../x11/Installer/vboxclient.desktop \
135 ../x11/Installer/vboxvideo.ids \
136 ../x11/Installer/x11config.pl \
137 ../x11/Installer/x11config15.pl
138
139
140INSTALLS += GuestDrivers-src
141GuestDrivers-src_INST = bin/additions/src/
142GuestDrivers-src_MODE = a+r,u+w
143GuestDrivers-src_SOURCES = Makefile
144
145# this file needs editing before it can be included in the generic installer.
146$(VBOX_FBSD_ADD_INS_OUT_DIR)/install.sh: \
147 $(VBOX_PATH_FREEBSD_ADDITION_INSTALLER)/install.sh | $$(dir $$@)
148 $(QUIET)$(SED) \
149 -e "s;_VERSION_;$(VBOX_VERSION_STRING);g" \
150 -e "s;_BUILD_;$(shell date);g" \
151 -e "s;_OSE_;$(VBOX_OSE);g" \
152 -e "s;_BUILDTYPE_;$(KBUILD_TYPE);g" \
153 -e "s;_ARCH_;$(KBUILD_TARGET_ARCH);g" \
154 --output $(VBOX_FBSD_ADD_INS_OUT_DIR)/install_.sh \
155 $<
156 $(QUIET)$(INSTALL) -m 0755 $(VBOX_FBSD_ADD_INS_OUT_DIR)/install_.sh $@
157 $(QUIET)$(RM) $(VBOX_FBSD_ADD_INS_OUT_DIR)/install_.sh
158OTHERS_CLEAN += $(VBOX_FBSD_ADD_INS_OUT_DIR)/install.sh
159
160
161include $(FILE_KBUILD_SUB_FOOTER)
162
163
164#
165# Build the FreeBSD Guest Additions installer package.
166#
167# Note that $(PATH_SUB_CURRENT) was changed by subfooter.kmk above and
168# any references should be made via variables assigned a know value via := .
169#
170# We need to depend on all source files for the additions and shared
171# folders kernel modules.
172## @todo Replace the wildcard stuff by the correct file lists now that
173# we've got everything included.
174#
175$(PATH_STAGE_BIN)/additions/VBoxFreeBSDAdditions.tbz: \
176 $$(fbsd_add_inst-nobin_2_STAGE_TARGETS) \
177 $$(fbsd_add_inst-bin_2_STAGE_TARGETS) \
178 $(VBOX_FBSD_ADD_INS_FILES) \
179 $(VBOX_FBSD_ADD_INS_MODULES) \
180 $(VBOX_FBSD_ADD_INS_OUT_DIR)/install.sh \
181 $(wildcard $(PATH_STAGE_BIN)/additions/src/*) \
182 $(wildcard $(PATH_STAGE_BIN)/additions/src/*/*) \
183 $(wildcard $(PATH_STAGE_BIN)/additions/src/*/*/*) \
184 $(wildcard $(PATH_STAGE_BIN)/additions/src/*/*/*/*) \
185 $(VBOX_VERSION_STAMP)
186 pkg_create \
187 -I $(VBOX_PATH_FREEBSD_ADDITION_INSTALLER)/install.sh \
188 -c $(VBOX_PATH_FREEBSD_ADDITION_INSTALLER)/pkg-comment \
189 -d $(VBOX_PATH_FREEBSD_ADDITION_INSTALLER)/pkg-descr \
190 -f $(VBOX_PATH_FREEBSD_ADDITION_INSTALLER)/pkg-plist \
191 $@
192
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