45
45
VBOX_LNX_ADD_INST_INIT_DIR := $(VBOX_LNX_ADD_INST_OUT_DIR)init/
47
47
# Installation paths for debug symbols
48
VBOX_LNX_ADD_DBG_BIN_DIR := $(VBOX_LNX_ADD_INST_DBG_DIR)bin/
49
VBOX_LNX_ADD_DBG_SBIN_DIR := $(VBOX_LNX_ADD_INST_DBG_DIR)sbin/
50
VBOX_LNX_ADD_DBG_LIB_DIR := $(VBOX_LNX_ADD_INST_DBG_DIR)lib/
51
VBOX_LNX_ADD_DBG_MOD_DIR := $(VBOX_LNX_ADD_INST_DBG_DIR)lib/$(VBOX_LNX_ADD_PACKAGE_NAME)/
48
VBOX_LNX_ADD_DBG_BIN_DIR := $(VBOX_LNX_ADD_INST_DBG_DIR)bin/
49
VBOX_LNX_ADD_DBG_SBIN_DIR := $(VBOX_LNX_ADD_INST_DBG_DIR)sbin/
50
VBOX_LNX_ADD_DBG_LIB_DIR := $(VBOX_LNX_ADD_INST_DBG_DIR)lib/
51
VBOX_LNX_ADD_DBG_MOD_DIR := $(VBOX_LNX_ADD_INST_DBG_DIR)lib/$(VBOX_LNX_ADD_PACKAGE_NAME)/
53
53
# Script source directories
54
54
VBOX_PATH_LNX_ADD_INST := $(PATH_SUB_CURRENT)/installer/
93
93
# Use VBOX_WITHOUT_LINUX_GUEST_PACKAGE to skip building the .run installer.
94
94
# This will only take effect if you also use VBOX_WITHOUT_ADDITIONS_ISO.
96
$(if-expr !defined(VBOX_WITHOUT_LINUX_GUEST_PACKAGE), $(PATH_BIN)/additions/VBoxLinuxAdditions.run,) \
96
$(if-expr !defined(VBOX_WITHOUT_LINUX_GUEST_PACKAGE), $(PATH_STAGE_BIN)/additions/VBoxLinuxAdditions.run,) \
97
97
$(VBOX_LNX_ADD_ARCHIVES) \
98
$(PATH_BIN)/additions/VBoxGuestAdditions-dbg.tar.bz2
98
$(PATH_STAGE_BIN)/additions/VBoxGuestAdditions-dbg.tar.bz2
101
101
$(foreach file, $(VBOX_LNX_ADD_ARCHIVES), $(VBOX_LNX_ADD_INST_STAGE_DIR)$(subst -r$(VBOX_SVN_REV),,$(notdir $(file))))
187
187
$(addprefix $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_STRIP_MOD)) \
188
188
$(addprefix $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_MOD)) \
189
189
$(addprefix $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_STRIP_OBJ)) \
190
$(addprefix $(VBOX_LNX_ADD_INST_KMOD_DIR),$(VBOX_LNX_ADD_KMOD)) \
190
$(addprefix $(VBOX_LNX_ADD_INST_KMOD_DIR),$(VBOX_LNX_ADD_KMOD_FILES)) \
191
191
$(addprefix $(VBOX_LNX_ADD_INST_INIT_DIR),$(VBOX_LNX_ADD_INIT)) \
192
192
$(addprefix $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_INIT))
194
## @todo figure how to clean these... Or maybe rewrite everything here to somehow use install targets?
195
VBOX_LNX_ADD_INST_DIRS := \
196
$(addprefix $(VBOX_LNX_ADD_INST_KMOD_DIR),$(VBOX_LNX_ADD_KMOD_DIRS))
194
198
VBOX_LNX_ADD_DBG_FILES := \
195
199
$(addprefix $(VBOX_LNX_ADD_DBG_BIN_DIR),$(VBOX_LNX_ADD_STRIP_BIN)) \
196
200
$(addprefix $(VBOX_LNX_ADD_DBG_SBIN_DIR),$(VBOX_LNX_ADD_STRIP_SBIN)) \
203
207
# pattern rules for copying the debug info from the VBOX_LNX_ADD_STRIP_* files to the installation directory
204
208
$(addprefix $(VBOX_LNX_ADD_DBG_BIN_DIR),$(VBOX_LNX_ADD_STRIP_BIN)): \
205
$(VBOX_LNX_ADD_DBG_BIN_DIR)% : $(PATH_BIN)/additions/% | $$(dir $$@)
209
$(VBOX_LNX_ADD_DBG_BIN_DIR)% : $(PATH_STAGE_BIN)/additions/% | $$(dir $$@)
206
210
$(call MSG_TOOL,copydbg,$<,$@)
207
211
$(QUIET)objcopy --only-keep-debug $< $@
209
213
$(addprefix $(VBOX_LNX_ADD_DBG_SBIN_DIR),$(VBOX_LNX_ADD_STRIP_SBIN)): \
210
$(VBOX_LNX_ADD_DBG_SBIN_DIR)% : $(PATH_BIN)/additions/% | $$(dir $$@)
214
$(VBOX_LNX_ADD_DBG_SBIN_DIR)% : $(PATH_STAGE_BIN)/additions/% | $$(dir $$@)
211
215
$(call MSG_TOOL,copydbg,$<,$@)
212
216
$(QUIET)objcopy --only-keep-debug $< $@
214
218
$(addprefix $(VBOX_LNX_ADD_DBG_LIB_DIR),$(VBOX_LNX_ADD_STRIP_LIB)): \
215
$(VBOX_LNX_ADD_DBG_LIB_DIR)% : $(PATH_BIN)/additions/% | $$(dir $$@)
219
$(VBOX_LNX_ADD_DBG_LIB_DIR)% : $(PATH_STAGE_BIN)/additions/% | $$(dir $$@)
216
220
$(call MSG_TOOL,copydbg,$<,$@)
217
221
$(QUIET)objcopy --only-keep-debug $< $@
219
223
$(addprefix $(VBOX_LNX_ADD_DBG_MOD_DIR),$(VBOX_LNX_ADD_STRIP_MOD)): \
220
$(VBOX_LNX_ADD_DBG_MOD_DIR)% : $(PATH_BIN)/additions/% | $$(dir $$@)
224
$(VBOX_LNX_ADD_DBG_MOD_DIR)% : $(PATH_STAGE_BIN)/additions/% | $$(dir $$@)
221
225
$(call MSG_TOOL,copydbg,$<,$@)
222
226
$(QUIET)objcopy --only-keep-debug $< $@
224
228
# pattern rule for stripping and copying the VBOX_LNX_ADD_STRIP_BIN files to the installation directory
225
229
$(addprefix $(VBOX_LNX_ADD_INST_BIN_DIR),$(VBOX_LNX_ADD_STRIP_BIN)): \
226
$(VBOX_LNX_ADD_INST_BIN_DIR)% : $(PATH_BIN)/additions/% \
230
$(VBOX_LNX_ADD_INST_BIN_DIR)% : $(PATH_STAGE_BIN)/additions/% \
227
231
$(VBOX_LNX_ADD_DBG_BIN_DIR)% \
229
233
$(call MSG_INST_FILE,$<,$@)
272
276
# pattern rule for copying the VBOX_LNX_ADD_KMOD files to the installation directory
273
$(addprefix $(VBOX_LNX_ADD_INST_KMOD_DIR),$(VBOX_LNX_ADD_KMOD)): \
274
$(VBOX_LNX_ADD_INST_KMOD_DIR_MOD)% : $(PATH_BIN)/additions/src/% | $$(dir $$@)
277
$(addprefix $(VBOX_LNX_ADD_INST_KMOD_DIR),$(VBOX_LNX_ADD_KMOD_DIRS) $(VBOX_LNX_ADD_KMOD_FILES)): \
278
$(VBOX_LNX_ADD_INST_KMOD_DIR_MOD)% : \
279
$(PATH_STAGE_BIN)/additions/src/% \
280
| $$(dir $$(patsubst $$(PERCENT)/,$$(PERCENT),$$@))
275
281
$(call MSG_INST_DIR,$<,$@)
276
282
$(QUIET)$(RM) -Rf $@
283
$(QUIET)$(CP) -RPf -- $< $@
279
285
# pattern rule for copying the VBOX_LNX_ADD_INIT files to the installation directory
280
286
$(addprefix $(VBOX_LNX_ADD_INST_INIT_DIR),$(VBOX_LNX_ADD_INIT)): \
281
$(VBOX_LNX_ADD_INST_INIT_DIR)% : $(PATH_BIN)/additions/% | $$(dir $$@)
287
$(VBOX_LNX_ADD_INST_INIT_DIR)% : $(PATH_STAGE_BIN)/additions/% | $$(dir $$@)
282
288
$(call MSG_INST_FILE,$<,$@)
283
289
# Remove target directories first, otherwise the behaviour of cp will not be
284
290
# what we want if it already exists. See the cp manual page for more details.
285
291
$(QUIET)$(RM) -Rf $@
292
$(QUIET)$(CP) -RPf -- $< $@
288
294
# pattern rule for copying the VBOX_LNX_ADD_INIT files to the module directory
289
295
$(addprefix $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_INIT)): \
290
$(VBOX_LNX_ADD_INST_MOD_DIR)% : $(PATH_BIN)/additions/% | $$(dir $$@)
296
$(VBOX_LNX_ADD_INST_MOD_DIR)% : $(PATH_STAGE_BIN)/additions/% | $$(dir $$@)
291
297
$(call MSG_INST_FILE,$<,$@)
292
298
# Remove target directories first, otherwise the behaviour of cp will not be
293
299
# what we want if it already exists. See the cp manual page for more details.
294
300
$(QUIET)$(RM) -Rf $@
301
$(QUIET)$(CP) -RPf -- $< $@
298
304
INSTALLS += GuestDrivers-src
299
GuestDrivers-src_INST = bin/additions/src/
305
GuestDrivers-src_INST = $(INST_ADDITIONS)src/
300
306
GuestDrivers-src_MODE = a+r,u+w
301
307
GuestDrivers-src_SOURCES = Makefile
304
310
INSTALLS += lnx_add_inst-exec
305
lnx_add_inst-exec_INST = $(subst $(PATH_TARGET),obj,$(VBOX_LNX_ADD_INST_MOD_DIR))
306
lnx_add_inst-exec_MODE = a+rx,u+w
307
lnx_add_inst-exec_SOURCES = \
311
lnx_add_inst-exec_INST = $(VBOX_LNX_ADD_INST_MOD_DIR)
312
lnx_add_inst-exec_INSTTYPE = stage
313
lnx_add_inst-exec_EXEC_SOURCES = \
308
314
$(VBOX_REL_X11_ADD_INST)98vboxadd-xclient \
309
315
$(VBOX_REL_X11_ADD_INST)x11config.sh
312
318
INSTALLS += lnx_add_inst-noexec
313
lnx_add_inst-noexec_INST = $(subst $(PATH_TARGET),obj,$(VBOX_LNX_ADD_INST_SHARE_DIR)$(VBOX_LNX_ADD_PACKAGE_NAME))/
314
lnx_add_inst-noexec_MODE = a+r,u+w
315
lnx_add_inst-noexec_SOURCES = \
319
lnx_add_inst-noexec_INST = $(VBOX_LNX_ADD_INST_SHARE_DIR)$(VBOX_LNX_ADD_PACKAGE_NAME)/
320
lnx_add_inst-noexec_INSTTYPE = stage
321
lnx_add_inst-noexec_SOURCES = \
316
322
$(VBOX_REL_X11_ADD_INST)vboxclient.desktop \
317
323
$(VBOX_REL_X11_ADD_INST)vboxvideo.ids \
318
324
$(VBOX_REL_X11_ADD_INST)50-vboxmouse.conf \
320
326
$(VBOX_REL_LNX_ADD_INST)90-vboxguest.fdi
322
328
INSTALLS += lnx_add_inst-license
323
lnx_add_inst-license_INST = $(subst $(PATH_TARGET),obj,$(VBOX_LNX_ADD_INST_OUT_DIR))
324
lnx_add_inst-license_MODE = a+r,u+w
325
lnx_add_inst-license_SOURCES = \
329
lnx_add_inst-license_INST = $(VBOX_LNX_ADD_INST_OUT_DIR)
330
lnx_add_inst-license_INSTTYPE = stage
331
lnx_add_inst-license_SOURCES = \
326
332
$(VBOX_BRAND_LICENSE_TXT)=>LICENSE
333
339
INSTALLS += LnxAdd-scripts
334
LnxAdd-scripts_INST = $(subst $(PATH_TARGET),obj,$(VBOX_LNX_ADD_INST_STAGE_DIR))
335
LnxAdd-scripts_MODE = a+rx,u+w
336
LnxAdd-scripts_SOURCES = \
340
LnxAdd-scripts_INST = $(VBOX_LNX_ADD_INST_STAGE_DIR)
341
LnxAdd-scripts_INSTTYPE = stage
342
LnxAdd-scripts_SOURCES = \
343
$(VBOX_REL_LNX_ADD_INST)deffiles
344
LnxAdd-scripts_EXEC_SOURCES = \
337
345
$(VBOX_REL_LNX_INST_SRC)routines.sh \
338
346
$(VBOX_REL_LNX_ADD_INST)vboxadd.sh=>vboxadd \
339
347
$(VBOX_REL_LNX_ADD_INST)vboxadd-service.sh=>vboxadd-service \
340
348
$(VBOX_REL_LNX_ADD_INST)vboxadd-x11.sh=>vboxadd-x11 \
341
$(VBOX_REL_LNX_ADD_INST)deffiles
347
354
INSTALLS += LnxAdd-Nostrip-Bin
348
LnxAdd-Nostrip-Bin_INST = $(subst $(PATH_TARGET),obj,$(VBOX_LNX_ADD_INST_BIN_DIR))
349
LnxAdd-Nostrip-Bin_MODE = a+rx,u+w
350
LnxAdd-Nostrip-Bin_SOURCES = \
355
LnxAdd-Nostrip-Bin_INST = $(VBOX_LNX_ADD_INST_BIN_DIR)
356
LnxAdd-Nostrip-Bin_INSTTYPE = stage
357
LnxAdd-Nostrip-Bin_EXEC_SOURCES = \
351
358
$(VBOX_REL_X11_ADD_INST)98vboxadd-xclient=>VBoxClient-all
355
362
# And the init scripts
357
364
INSTALLS += LnxAdd-init-scripts
358
LnxAdd-init-scripts_INST = $(INST_ADDITIONS)
359
LnxAdd-init-scripts_MODE = a+rx,u+w
360
LnxAdd-init-scripts_SOURCES = \
365
LnxAdd-init-scripts_INST = $(INST_ADDITIONS)
366
LnxAdd-init-scripts_EXEC_SOURCES = \
361
367
$(foreach i,$(VBOX_LNX_ADD_INIT), installer/$(i).sh=>$(i))
364
370
# this file needs editing before it can be included in the generic installer.
365
371
$(VBOX_LNX_ADD_INST_STAGE_DIR)install.sh: \
366
$(VBOX_PATH_LNX_INST_SRC)run-inst.sh | $$(dir $$@)
372
$(VBOX_PATH_LNX_INST_SRC)run-inst.sh | $$(dir $$@)
368
-e "s;_VERSION_;$(VBOX_VERSION_STRING);g" \
369
-e "s;_PACKAGE_NAME_;VirtualBox Guest Additions;g" \
370
-e "s;_PACKAGE_;VBoxGuestAdditions;g" \
371
-e "s;_VERSION_;$(VBOX_VERSION_STRING);g" \
372
-e "s;_BUILD_;$(shell date);g" \
373
-e "s;_OSE_;$(VBOX_OSE);g" \
374
-e "s;_BUILDTYPE_;$(KBUILD_TYPE);g" \
375
-e "s;_ARCH_;$(KBUILD_TARGET_ARCH);g" \
376
-e "s;_UNINSTALL_SCRIPTS_;vboxadd-x11 vboxadd-timesync vboxadd-service vboxadd;g" \
377
--output $(VBOX_LNX_ADD_INST_OUT_DIR)install.sh \
379
$(QUIET)$(INSTALL) -m 0755 $(VBOX_LNX_ADD_INST_OUT_DIR)install.sh $@
380
$(QUIET)$(RM) $(VBOX_LNX_ADD_INST_OUT_DIR)install.sh
375
-e "s;_VERSION_;$(VBOX_VERSION_STRING);g" \
376
-e "s;_PACKAGE_NAME_;VirtualBox Guest Additions;g" \
377
-e "s;_PACKAGE_;VBoxGuestAdditions;g" \
378
-e "s;_VERSION_;$(VBOX_VERSION_STRING);g" \
379
-e "s;_BUILD_;$(shell date);g" \
380
-e "s;_OSE_;$(VBOX_OSE);g" \
381
-e "s;_BUILDTYPE_;$(KBUILD_TYPE);g" \
382
-e "s;_ARCH_;$(KBUILD_TARGET_ARCH);g" \
383
-e "s;_UNINSTALL_SCRIPTS_;vboxadd-x11 vboxadd-timesync vboxadd-service vboxadd;g" \
386
$(QUIET)$(CHMOD) 0755 $@
382
388
$(VBOX_LNX_ADD_INST_OUT_DIR)install.sh \
383
389
$(VBOX_LNX_ADD_INST_STAGE_DIR)install.sh
389
395
# All the files that go into our archive
390
396
VBOX_LNX_ADD_ARCH_FILES = \
391
$(INSTARGET_lnx_add_inst-noexec) \
392
$(INSTARGET_lnx_add_inst-exec) \
393
$(INSTARGET_lnx_add_inst-license) \
394
$(INSTARGET_LnxAddTest-src) \
395
$(INSTARGET_LnxAddDRM-src) \
396
$(VBOX_LNX_ADD_INST_FILES)
397
$(lnx_add_inst-noexec_2_STAGE_TARGETS) \
398
$(lnx_add_inst-exec_2_STAGE_TARGETS) \
399
$(lnx_add_inst-license_2_STAGE_TARGETS) \
400
$(VBOX_LNX_ADD_INST_FILES) \
401
$(VBOX_LNX_ADD_INST_DIRS)
399
404
# .tar.bz2 for converting into .run
448
453
# Note that $(PATH_SUB_CURRENT) was changed by subfooter.kmk above and
449
454
# any references should be made via variables assigned a know value via := .
451
$(PATH_BIN)/additions/VBoxLinuxAdditions.run: \
456
$(PATH_STAGE_BIN)/additions/VBoxLinuxAdditions.run: \
452
457
$(VBOX_LNX_ADD_ARCHIVES) \
453
458
$(VBOX_LNX_ADD_INST_STAGE_DIR)install.sh \
454
$$(INSTARGET_LnxAdd-scripts) \
459
$$(LnxAdd-scripts_2_STAGE_TARGETS) \
455
460
$(VBOX_VERSION_STAMP)
456
461
# Remove any archives left over from previous builds so that they don't
457
462
# end up in our installer as well.