xref: /aoo42x/main/packimages/pack/makefile.mk (revision dcefce6c)
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
33IMAGES := $(COMMONBIN)$/images.zip
34SORTED_LIST=$(RES)$/img$/sorted.lst
35# Custom sets, at 24x24 & 16x16 fall-back to industrial preferentially
36CUSTOM_IMAGE_SETS=hicontrast industrial tango classic
37CUSTOM_IMAGES+=$(foreach,i,$(CUSTOM_IMAGE_SETS) images_$i)
38CUSTOM_PREFERRED_FALLBACK_1*=-c $(SOLARSRC)$/ooo_custom_images$/tango
39CUSTOM_PREFERRED_FALLBACK_2*=-c $(SOLARSRC)$/ooo_custom_images$/industrial
40
41CLASSIC_TARBALL=$(SOLARSRC)$/ooo_custom_images$/classic/classic_images.tar.gz
42
43ALLTAR : $(IMAGES) $(CUSTOM_IMAGES) $(COMMONBIN)$/images_brand.zip
44
45$(IMAGES) $(CUSTOM_IMAGES) : $(SORTED_LIST)
46
47$(SORTED_LIST) : image-sort.lst
48	+-$(MKDIR) $(RES)$/img
49	+$(PERL) $(SOLARENV)$/bin$/image-sort.pl image-sort.lst $(SOLARXMLDIR) $@
50
51$(RES)$/img$/commandimagelist.ilst .PHONY : $(SORTED_LIST)
52	@@-$(MKDIR) $(RES)$/img
53#+-$(RM) $@ $@.$(INPATH)
54	$(FIND) $(SOLARSRC)$/$(RSCDEFIMG)/res/commandimagelist -name "*.png" | sed "s#$(SOLARSRC)$/$(RSCDEFIMG)/res#%GLOBALRES%#" | $(PERL) $(SOLARENV)$/bin$/sort.pl > $@.$(INPATH)
55	$(PERL) $(SOLARENV)$/bin$/diffmv.pl $@.$(INPATH) $@
56
57$(COMMONBIN)$/images.zip .PHONY: $(RES)$/img$/commandimagelist.ilst
58	$(PERL) $(SOLARENV)$/bin$/packimages.pl -g $(SOLARSRC)$/$(RSCDEFIMG) -m $(SOLARSRC)$/$(RSCDEFIMG) -c $(RSCCUSTOMIMG) -l $(SOLARCOMMONRESDIR)$/img -s $(SORTED_LIST) -l $(RES)$/img -o $@
59
60images_% : $(RES)$/img$/commandimagelist.ilst
61	$(PERL) $(SOLARENV)$/bin$/packimages.pl -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
62
63# make sure to have one to keep packing happy
64$(COMMONBIN)$/images_brand.zip:
65	@$(TOUCH) $@
66
67# generate the HiContrast icon set
68$(MISC)$/hicontrast.flag .PHONY :
69	$(PERL) $(SOLARENV)$/bin$/hicontrast-to-theme.pl $(SOLARSRC)$/default_images $(MISC)$/hicontrast && $(TOUCH) $@
70
71# unpack the classic icon set
72$(MISC)$/classic.flag : $(CLASSIC_TARBALL)
73.IF "$(GUI)"=="OS2"
74    cd $(MISC) && tar zxf $(CLASSIC_TARBALL) && $(TOUCH) $(@:f)
75.ELSE
76    cd $(MISC) && gunzip -c $(CLASSIC_TARBALL) | ( tar -xf - ) && $(TOUCH) $(@:f)
77.ENDIF
78.IF "$(GUI)"=="UNX"
79	chmod -R g+w $(MISC)$/classic
80.ENDIF
81    @$(TYPE) $@ || echo "ERROR: unpacking $(CLASSIC_TARBALL) failed"
82
83# dependencies
84images_hicontrast : $(MISC)$/hicontrast.flag $(RES)$/img$/commandimagelist.ilst
85
86images_crystal : $(MISC)$/crystal.flag $(RES)$/img$/commandimagelist.ilst
87
88images_classic : $(MISC)$/classic.flag $(RES)$/img$/commandimagelist.ilst
89
90