xref: /trunk/main/packimages/pack/makefile.mk (revision 7d4f049e)
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
33*7d4f049eSAriel Constenla-Haile
34*7d4f049eSAriel Constenla-Haile.IF "$(VERBOSE_PACKIMG)"=="TRUE"
35*7d4f049eSAriel Constenla-HaileVERBOSESWITCH=-vv
36*7d4f049eSAriel Constenla-Haile.ELIF "$(VERBOSE)"=="TRUE"
37*7d4f049eSAriel Constenla-HaileVERBOSESWITCH=-v
38*7d4f049eSAriel Constenla-Haile.ELSE
39*7d4f049eSAriel Constenla-HaileVERBOSESWITCH=
40*7d4f049eSAriel Constenla-Haile.ENDIF
41*7d4f049eSAriel Constenla-Haile
42cdf0e10cSrcweirIMAGES := $(COMMONBIN)$/images.zip
43cdf0e10cSrcweirSORTED_LIST=$(RES)$/img$/sorted.lst
44cdf0e10cSrcweir# Custom sets, at 24x24 & 16x16 fall-back to industrial preferentially
45df478df5SHerbert DürrCUSTOM_IMAGE_SETS=hicontrast industrial classic
46cdf0e10cSrcweirCUSTOM_IMAGES+=$(foreach,i,$(CUSTOM_IMAGE_SETS) images_$i)
47df478df5SHerbert DürrCUSTOM_PREFERRED_FALLBACK_1*=-c $(SOLARSRC)$/ooo_custom_images$/industrial
48cdf0e10cSrcweir
49cdf0e10cSrcweirCLASSIC_TARBALL=$(SOLARSRC)$/ooo_custom_images$/classic/classic_images.tar.gz
50cdf0e10cSrcweir
51cdf0e10cSrcweirALLTAR : $(IMAGES) $(CUSTOM_IMAGES) $(COMMONBIN)$/images_brand.zip
52cdf0e10cSrcweir
53cdf0e10cSrcweir$(IMAGES) $(CUSTOM_IMAGES) : $(SORTED_LIST)
54cdf0e10cSrcweir
55cdf0e10cSrcweir$(SORTED_LIST) : image-sort.lst
56cdf0e10cSrcweir	+-$(MKDIR) $(RES)$/img
57cdf0e10cSrcweir	+$(PERL) $(SOLARENV)$/bin$/image-sort.pl image-sort.lst $(SOLARXMLDIR) $@
58cdf0e10cSrcweir
59cdf0e10cSrcweir$(RES)$/img$/commandimagelist.ilst .PHONY : $(SORTED_LIST)
60cdf0e10cSrcweir	@@-$(MKDIR) $(RES)$/img
61cdf0e10cSrcweir#+-$(RM) $@ $@.$(INPATH)
62cdf0e10cSrcweir	$(FIND) $(SOLARSRC)$/$(RSCDEFIMG)/res/commandimagelist -name "*.png" | sed "s#$(SOLARSRC)$/$(RSCDEFIMG)/res#%GLOBALRES%#" | $(PERL) $(SOLARENV)$/bin$/sort.pl > $@.$(INPATH)
63cdf0e10cSrcweir	$(PERL) $(SOLARENV)$/bin$/diffmv.pl $@.$(INPATH) $@
64cdf0e10cSrcweir
65cdf0e10cSrcweir$(COMMONBIN)$/images.zip .PHONY: $(RES)$/img$/commandimagelist.ilst
66*7d4f049eSAriel 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 $@
67cdf0e10cSrcweir
68cdf0e10cSrcweirimages_% : $(RES)$/img$/commandimagelist.ilst
69*7d4f049eSAriel 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
70cdf0e10cSrcweir
71cdf0e10cSrcweir# make sure to have one to keep packing happy
72cdf0e10cSrcweir$(COMMONBIN)$/images_brand.zip:
73cdf0e10cSrcweir	@$(TOUCH) $@
74cdf0e10cSrcweir
7525d782d7SPedro Giffuni# generate the HiContrast icon set
7625d782d7SPedro Giffuni$(MISC)$/hicontrast.flag .PHONY :
7725d782d7SPedro Giffuni	$(PERL) $(SOLARENV)$/bin$/hicontrast-to-theme.pl $(SOLARSRC)$/default_images $(MISC)$/hicontrast && $(TOUCH) $@
7825d782d7SPedro Giffuni
79cdf0e10cSrcweir# unpack the classic icon set
80cdf0e10cSrcweir$(MISC)$/classic.flag : $(CLASSIC_TARBALL)
8161aaf8b6SYuri Dario.IF "$(GUI)"=="OS2"
8261aaf8b6SYuri Dario    cd $(MISC) && tar zxf $(CLASSIC_TARBALL) && $(TOUCH) $(@:f)
8361aaf8b6SYuri Dario.ELSE
84cdf0e10cSrcweir    cd $(MISC) && gunzip -c $(CLASSIC_TARBALL) | ( tar -xf - ) && $(TOUCH) $(@:f)
8561aaf8b6SYuri Dario.ENDIF
86cdf0e10cSrcweir.IF "$(GUI)"=="UNX"
87cdf0e10cSrcweir	chmod -R g+w $(MISC)$/classic
88cdf0e10cSrcweir.ENDIF
89cdf0e10cSrcweir    @$(TYPE) $@ || echo "ERROR: unpacking $(CLASSIC_TARBALL) failed"
90cdf0e10cSrcweir
91cdf0e10cSrcweir# dependencies
92cdf0e10cSrcweirimages_hicontrast : $(MISC)$/hicontrast.flag $(RES)$/img$/commandimagelist.ilst
93cdf0e10cSrcweir
94cdf0e10cSrcweirimages_crystal : $(MISC)$/crystal.flag $(RES)$/img$/commandimagelist.ilst
95cdf0e10cSrcweir
96cdf0e10cSrcweirimages_classic : $(MISC)$/classic.flag $(RES)$/img$/commandimagelist.ilst
97cdf0e10cSrcweir
98