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