17871dc3eSAndrew Rist#************************************************************** 2*ecb32f65Smseidel# 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 10*ecb32f65Smseidel# 117871dc3eSAndrew Rist# http://www.apache.org/licenses/LICENSE-2.0 12*ecb32f65Smseidel# 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. 19*ecb32f65Smseidel# 207871dc3eSAndrew Rist#************************************************************** 217871dc3eSAndrew Rist 227871dc3eSAndrew Rist 23*ecb32f65Smseidel 24cdf0e10cSrcweirPRJ=.. 25cdf0e10cSrcweirPRJNAME=packimages 26cdf0e10cSrcweirTARGET=packimages 27cdf0e10cSrcweir 28*ecb32f65Smseidel.INCLUDE: settings.mk 29cdf0e10cSrcweir# point to an existing directory as default that poses no threat 30cdf0e10cSrcweir# to a "find" that looks for "*.png" 31cdf0e10cSrcweirRSCCUSTOMIMG*=$(PRJ) 32cdf0e10cSrcweir.INCLUDE: target.mk 33cdf0e10cSrcweir 347d4f049eSAriel Constenla-Haile 357d4f049eSAriel Constenla-Haile.IF "$(VERBOSE_PACKIMG)"=="TRUE" 367d4f049eSAriel Constenla-HaileVERBOSESWITCH=-vv 377d4f049eSAriel Constenla-Haile.ELIF "$(VERBOSE)"=="TRUE" 387d4f049eSAriel Constenla-HaileVERBOSESWITCH=-v 397d4f049eSAriel Constenla-Haile.ELSE 407d4f049eSAriel Constenla-HaileVERBOSESWITCH= 417d4f049eSAriel Constenla-Haile.ENDIF 427d4f049eSAriel Constenla-Haile 43cdf0e10cSrcweirIMAGES := $(COMMONBIN)$/images.zip 44cdf0e10cSrcweirSORTED_LIST=$(RES)$/img$/sorted.lst 45*ecb32f65Smseidel# Custom sets, at 24x24 & 16x16 fall-back to Galaxy preferentially 46df478df5SHerbert DürrCUSTOM_IMAGE_SETS=hicontrast industrial classic 47cdf0e10cSrcweirCUSTOM_IMAGES+=$(foreach,i,$(CUSTOM_IMAGE_SETS) images_$i) 48*ecb32f65SmseidelCUSTOM_PREFERRED_FALLBACK_1*=-c $(SOLARSRC)$/default_images$/ 49cdf0e10cSrcweir 50cdf0e10cSrcweirCLASSIC_TARBALL=$(SOLARSRC)$/ooo_custom_images$/classic/classic_images.tar.gz 51cdf0e10cSrcweir 52cdf0e10cSrcweirALLTAR : $(IMAGES) $(CUSTOM_IMAGES) $(COMMONBIN)$/images_brand.zip 53cdf0e10cSrcweir 54cdf0e10cSrcweir$(IMAGES) $(CUSTOM_IMAGES) : $(SORTED_LIST) 55cdf0e10cSrcweir 56cdf0e10cSrcweir$(SORTED_LIST) : image-sort.lst 57cdf0e10cSrcweir +-$(MKDIR) $(RES)$/img 58cdf0e10cSrcweir +$(PERL) $(SOLARENV)$/bin$/image-sort.pl image-sort.lst $(SOLARXMLDIR) $@ 59cdf0e10cSrcweir 60cdf0e10cSrcweir$(RES)$/img$/commandimagelist.ilst .PHONY : $(SORTED_LIST) 61cdf0e10cSrcweir @@-$(MKDIR) $(RES)$/img 62cdf0e10cSrcweir#+-$(RM) $@ $@.$(INPATH) 63cdf0e10cSrcweir $(FIND) $(SOLARSRC)$/$(RSCDEFIMG)/res/commandimagelist -name "*.png" | sed "s#$(SOLARSRC)$/$(RSCDEFIMG)/res#%GLOBALRES%#" | $(PERL) $(SOLARENV)$/bin$/sort.pl > $@.$(INPATH) 64cdf0e10cSrcweir $(PERL) $(SOLARENV)$/bin$/diffmv.pl $@.$(INPATH) $@ 65cdf0e10cSrcweir 66cdf0e10cSrcweir$(COMMONBIN)$/images.zip .PHONY: $(RES)$/img$/commandimagelist.ilst 677d4f049eSAriel Constenla-Haile $(PERL) $(SOLARENV)$/bin$/packimages.pl $(VERBOSESWITCH) -g $(SOLARSRC)$/$(RSCDEFIMG) -m $(SOLARSRC)$/$(RSCDEFIMG) -c $(RSCCUSTOMIMG) -l $(SOLARCOMMONRESDIR)$/img -s $(SORTED_LIST) -l $(RES)$/img -o $@ 68cdf0e10cSrcweir 69cdf0e10cSrcweirimages_% : $(RES)$/img$/commandimagelist.ilst 707d4f049eSAriel Constenla-Haile $(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 71cdf0e10cSrcweir 72cdf0e10cSrcweir# make sure to have one to keep packing happy 73cdf0e10cSrcweir$(COMMONBIN)$/images_brand.zip: 74cdf0e10cSrcweir @$(TOUCH) $@ 75cdf0e10cSrcweir 7625d782d7SPedro Giffuni# generate the HiContrast icon set 7725d782d7SPedro Giffuni$(MISC)$/hicontrast.flag .PHONY : 7825d782d7SPedro Giffuni $(PERL) $(SOLARENV)$/bin$/hicontrast-to-theme.pl $(SOLARSRC)$/default_images $(MISC)$/hicontrast && $(TOUCH) $@ 7925d782d7SPedro Giffuni 80cdf0e10cSrcweir# unpack the classic icon set 81cdf0e10cSrcweir$(MISC)$/classic.flag : $(CLASSIC_TARBALL) 8261aaf8b6SYuri Dario.IF "$(GUI)"=="OS2" 83*ecb32f65Smseidel cd $(MISC) && tar zxf $(CLASSIC_TARBALL) && $(TOUCH) $(@:f) 8461aaf8b6SYuri Dario.ELSE 85*ecb32f65Smseidel cd $(MISC) && gunzip -c $(CLASSIC_TARBALL) | ( tar -xf - ) && $(TOUCH) $(@:f) 8661aaf8b6SYuri Dario.ENDIF 87cdf0e10cSrcweir.IF "$(GUI)"=="UNX" 88cdf0e10cSrcweir chmod -R g+w $(MISC)$/classic 89cdf0e10cSrcweir.ENDIF 90*ecb32f65Smseidel @$(TYPE) $@ || echo "ERROR: unpacking $(CLASSIC_TARBALL) failed" 91cdf0e10cSrcweir 92cdf0e10cSrcweir# dependencies 93cdf0e10cSrcweirimages_hicontrast : $(MISC)$/hicontrast.flag $(RES)$/img$/commandimagelist.ilst 94cdf0e10cSrcweir 95cdf0e10cSrcweirimages_classic : $(MISC)$/classic.flag $(RES)$/img$/commandimagelist.ilst 96cdf0e10cSrcweir 97