xref: /aoo4110/main/packimages/pack/makefile.mk (revision b1cdbd2c)
1#**************************************************************
2#
3#  Licensed to the Apache Software Foundation (ASF) under one
4#  or more contributor license agreements.  See the NOTICE file
5#  distributed with this work for additional information
6#  regarding copyright ownership.  The ASF licenses this file
7#  to you under the Apache License, Version 2.0 (the
8#  "License"); you may not use this file except in compliance
9#  with the License.  You may obtain a copy of the License at
10#
11#    http://www.apache.org/licenses/LICENSE-2.0
12#
13#  Unless required by applicable law or agreed to in writing,
14#  software distributed under the License is distributed on an
15#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16#  KIND, either express or implied.  See the License for the
17#  specific language governing permissions and limitations
18#  under the License.
19#
20#**************************************************************
21
22
23PRJ=..
24PRJNAME=packimages
25TARGET=packimages
26
27.INCLUDE:  settings.mk
28# point to an existing directory as default that poses no threat
29# to a "find" that looks for "*.png"
30RSCCUSTOMIMG*=$(PRJ)
31.INCLUDE: target.mk
32
33
34.IF "$(VERBOSE_PACKIMG)"=="TRUE"
35VERBOSESWITCH=-vv
36.ELIF "$(VERBOSE)"=="TRUE"
37VERBOSESWITCH=-v
38.ELSE
39VERBOSESWITCH=
40.ENDIF
41
42IMAGES := $(COMMONBIN)$/images.zip
43SORTED_LIST=$(RES)$/img$/sorted.lst
44# Custom sets, at 24x24 & 16x16 fall-back to industrial preferentially
45CUSTOM_IMAGE_SETS=hicontrast industrial classic
46CUSTOM_IMAGES+=$(foreach,i,$(CUSTOM_IMAGE_SETS) images_$i)
47CUSTOM_PREFERRED_FALLBACK_1*=-c $(SOLARSRC)$/ooo_custom_images$/industrial
48
49CLASSIC_TARBALL=$(SOLARSRC)$/ooo_custom_images$/classic/classic_images.tar.gz
50
51ALLTAR : $(IMAGES) $(CUSTOM_IMAGES) $(COMMONBIN)$/images_brand.zip
52
53$(IMAGES) $(CUSTOM_IMAGES) : $(SORTED_LIST)
54
55$(SORTED_LIST) : image-sort.lst
56	+-$(MKDIR) $(RES)$/img
57	+$(PERL) $(SOLARENV)$/bin$/image-sort.pl image-sort.lst $(SOLARXMLDIR) $@
58
59$(RES)$/img$/commandimagelist.ilst .PHONY : $(SORTED_LIST)
60	@@-$(MKDIR) $(RES)$/img
61#+-$(RM) $@ $@.$(INPATH)
62	$(FIND) $(SOLARSRC)$/$(RSCDEFIMG)/res/commandimagelist -name "*.png" | sed "s#$(SOLARSRC)$/$(RSCDEFIMG)/res#%GLOBALRES%#" | $(PERL) $(SOLARENV)$/bin$/sort.pl > $@.$(INPATH)
63	$(PERL) $(SOLARENV)$/bin$/diffmv.pl $@.$(INPATH) $@
64
65$(COMMONBIN)$/images.zip .PHONY: $(RES)$/img$/commandimagelist.ilst
66	$(PERL) $(SOLARENV)$/bin$/packimages.pl $(VERBOSESWITCH) -g $(SOLARSRC)$/$(RSCDEFIMG) -m $(SOLARSRC)$/$(RSCDEFIMG) -c $(RSCCUSTOMIMG) -l $(SOLARCOMMONRESDIR)$/img -s $(SORTED_LIST) -l $(RES)$/img -o $@
67
68images_% : $(RES)$/img$/commandimagelist.ilst
69	$(PERL) $(SOLARENV)$/bin$/packimages.pl $(VERBOSESWITCH) -g $(SOLARSRC)$/$(RSCDEFIMG) -m $(SOLARSRC)$/$(RSCDEFIMG) -c $(RSCCUSTOMIMG) -c $(SOLARSRC)$/ooo_custom_images$/$(@:s/images_//) -c $(MISC)$/$(@:s/images_//) $(CUSTOM_PREFERRED_FALLBACK_1) $(CUSTOM_PREFERRED_FALLBACK_2) -l $(SOLARCOMMONRESDIR)$/img -l $(RES)$/img -s $(SORTED_LIST) -o $(COMMONBIN)$/$@.zip
70
71# make sure to have one to keep packing happy
72$(COMMONBIN)$/images_brand.zip:
73	@$(TOUCH) $@
74
75# generate the HiContrast icon set
76$(MISC)$/hicontrast.flag .PHONY :
77	$(PERL) $(SOLARENV)$/bin$/hicontrast-to-theme.pl $(SOLARSRC)$/default_images $(MISC)$/hicontrast && $(TOUCH) $@
78
79# unpack the classic icon set
80$(MISC)$/classic.flag : $(CLASSIC_TARBALL)
81.IF "$(GUI)"=="OS2"
82    cd $(MISC) && tar zxf $(CLASSIC_TARBALL) && $(TOUCH) $(@:f)
83.ELSE
84    cd $(MISC) && gunzip -c $(CLASSIC_TARBALL) | ( tar -xf - ) && $(TOUCH) $(@:f)
85.ENDIF
86.IF "$(GUI)"=="UNX"
87	chmod -R g+w $(MISC)$/classic
88.ENDIF
89    @$(TYPE) $@ || echo "ERROR: unpacking $(CLASSIC_TARBALL) failed"
90
91# dependencies
92images_hicontrast : $(MISC)$/hicontrast.flag $(RES)$/img$/commandimagelist.ilst
93
94images_crystal : $(MISC)$/crystal.flag $(RES)$/img$/commandimagelist.ilst
95
96images_classic : $(MISC)$/classic.flag $(RES)$/img$/commandimagelist.ilst
97
98