1*7871dc3eSAndrew Rist#************************************************************** 2*7871dc3eSAndrew Rist# 3*7871dc3eSAndrew Rist# Licensed to the Apache Software Foundation (ASF) under one 4*7871dc3eSAndrew Rist# or more contributor license agreements. See the NOTICE file 5*7871dc3eSAndrew Rist# distributed with this work for additional information 6*7871dc3eSAndrew Rist# regarding copyright ownership. The ASF licenses this file 7*7871dc3eSAndrew Rist# to you under the Apache License, Version 2.0 (the 8*7871dc3eSAndrew Rist# "License"); you may not use this file except in compliance 9*7871dc3eSAndrew Rist# with the License. You may obtain a copy of the License at 10*7871dc3eSAndrew Rist# 11*7871dc3eSAndrew Rist# http://www.apache.org/licenses/LICENSE-2.0 12*7871dc3eSAndrew Rist# 13*7871dc3eSAndrew Rist# Unless required by applicable law or agreed to in writing, 14*7871dc3eSAndrew Rist# software distributed under the License is distributed on an 15*7871dc3eSAndrew Rist# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*7871dc3eSAndrew Rist# KIND, either express or implied. See the License for the 17*7871dc3eSAndrew Rist# specific language governing permissions and limitations 18*7871dc3eSAndrew Rist# under the License. 19*7871dc3eSAndrew Rist# 20*7871dc3eSAndrew Rist#************************************************************** 21*7871dc3eSAndrew Rist 22*7871dc3eSAndrew 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 : 6925d782d7SPedro Giffuni $(PERL) $(SOLARENV)$/bin$/hicontrast-to-theme.pl $(SOLARSRC)$/default_images $(MISC)$/hicontrast && $(TOUCH) $@ 7025d782d7SPedro Giffuni 71cdf0e10cSrcweir# unpack the classic icon set 72cdf0e10cSrcweir$(MISC)$/classic.flag : $(CLASSIC_TARBALL) 73cdf0e10cSrcweir cd $(MISC) && gunzip -c $(CLASSIC_TARBALL) | ( tar -xf - ) && $(TOUCH) $(@:f) 74cdf0e10cSrcweir.IF "$(GUI)"=="UNX" 75cdf0e10cSrcweir chmod -R g+w $(MISC)$/classic 76cdf0e10cSrcweir.ENDIF 77cdf0e10cSrcweir @$(TYPE) $@ || echo "ERROR: unpacking $(CLASSIC_TARBALL) failed" 78cdf0e10cSrcweir 79cdf0e10cSrcweir# dependencies 80cdf0e10cSrcweirimages_hicontrast : $(MISC)$/hicontrast.flag $(RES)$/img$/commandimagelist.ilst 81cdf0e10cSrcweir 82cdf0e10cSrcweirimages_crystal : $(MISC)$/crystal.flag $(RES)$/img$/commandimagelist.ilst 83cdf0e10cSrcweir 84cdf0e10cSrcweirimages_classic : $(MISC)$/classic.flag $(RES)$/img$/commandimagelist.ilst 85cdf0e10cSrcweir 86