1cdf0e10cSrcweir#************************************************************************* 2cdf0e10cSrcweir# 3cdf0e10cSrcweir# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4cdf0e10cSrcweir# 5cdf0e10cSrcweir# Copyright 2000, 2010 Oracle and/or its affiliates. 6cdf0e10cSrcweir# 7cdf0e10cSrcweir# OpenOffice.org - a multi-platform office productivity suite 8cdf0e10cSrcweir# 9cdf0e10cSrcweir# This file is part of OpenOffice.org. 10cdf0e10cSrcweir# 11cdf0e10cSrcweir# OpenOffice.org is free software: you can redistribute it and/or modify 12cdf0e10cSrcweir# it under the terms of the GNU Lesser General Public License version 3 13cdf0e10cSrcweir# only, as published by the Free Software Foundation. 14cdf0e10cSrcweir# 15cdf0e10cSrcweir# OpenOffice.org is distributed in the hope that it will be useful, 16cdf0e10cSrcweir# but WITHOUT ANY WARRANTY; without even the implied warranty of 17cdf0e10cSrcweir# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18cdf0e10cSrcweir# GNU Lesser General Public License version 3 for more details 19cdf0e10cSrcweir# (a copy is included in the LICENSE file that accompanied this code). 20cdf0e10cSrcweir# 21cdf0e10cSrcweir# You should have received a copy of the GNU Lesser General Public License 22cdf0e10cSrcweir# version 3 along with OpenOffice.org. If not, see 23cdf0e10cSrcweir# <http://www.openoffice.org/license.html> 24cdf0e10cSrcweir# for a copy of the LGPLv3 License. 25cdf0e10cSrcweir# 26cdf0e10cSrcweir#************************************************************************* 27cdf0e10cSrcweirPRJ=.. 28cdf0e10cSrcweirPRJNAME=packimages 29cdf0e10cSrcweirTARGET=packimages 30cdf0e10cSrcweir 31cdf0e10cSrcweir.INCLUDE: settings.mk 32cdf0e10cSrcweir# point to an existing directory as default that poses no threat 33cdf0e10cSrcweir# to a "find" that looks for "*.png" 34cdf0e10cSrcweirRSCCUSTOMIMG*=$(PRJ) 35cdf0e10cSrcweir.INCLUDE: target.mk 36cdf0e10cSrcweir 37cdf0e10cSrcweirIMAGES := $(COMMONBIN)$/images.zip 38cdf0e10cSrcweirSORTED_LIST=$(RES)$/img$/sorted.lst 39cdf0e10cSrcweir# Custom sets, at 24x24 & 16x16 fall-back to industrial preferentially 40*b797cecfSPedro GiffuniCUSTOM_IMAGE_SETS=hicontrast industrial crystal tango classic 41cdf0e10cSrcweirCUSTOM_IMAGES+=$(foreach,i,$(CUSTOM_IMAGE_SETS) images_$i) 42cdf0e10cSrcweirCUSTOM_PREFERRED_FALLBACK_1*=-c $(SOLARSRC)$/ooo_custom_images$/tango 43cdf0e10cSrcweirCUSTOM_PREFERRED_FALLBACK_2*=-c $(SOLARSRC)$/ooo_custom_images$/industrial 44cdf0e10cSrcweir 45cdf0e10cSrcweirCRYSTAL_TARBALL=$(SOLARSRC)$/external_images$/ooo_crystal_images-1.tar.gz 46cdf0e10cSrcweirCLASSIC_TARBALL=$(SOLARSRC)$/ooo_custom_images$/classic/classic_images.tar.gz 47cdf0e10cSrcweir 48cdf0e10cSrcweirALLTAR : $(IMAGES) $(CUSTOM_IMAGES) $(COMMONBIN)$/images_brand.zip 49cdf0e10cSrcweir 50cdf0e10cSrcweir$(IMAGES) $(CUSTOM_IMAGES) : $(SORTED_LIST) 51cdf0e10cSrcweir 52cdf0e10cSrcweir$(SORTED_LIST) : image-sort.lst 53cdf0e10cSrcweir +-$(MKDIR) $(RES)$/img 54cdf0e10cSrcweir +$(PERL) $(SOLARENV)$/bin$/image-sort.pl image-sort.lst $(SOLARXMLDIR) $@ 55cdf0e10cSrcweir 56cdf0e10cSrcweir$(RES)$/img$/commandimagelist.ilst .PHONY : $(SORTED_LIST) 57cdf0e10cSrcweir @@-$(MKDIR) $(RES)$/img 58cdf0e10cSrcweir#+-$(RM) $@ $@.$(INPATH) 59cdf0e10cSrcweir $(FIND) $(SOLARSRC)$/$(RSCDEFIMG)/res/commandimagelist -name "*.png" | sed "s#$(SOLARSRC)$/$(RSCDEFIMG)/res#%GLOBALRES%#" | $(PERL) $(SOLARENV)$/bin$/sort.pl > $@.$(INPATH) 60cdf0e10cSrcweir $(PERL) $(SOLARENV)$/bin$/diffmv.pl $@.$(INPATH) $@ 61cdf0e10cSrcweir 62cdf0e10cSrcweir$(COMMONBIN)$/images.zip .PHONY: $(RES)$/img$/commandimagelist.ilst 63cdf0e10cSrcweir $(PERL) $(SOLARENV)$/bin$/packimages.pl -g $(SOLARSRC)$/$(RSCDEFIMG) -m $(SOLARSRC)$/$(RSCDEFIMG) -c $(RSCCUSTOMIMG) -l $(SOLARCOMMONRESDIR)$/img -s $(SORTED_LIST) -l $(RES)$/img -o $@ 64cdf0e10cSrcweir 65cdf0e10cSrcweirimages_% : $(RES)$/img$/commandimagelist.ilst 66cdf0e10cSrcweir $(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 67cdf0e10cSrcweir 68cdf0e10cSrcweir# make sure to have one to keep packing happy 69cdf0e10cSrcweir$(COMMONBIN)$/images_brand.zip: 70cdf0e10cSrcweir @$(TOUCH) $@ 71cdf0e10cSrcweir 72cdf0e10cSrcweir# generate the HiContrast icon set 73cdf0e10cSrcweir$(MISC)$/hicontrast.flag .PHONY : 74cdf0e10cSrcweir $(PERL) $(SOLARENV)$/bin$/hicontrast-to-theme.pl $(SOLARSRC)$/default_images $(MISC)$/hicontrast && $(TOUCH) $@ 75cdf0e10cSrcweir 76cdf0e10cSrcweir# unpack the Crystal icon set 77cdf0e10cSrcweir$(MISC)$/crystal.flag : $(CRYSTAL_TARBALL) 78cdf0e10cSrcweir cd $(MISC) && gzip -d -c $(CRYSTAL_TARBALL) | ( tar -xf - ) && $(TOUCH) $(@:f) 79cdf0e10cSrcweir.IF "$(GUI)"=="UNX" 80cdf0e10cSrcweir chmod -R g+w $(MISC)$/crystal 81cdf0e10cSrcweir.ENDIF 82cdf0e10cSrcweir @$(TYPE) $@ || echo "ERROR: unpacking $(CRYSTAL_TARBALL) failed" 83cdf0e10cSrcweir 84cdf0e10cSrcweir# unpack the classic icon set 85cdf0e10cSrcweir$(MISC)$/classic.flag : $(CLASSIC_TARBALL) 86cdf0e10cSrcweir cd $(MISC) && gunzip -c $(CLASSIC_TARBALL) | ( tar -xf - ) && $(TOUCH) $(@:f) 87cdf0e10cSrcweir.IF "$(GUI)"=="UNX" 88cdf0e10cSrcweir chmod -R g+w $(MISC)$/classic 89cdf0e10cSrcweir.ENDIF 90cdf0e10cSrcweir @$(TYPE) $@ || echo "ERROR: unpacking $(CLASSIC_TARBALL) failed" 91cdf0e10cSrcweir 92cdf0e10cSrcweir# dependencies 93cdf0e10cSrcweirimages_hicontrast : $(MISC)$/hicontrast.flag $(RES)$/img$/commandimagelist.ilst 94cdf0e10cSrcweir 95cdf0e10cSrcweirimages_crystal : $(MISC)$/crystal.flag $(RES)$/img$/commandimagelist.ilst 96cdf0e10cSrcweir 97cdf0e10cSrcweirimages_classic : $(MISC)$/classic.flag $(RES)$/img$/commandimagelist.ilst 98cdf0e10cSrcweir 99