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 3631fabce7SPedro GiffuniCUSTOM_IMAGE_SETS=hicontrast industrial tango classic 37cdf0e10cSrcweirCUSTOM_IMAGES+=$(foreach,i,$(CUSTOM_IMAGE_SETS) images_$i) 38cdf0e10cSrcweirCUSTOM_PREFERRED_FALLBACK_1*=-c $(SOLARSRC)$/ooo_custom_images$/tango 39cdf0e10cSrcweirCUSTOM_PREFERRED_FALLBACK_2*=-c $(SOLARSRC)$/ooo_custom_images$/industrial 40cdf0e10cSrcweir 41cdf0e10cSrcweirCLASSIC_TARBALL=$(SOLARSRC)$/ooo_custom_images$/classic/classic_images.tar.gz 42cdf0e10cSrcweir 43cdf0e10cSrcweirALLTAR : $(IMAGES) $(CUSTOM_IMAGES) $(COMMONBIN)$/images_brand.zip 44cdf0e10cSrcweir 45cdf0e10cSrcweir$(IMAGES) $(CUSTOM_IMAGES) : $(SORTED_LIST) 46cdf0e10cSrcweir 47cdf0e10cSrcweir$(SORTED_LIST) : image-sort.lst 48cdf0e10cSrcweir +-$(MKDIR) $(RES)$/img 49cdf0e10cSrcweir +$(PERL) $(SOLARENV)$/bin$/image-sort.pl image-sort.lst $(SOLARXMLDIR) $@ 50cdf0e10cSrcweir 51cdf0e10cSrcweir$(RES)$/img$/commandimagelist.ilst .PHONY : $(SORTED_LIST) 52cdf0e10cSrcweir @@-$(MKDIR) $(RES)$/img 53cdf0e10cSrcweir#+-$(RM) $@ $@.$(INPATH) 54cdf0e10cSrcweir $(FIND) $(SOLARSRC)$/$(RSCDEFIMG)/res/commandimagelist -name "*.png" | sed "s#$(SOLARSRC)$/$(RSCDEFIMG)/res#%GLOBALRES%#" | $(PERL) $(SOLARENV)$/bin$/sort.pl > $@.$(INPATH) 55cdf0e10cSrcweir $(PERL) $(SOLARENV)$/bin$/diffmv.pl $@.$(INPATH) $@ 56cdf0e10cSrcweir 57cdf0e10cSrcweir$(COMMONBIN)$/images.zip .PHONY: $(RES)$/img$/commandimagelist.ilst 58cdf0e10cSrcweir $(PERL) $(SOLARENV)$/bin$/packimages.pl -g $(SOLARSRC)$/$(RSCDEFIMG) -m $(SOLARSRC)$/$(RSCDEFIMG) -c $(RSCCUSTOMIMG) -l $(SOLARCOMMONRESDIR)$/img -s $(SORTED_LIST) -l $(RES)$/img -o $@ 59cdf0e10cSrcweir 60cdf0e10cSrcweirimages_% : $(RES)$/img$/commandimagelist.ilst 61cdf0e10cSrcweir $(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 62cdf0e10cSrcweir 63cdf0e10cSrcweir# make sure to have one to keep packing happy 64cdf0e10cSrcweir$(COMMONBIN)$/images_brand.zip: 65cdf0e10cSrcweir @$(TOUCH) $@ 66cdf0e10cSrcweir 6725d782d7SPedro Giffuni# generate the HiContrast icon set 6825d782d7SPedro Giffuni$(MISC)$/hicontrast.flag .PHONY : 69*61aaf8b6SYuri Dario.IF "$(GUI)"=="OS2" 70*61aaf8b6SYuri Dario touch $(MISC)$/hicontrast.flag 71*61aaf8b6SYuri Dario.ELSE 7225d782d7SPedro Giffuni $(PERL) $(SOLARENV)$/bin$/hicontrast-to-theme.pl $(SOLARSRC)$/default_images $(MISC)$/hicontrast && $(TOUCH) $@ 73*61aaf8b6SYuri Dario.ENDIF 7425d782d7SPedro Giffuni 75cdf0e10cSrcweir# unpack the classic icon set 76cdf0e10cSrcweir$(MISC)$/classic.flag : $(CLASSIC_TARBALL) 77*61aaf8b6SYuri Dario.IF "$(GUI)"=="OS2" 78*61aaf8b6SYuri Dario cd $(MISC) && tar zxf $(CLASSIC_TARBALL) && $(TOUCH) $(@:f) 79*61aaf8b6SYuri Dario.ELSE 80cdf0e10cSrcweir cd $(MISC) && gunzip -c $(CLASSIC_TARBALL) | ( tar -xf - ) && $(TOUCH) $(@:f) 81*61aaf8b6SYuri Dario.ENDIF 82cdf0e10cSrcweir.IF "$(GUI)"=="UNX" 83cdf0e10cSrcweir chmod -R g+w $(MISC)$/classic 84cdf0e10cSrcweir.ENDIF 85cdf0e10cSrcweir @$(TYPE) $@ || echo "ERROR: unpacking $(CLASSIC_TARBALL) failed" 86cdf0e10cSrcweir 87cdf0e10cSrcweir# dependencies 88cdf0e10cSrcweirimages_hicontrast : $(MISC)$/hicontrast.flag $(RES)$/img$/commandimagelist.ilst 89cdf0e10cSrcweir 90cdf0e10cSrcweirimages_crystal : $(MISC)$/crystal.flag $(RES)$/img$/commandimagelist.ilst 91cdf0e10cSrcweir 92cdf0e10cSrcweirimages_classic : $(MISC)$/classic.flag $(RES)$/img$/commandimagelist.ilst 93cdf0e10cSrcweir 94