xref: /trunk/main/packimages/pack/makefile.mk (revision df478df5)
17871dc3eSAndrew Rist#**************************************************************
27871dc3eSAndrew Rist#
37871dc3eSAndrew Rist#  Licensed to the Apache Software Foundation (ASF) under one
47871dc3eSAndrew Rist#  or more contributor license agreements.  See the NOTICE file
57871dc3eSAndrew Rist#  distributed with this work for additional information
67871dc3eSAndrew Rist#  regarding copyright ownership.  The ASF licenses this file
77871dc3eSAndrew Rist#  to you under the Apache License, Version 2.0 (the
87871dc3eSAndrew Rist#  "License"); you may not use this file except in compliance
97871dc3eSAndrew Rist#  with the License.  You may obtain a copy of the License at
107871dc3eSAndrew Rist#
117871dc3eSAndrew Rist#    http://www.apache.org/licenses/LICENSE-2.0
127871dc3eSAndrew Rist#
137871dc3eSAndrew Rist#  Unless required by applicable law or agreed to in writing,
147871dc3eSAndrew Rist#  software distributed under the License is distributed on an
157871dc3eSAndrew Rist#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
167871dc3eSAndrew Rist#  KIND, either express or implied.  See the License for the
177871dc3eSAndrew Rist#  specific language governing permissions and limitations
187871dc3eSAndrew Rist#  under the License.
197871dc3eSAndrew Rist#
207871dc3eSAndrew Rist#**************************************************************
217871dc3eSAndrew Rist
227871dc3eSAndrew Rist
23cdf0e10cSrcweirPRJ=..
24cdf0e10cSrcweirPRJNAME=packimages
25cdf0e10cSrcweirTARGET=packimages
26cdf0e10cSrcweir
27cdf0e10cSrcweir.INCLUDE:  settings.mk
28cdf0e10cSrcweir# point to an existing directory as default that poses no threat
29cdf0e10cSrcweir# to a "find" that looks for "*.png"
30cdf0e10cSrcweirRSCCUSTOMIMG*=$(PRJ)
31cdf0e10cSrcweir.INCLUDE: target.mk
32cdf0e10cSrcweir
33cdf0e10cSrcweirIMAGES := $(COMMONBIN)$/images.zip
34cdf0e10cSrcweirSORTED_LIST=$(RES)$/img$/sorted.lst
35cdf0e10cSrcweir# Custom sets, at 24x24 & 16x16 fall-back to industrial preferentially
36*df478df5SHerbert DürrCUSTOM_IMAGE_SETS=hicontrast industrial classic
37cdf0e10cSrcweirCUSTOM_IMAGES+=$(foreach,i,$(CUSTOM_IMAGE_SETS) images_$i)
38*df478df5SHerbert DürrCUSTOM_PREFERRED_FALLBACK_1*=-c $(SOLARSRC)$/ooo_custom_images$/industrial
39cdf0e10cSrcweir
40cdf0e10cSrcweirCLASSIC_TARBALL=$(SOLARSRC)$/ooo_custom_images$/classic/classic_images.tar.gz
41cdf0e10cSrcweir
42cdf0e10cSrcweirALLTAR : $(IMAGES) $(CUSTOM_IMAGES) $(COMMONBIN)$/images_brand.zip
43cdf0e10cSrcweir
44cdf0e10cSrcweir$(IMAGES) $(CUSTOM_IMAGES) : $(SORTED_LIST)
45cdf0e10cSrcweir
46cdf0e10cSrcweir$(SORTED_LIST) : image-sort.lst
47cdf0e10cSrcweir	+-$(MKDIR) $(RES)$/img
48cdf0e10cSrcweir	+$(PERL) $(SOLARENV)$/bin$/image-sort.pl image-sort.lst $(SOLARXMLDIR) $@
49cdf0e10cSrcweir
50cdf0e10cSrcweir$(RES)$/img$/commandimagelist.ilst .PHONY : $(SORTED_LIST)
51cdf0e10cSrcweir	@@-$(MKDIR) $(RES)$/img
52cdf0e10cSrcweir#+-$(RM) $@ $@.$(INPATH)
53cdf0e10cSrcweir	$(FIND) $(SOLARSRC)$/$(RSCDEFIMG)/res/commandimagelist -name "*.png" | sed "s#$(SOLARSRC)$/$(RSCDEFIMG)/res#%GLOBALRES%#" | $(PERL) $(SOLARENV)$/bin$/sort.pl > $@.$(INPATH)
54cdf0e10cSrcweir	$(PERL) $(SOLARENV)$/bin$/diffmv.pl $@.$(INPATH) $@
55cdf0e10cSrcweir
56cdf0e10cSrcweir$(COMMONBIN)$/images.zip .PHONY: $(RES)$/img$/commandimagelist.ilst
57cdf0e10cSrcweir	$(PERL) $(SOLARENV)$/bin$/packimages.pl -g $(SOLARSRC)$/$(RSCDEFIMG) -m $(SOLARSRC)$/$(RSCDEFIMG) -c $(RSCCUSTOMIMG) -l $(SOLARCOMMONRESDIR)$/img -s $(SORTED_LIST) -l $(RES)$/img -o $@
58cdf0e10cSrcweir
59cdf0e10cSrcweirimages_% : $(RES)$/img$/commandimagelist.ilst
60cdf0e10cSrcweir	$(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
61cdf0e10cSrcweir
62cdf0e10cSrcweir# make sure to have one to keep packing happy
63cdf0e10cSrcweir$(COMMONBIN)$/images_brand.zip:
64cdf0e10cSrcweir	@$(TOUCH) $@
65cdf0e10cSrcweir
6625d782d7SPedro Giffuni# generate the HiContrast icon set
6725d782d7SPedro Giffuni$(MISC)$/hicontrast.flag .PHONY :
6825d782d7SPedro Giffuni	$(PERL) $(SOLARENV)$/bin$/hicontrast-to-theme.pl $(SOLARSRC)$/default_images $(MISC)$/hicontrast && $(TOUCH) $@
6925d782d7SPedro Giffuni
70cdf0e10cSrcweir# unpack the classic icon set
71cdf0e10cSrcweir$(MISC)$/classic.flag : $(CLASSIC_TARBALL)
7261aaf8b6SYuri Dario.IF "$(GUI)"=="OS2"
7361aaf8b6SYuri Dario    cd $(MISC) && tar zxf $(CLASSIC_TARBALL) && $(TOUCH) $(@:f)
7461aaf8b6SYuri Dario.ELSE
75cdf0e10cSrcweir    cd $(MISC) && gunzip -c $(CLASSIC_TARBALL) | ( tar -xf - ) && $(TOUCH) $(@:f)
7661aaf8b6SYuri Dario.ENDIF
77cdf0e10cSrcweir.IF "$(GUI)"=="UNX"
78cdf0e10cSrcweir	chmod -R g+w $(MISC)$/classic
79cdf0e10cSrcweir.ENDIF
80cdf0e10cSrcweir    @$(TYPE) $@ || echo "ERROR: unpacking $(CLASSIC_TARBALL) failed"
81cdf0e10cSrcweir
82cdf0e10cSrcweir# dependencies
83cdf0e10cSrcweirimages_hicontrast : $(MISC)$/hicontrast.flag $(RES)$/img$/commandimagelist.ilst
84cdf0e10cSrcweir
85cdf0e10cSrcweirimages_crystal : $(MISC)$/crystal.flag $(RES)$/img$/commandimagelist.ilst
86cdf0e10cSrcweir
87cdf0e10cSrcweirimages_classic : $(MISC)$/classic.flag $(RES)$/img$/commandimagelist.ilst
88cdf0e10cSrcweir
89