sw_redlinehide_4b: adapt FindAttrImpl()
[LibreOffice.git] / postprocess / CustomTarget_images.mk
blob0ecd76d37035d32f0b6c8e01e9d43e089fca5e38
1 # -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
4 # This file is part of the LibreOffice project.
6 # This Source Code Form is subject to the terms of the Mozilla Public
7 # License, v. 2.0. If a copy of the MPL was not distributed with this
8 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
11 $(eval $(call gb_CustomTarget_CustomTarget,postprocess/images))
13 packimages_DIR := $(call gb_CustomTarget_get_workdir,postprocess/images)
15 $(eval $(call gb_CustomTarget_register_targets,postprocess/images,\
16 $(foreach theme,$(WITH_THEMES),images_$(theme).zip) \
17 $(foreach theme,$(WITH_THEMES),$(theme)_links.txt) \
18 commandimagelist.ilst \
19 sourceimagelist.ilst \
20 sorted.lst \
23 $(packimages_DIR)/images.zip : DEFAULT_THEME := $(true)
24 $(packimages_DIR)/images_%.zip : DEFAULT_THEME :=
26 $(packimages_DIR)/%_links.txt :
27 @if test -f "$(SRCDIR)/icon-themes/$*/links.txt"; then \
28 cp "$(SRCDIR)/icon-themes/$*/links.txt" $@.tmp ; \
29 else \
30 THEME_FILE="$(SRCDIR)/icon-themes/$(subst _svg,,$*)/links.txt" ; \
31 if test -f "$${THEME_FILE}"; then \
32 sed 's/\.png/\.svg/g' "$${THEME_FILE}" > $@.tmp ; \
33 fi ; \
34 THEME_FILE="$(SRCDIR)/icon-themes/$(subst _dark,,$*)/links.txt" ; \
35 if test -f "$${THEME_FILE}"; then \
36 cp "$${THEME_FILE}" $@.tmp ; \
37 fi ; \
39 $(call gb_Helper_replace_if_different_and_touch,$@.tmp,$@)
41 $(packimages_DIR)/images_%.zip : \
42 $(packimages_DIR)/sorted.lst \
43 $(packimages_DIR)/commandimagelist.ilst \
44 $(packimages_DIR)/sourceimagelist.ilst \
45 $(SRCDIR)/wizards/source/imagelists/imagelists.ilst \
46 $(packimages_DIR)/%_links.txt \
47 $(call gb_Helper_get_imagelists) \
48 | $(call gb_ExternalExecutable_get_dependencies,python)
49 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),PRL,2)
50 $(call gb_Helper_abbreviate_dirs, \
51 ILSTFILE=$(call var2file,$(shell $(gb_MKTEMP)),100,$(filter %.ilst,$^)) && \
52 $(call gb_ExternalExecutable_get_command,python) $(SRCDIR)/solenv/bin/pack_images.py \
53 $(if $(DEFAULT_THEME),\
54 -g $(packimages_DIR) -m $(packimages_DIR) -c $(packimages_DIR),\
55 -g $(SRCDIR)/icon-themes/$* -m $(SRCDIR)/icon-themes/$* -c $(SRCDIR)/icon-themes/$* \
56 ) \
57 -l $${ILSTFILE} \
58 -L $(packimages_DIR)/$*_links.txt \
59 -s $< -o $@ \
60 $(if $(findstring s,$(MAKEFLAGS)),> /dev/null) && \
61 rm -rf $${ILSTFILE})
63 # turn the #defines foo "resource.png" of hlst into the final ilst format
64 $(packimages_DIR)/sourceimagelist.ilst : \
65 $(SRCDIR)/avmedia/inc/bitmaps.hlst \
66 $(SRCDIR)/basctl/inc/bitmaps.hlst \
67 $(SRCDIR)/connectivity/inc/bitmaps.hlst \
68 $(SRCDIR)/cui/inc/bitmaps.hlst \
69 $(SRCDIR)/chart2/inc/bitmaps.hlst \
70 $(SRCDIR)/dbaccess/inc/bitmaps.hlst \
71 $(SRCDIR)/desktop/inc/bitmaps.hlst \
72 $(SRCDIR)/extensions/inc/bitmaps.hlst \
73 $(SRCDIR)/formula/inc/bitmaps.hlst \
74 $(SRCDIR)/fpicker/inc/bitmaps.hlst \
75 $(SRCDIR)/framework/inc/bitmaps.hlst \
76 $(SRCDIR)/reportdesign/inc/bitmaps.hlst \
77 $(SRCDIR)/sc/inc/bitmaps.hlst \
78 $(SRCDIR)/sd/inc/bitmaps.hlst \
79 $(SRCDIR)/sdext/inc/bitmaps.hlst \
80 $(SRCDIR)/sfx2/inc/bitmaps.hlst \
81 $(SRCDIR)/svtools/inc/bitmaps.hlst \
82 $(SRCDIR)/svx/inc/bitmaps.hlst \
83 $(SRCDIR)/sw/inc/bitmaps.hlst \
84 $(SRCDIR)/vcl/inc/bitmaps.hlst \
85 $(SRCDIR)/xmlsecurity/inc/bitmaps.hlst
86 grep res $^ | cut -d'"' -f2 | sed "s/^/%MODULE%\//" | sed "s/%MODULE%.res/%GLOBALRES%/g" > $@.png
87 sed 's/\.png/\.svg/g' $@.png > $@.svg
88 cat $@.png $@.svg > $@
90 # commandimagelist.ilst and sorted.lst are phony to rebuild everything each time
91 .PHONY : $(packimages_DIR)/commandimagelist.ilst $(packimages_DIR)/sorted.lst
93 $(packimages_DIR)/commandimagelist.ilst :
94 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),PRL,1)
95 $(call gb_Helper_abbreviate_dirs, \
96 $(FIND) $(SRCDIR)/icon-themes -name "*.png" -o -name "*.svg" | \
97 grep -e '/cmd/' | sed 's#^.*/icon-themes/[^/]*##' | $(SORT) | uniq | \
98 sed "s#^#%MODULE%#" | \
99 LC_ALL=C $(SORT) > $@.tmp && \
100 $(call gb_Helper_replace_if_different_and_touch,$@.tmp,$@))
102 $(packimages_DIR)/sorted.lst : \
103 $(SRCDIR)/postprocess/packimages/image-sort.lst \
104 $(call gb_Postprocess_get_target,AllUIConfigs)
105 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),PRL,1)
106 $(call gb_Helper_abbreviate_dirs, \
107 $(PERL) $(SRCDIR)/solenv/bin/image-sort.pl \
108 $< $(INSTROOT)/$(gb_UIConfig_INSTDIR) $@)
110 # vim: set noet sw=4 ts=4: