xref: /aoo41x/main/packimages/pack/makefile.mk (revision 34cfd5f6)
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
23
24PRJ=..
25PRJNAME=packimages
26TARGET=packimages
27
28.INCLUDE: settings.mk
29# point to an existing directory as default that poses no threat
30# to a "find" that looks for "*.png"
31RSCCUSTOMIMG*=$(PRJ)
32.INCLUDE: target.mk
33
34
35.IF "$(VERBOSE_PACKIMG)"=="TRUE"
36VERBOSESWITCH=-vv
37.ELIF "$(VERBOSE)"=="TRUE"
38VERBOSESWITCH=-v
39.ELSE
40VERBOSESWITCH=
41.ENDIF
42
43IMAGES := $(COMMONBIN)$/images.zip
44SORTED_LIST=$(RES)$/img$/sorted.lst
45# Custom sets, at 24x24 & 16x16 fall-back to Galaxy preferentially
46CUSTOM_IMAGE_SETS=hicontrast industrial classic
47CUSTOM_IMAGES+=$(foreach,i,$(CUSTOM_IMAGE_SETS) images_$i)
48CUSTOM_PREFERRED_FALLBACK_1*=-c $(SOLARSRC)$/default_images$/
49
50CLASSIC_TARBALL=$(SOLARSRC)$/ooo_custom_images$/classic/classic_images.tar.gz
51
52ALLTAR : $(IMAGES) $(CUSTOM_IMAGES) $(COMMONBIN)$/images_brand.zip
53
54$(IMAGES) $(CUSTOM_IMAGES) : $(SORTED_LIST)
55
56$(SORTED_LIST) : image-sort.lst
57	+-$(MKDIR) $(RES)$/img
58	+$(PERL) $(SOLARENV)$/bin$/image-sort.pl image-sort.lst $(SOLARXMLDIR) $@
59
60$(RES)$/img$/commandimagelist.ilst .PHONY : $(SORTED_LIST)
61	@@-$(MKDIR) $(RES)$/img
62#+-$(RM) $@ $@.$(INPATH)
63	$(FIND) $(SOLARSRC)$/$(RSCDEFIMG)/res/commandimagelist -name "*.png" | sed "s#$(SOLARSRC)$/$(RSCDEFIMG)/res#%GLOBALRES%#" | $(PERL) $(SOLARENV)$/bin$/sort.pl > $@.$(INPATH)
64	$(PERL) $(SOLARENV)$/bin$/diffmv.pl $@.$(INPATH) $@
65
66$(COMMONBIN)$/images.zip .PHONY: $(RES)$/img$/commandimagelist.ilst
67	$(PERL) $(SOLARENV)$/bin$/packimages.pl $(VERBOSESWITCH) -g $(SOLARSRC)$/$(RSCDEFIMG) -m $(SOLARSRC)$/$(RSCDEFIMG) -c $(RSCCUSTOMIMG) -l $(SOLARCOMMONRESDIR)$/img -s $(SORTED_LIST) -l $(RES)$/img -o $@
68
69images_% : $(RES)$/img$/commandimagelist.ilst
70	$(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
71
72# make sure to have one to keep packing happy
73$(COMMONBIN)$/images_brand.zip:
74	@$(TOUCH) $@
75
76# generate the HiContrast icon set
77$(MISC)$/hicontrast.flag .PHONY :
78	$(PERL) $(SOLARENV)$/bin$/hicontrast-to-theme.pl $(SOLARSRC)$/default_images $(MISC)$/hicontrast && $(TOUCH) $@
79
80# unpack the classic icon set
81$(MISC)$/classic.flag : $(CLASSIC_TARBALL)
82.IF "$(GUI)"=="OS2"
83	cd $(MISC) && tar zxf $(CLASSIC_TARBALL) && $(TOUCH) $(@:f)
84.ELSE
85	cd $(MISC) && gunzip -c $(CLASSIC_TARBALL) | ( tar -xf - ) && $(TOUCH) $(@:f)
86.ENDIF
87.IF "$(GUI)"=="UNX"
88	chmod -R g+w $(MISC)$/classic
89.ENDIF
90	@$(TYPE) $@ || echo "ERROR: unpacking $(CLASSIC_TARBALL) failed"
91
92# dependencies
93images_hicontrast : $(MISC)$/hicontrast.flag $(RES)$/img$/commandimagelist.ilst
94
95images_classic : $(MISC)$/classic.flag $(RES)$/img$/commandimagelist.ilst
96
97