summaryrefslogtreecommitdiff
path: root/solenv/gbuild/ZipPackage.mk
blob: bc016aed31266f5a71796980c580f85f4c53e35b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#

# ZipPackage class
# this is a bit of a hack, hopefully needed only temporarily because
# scp2 can easily deal with zip files but not so easily with 100s of
# individual files; ideally the Package itself should be sufficient.

# sigh... WTF does that scp2/installer look for these in bin and not pck???
gb_Zip_get_outdir_bin_target = $(OUTDIR)/bin/$(1).zip

define gb_ZipPackage_ZipPackage
$(call gb_Package_Package,$(1),$(2))
$(call gb_Zip_Zip_internal_nodeliver,$(1),$(WORKDIR)/Zip/$(1))
$(call gb_Package_get_target,$(1)) : $(call gb_Zip_get_outdir_bin_target,$(1))
$(call gb_Zip_get_outdir_bin_target,$(1)) : $(call gb_Zip_get_target,$(1))
	cp $$< $$@
$(call gb_Zip_get_outdir_bin_target,$(1)) :| $(dir $(call gb_Zip_get_outdir_bin_target,$(1))).dir
$(call gb_Package_get_clean_target,$(1)) : $(call gb_Zip_get_clean_target,$(1))
$(call gb_ZipPackage_get_target,$(1)) : $(call gb_Package_get_target,$(1))
$(call gb_Helper_make_userfriendly_targets,$(1),ZipPackage)
$(call gb_Deliver_add_deliverable,$(call gb_Zip_get_outdir_bin_target,$(1)),$(call gb_Zip_get_target,$(1)),$(1))

endef

# sadly Package delivers to inc/ but ODK path is include/ so need to
# copy files twice
# $(1) package
# $(2) dir in package
# $(3) dir in zip
# $(4) file list
define gb_ZipPackage_add_files
$(call gb_Package_add_files,$(1),$(2),$(4))
$(foreach file,$(4),$(call gb_Zip_add_file,$(1),$(3)/$(notdir $(file)),$(gb_Package_SOURCEDIR_$(1))/$(file)))

endef

# $(1) package
# $(2) file in package
# $(3) file in zip
# $(4) file source
define gb_ZipPackage_add_file
$(call gb_Package_add_file,$(1),$(2),$(4))
$(call gb_Zip_add_file,$(1),$(3),$(gb_Package_SOURCEDIR_$(1))/$(4))

endef

# vim: set noet sw=4 ts=4: