xref: /aoo41x/main/solenv/inc/tg_zip.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*cdf0e10cSrcweir
28*cdf0e10cSrcweir#######################################################
29*cdf0e10cSrcweir# unroll begin
30*cdf0e10cSrcweir
31*cdf0e10cSrcweir.IF "$(GUI)"=="WNT"
32*cdf0e10cSrcweircommand_seperator=&&
33*cdf0e10cSrcweir#command_seperator=^
34*cdf0e10cSrcweiravoid_cvs_dir=-x "*CVS*" -x "*.svn*"
35*cdf0e10cSrcweir.ELIF "$(GUI)"=="OS2"
36*cdf0e10cSrcweircommand_seperator=&&
37*cdf0e10cSrcweir.ELSE
38*cdf0e10cSrcweircommand_seperator=;
39*cdf0e10cSrcweiravoid_cvs_dir=-x "*CVS*" -x "*.svn*"
40*cdf0e10cSrcweir
41*cdf0e10cSrcweir.ENDIF
42*cdf0e10cSrcweir
43*cdf0e10cSrcweir.IF "$(ZIP$(TNR)TARGET)"!=""
44*cdf0e10cSrcweir
45*cdf0e10cSrcweirZIP$(TNR)EXT*=.zip
46*cdf0e10cSrcweir.IF "$(common_build_zip)"!=""
47*cdf0e10cSrcweir.IF "$(ZIP$(TNR)LIST:s/LANGDIR//)" == "$(ZIP$(TNR)LIST)"
48*cdf0e10cSrcweirZIP$(TNR)TARGETN=$(COMMONBIN)/$(ZIP$(TNR)TARGET)$(ZIP$(TNR)EXT)
49*cdf0e10cSrcweir.ELSE
50*cdf0e10cSrcweirZIP$(TNR)TARGETN=$(foreach,i,$(zip$(TNR)alllangiso) $(COMMONBIN)/$(ZIP$(TNR)TARGET)_$i$(ZIP$(TNR)EXT) )
51*cdf0e10cSrcweir.ENDIF
52*cdf0e10cSrcweir.ELSE			# "$(common_build_zip)"!=""
53*cdf0e10cSrcweir.IF "$(ZIP$(TNR)LIST:s/LANGDIR//)" == "$(ZIP$(TNR)LIST)"
54*cdf0e10cSrcweirZIP$(TNR)TARGETN=$(BIN)/$(ZIP$(TNR)TARGET)$(ZIP$(TNR)EXT)
55*cdf0e10cSrcweir.ELSE
56*cdf0e10cSrcweirZIP$(TNR)TARGETN=$(foreach,i,$(zip$(TNR)alllangiso) $(BIN)/$(ZIP$(TNR)TARGET)_$i$(ZIP$(TNR)EXT) )
57*cdf0e10cSrcweir.ENDIF
58*cdf0e10cSrcweir.ENDIF			# "$(common_build_zip)"!=""
59*cdf0e10cSrcweirZIP$(TNR)DEPFILE=$(subst,$(COMMON_OUTDIR),$(OUTPATH) $(subst,/bin/,/misc/ $(ZIP$(TNR)TARGETN:s/$(ZIP$(TNR)EXT)/.dpzz/)))
60*cdf0e10cSrcweirZIPDEPFILES+=$(ZIP$(TNR)DEPFILE)
61*cdf0e10cSrcweir
62*cdf0e10cSrcweirZIP$(TNR)DIR*=$(ZIPDIR)
63*cdf0e10cSrcweirZIP$(TNR)FLAGS*=$(ZIPFLAGS)
64*cdf0e10cSrcweir.IF "$(zip$(TNR)generatedlangs)"!=""
65*cdf0e10cSrcweirzip$(TNR)langdirs*=$(alllangiso)
66*cdf0e10cSrcweir.ELSE           # "$(zip$(TNR)generatedlangs)"!=""
67*cdf0e10cSrcweirzip$(TNR)langdirs:=$(shell @-test -d {$(subst,/$(LANGDIR), $(null,$(ZIP$(TNR)DIR) . $(ZIP$(TNR)DIR)))}/ && find {$(subst,/$(LANGDIR), $(null,$(ZIP$(TNR)DIR) . $(ZIP$(TNR)DIR)))}/ -type d ! -name CVS ! -name ".svn" ! -name "." | sed "s/\.\/\///" | sed "s/\.\///" )
68*cdf0e10cSrcweir.ENDIF          # "$(zip$(TNR)generatedlangs)"!=""
69*cdf0e10cSrcweir.IF "$(ZIP$(TNR)FORCEALLLANG)"!=""
70*cdf0e10cSrcweirzip$(TNR)alllangiso:=$(foreach,i,$(completelangiso) $(foreach,j,$(zip$(TNR)langdirs) $(eq,$i,$j  $i $(NULL))))
71*cdf0e10cSrcweir.ELSE          # "$(ZIP$(TNR)ALLLANG)" != ""
72*cdf0e10cSrcweirzip$(TNR)alllangiso*:=$(foreach,i,$(alllangiso) $(foreach,j,$(zip$(TNR)langdirs) $(eq,$i,$j  $i $(NULL))))
73*cdf0e10cSrcweir.ENDIF          # "$(ZIP$(TNR)ALLLANG)" != ""
74*cdf0e10cSrcweir.ENDIF			# "$(ZIP$(TNR)TARGET)"!=""
75*cdf0e10cSrcweir
76*cdf0e10cSrcweir.IF "$(ZIP$(TNR)TARGETN)"!=""
77*cdf0e10cSrcweir
78*cdf0e10cSrcweirZIP$(TNR)TMP:=$(mktmp iii)
79*cdf0e10cSrcweir
80*cdf0e10cSrcweir$(MISC)/$(TARGET).$(PWD:f).$(ZIP$(TNR)TARGET).dpzz : $(ZIP$(TNR)TARGETN)
81*cdf0e10cSrcweir
82*cdf0e10cSrcweir.IF "$(common_build_zip)"!=""
83*cdf0e10cSrcweirZIP$(TNR)HELPVAR=$(COMMONBIN)/$(ZIP$(TNR)TARGET)
84*cdf0e10cSrcweir.ELSE			# "$(common_build_zip)"!=""
85*cdf0e10cSrcweirZIP$(TNR)HELPVAR=$(BIN)/$(ZIP$(TNR)TARGET)
86*cdf0e10cSrcweir.ENDIF			# "$(common_build_zip)"!=""
87*cdf0e10cSrcweir
88*cdf0e10cSrcweir$(ZIP$(TNR)DEPFILE) :
89*cdf0e10cSrcweir	@echo # > $(MISC)/$(@:f)
90*cdf0e10cSrcweir.IF "$(common_build_zip)"!=""
91*cdf0e10cSrcweir.IF "$(ZIP$(TNR)DIR)" != ""
92*cdf0e10cSrcweir	$(COMMAND_ECHO)-$(MKDIRHIER) $(ZIP$(TNR)DIR)
93*cdf0e10cSrcweir	$(COMMAND_ECHO)$(CDD) $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP$(TNR)DIR))) $(command_seperator) $(ZIPDEP) $(ZIP$(TNR)FLAGS) -prefix $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP$(TNR)DIR)))/ $(subst,$(OUTPATH),$(COMMON_OUTDIR) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP$(TNR)EXT)/))) $(foreach,j,$(ZIP$(TNR)LIST) "{$(subst,LANGDIR,{$(subst,$(ZIP$(TNR)TARGET)_, $(@:f:b))} $j )}") $(avoid_cvs_dir) >> $(PWD)/$(PRJ)/$(ROUT)/misc/$(@:f)
94*cdf0e10cSrcweir.ELSE			# "$(ZIP$(TNR)DIR)" != ""
95*cdf0e10cSrcweir	$(COMMAND_ECHO)-$(ZIPDEP) $(ZIP$(TNR)FLAGS) $(subst,$(OUTPATH),$(COMMON_OUTDIR) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP$(TNR)EXT)/))) $(foreach,j,$(ZIP$(TNR)LIST) "{$(subst,LANGDIR,{$(subst,$(ZIP$(TNR)TARGET)_, $(@:f:b))} $j )}") $(avoid_cvs_dir) >> $(MISC)/$(@:f)
96*cdf0e10cSrcweir.ENDIF			# "$(ZIP$(TNR)DIR)" != ""
97*cdf0e10cSrcweir.ELSE			# "$(common_build_zip)"!=""
98*cdf0e10cSrcweir.IF "$(ZIP$(TNR)DIR)" != ""
99*cdf0e10cSrcweir	$(COMMAND_ECHO)-$(MKDIRHIER) $(ZIP$(TNR)DIR)
100*cdf0e10cSrcweir	$(COMMAND_ECHO)$(CDD) $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP$(TNR)DIR))) $(command_seperator) $(ZIPDEP) $(ZIP$(TNR)FLAGS) -prefix $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP$(TNR)DIR)))/ $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP$(TNR)EXT)/)) $(foreach,j,$(ZIP$(TNR)LIST) "{$(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP$(TNR)TARGET)_, $(subst,/misc/,/bin/ $(@:db)))} $j )}") $(avoid_cvs_dir) >> $(PWD)/$(PRJ)/$(ROUT)/misc/$(@:f)
101*cdf0e10cSrcweir.ELSE			# "$(ZIP$(TNR)DIR)" != ""
102*cdf0e10cSrcweir	$(COMMAND_ECHO)-$(ZIPDEP) $(ZIP$(TNR)FLAGS) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP$(TNR)EXT)/)) $(foreach,j,$(ZIP$(TNR)LIST) "{$(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP$(TNR)TARGET)_, $(subst,/misc/,/bin/ $(@:db)))} $j )}") $(avoid_cvs_dir) >> $(MISC)/$(@:f)
103*cdf0e10cSrcweir.ENDIF			# "$(ZIP$(TNR)DIR)" != ""
104*cdf0e10cSrcweir.ENDIF			# "$(common_build_zip)"!=""
105*cdf0e10cSrcweir	@echo $(@:n:s#\#/#) : makefile.mk >> $(MISC)/$(@:f)
106*cdf0e10cSrcweir
107*cdf0e10cSrcweir
108*cdf0e10cSrcweir$(ZIP$(TNR)TARGETN) : delzip $(ZIP$(TNR)DEPS)
109*cdf0e10cSrcweir	@echo "Making:   " $(@:f)
110*cdf0e10cSrcweir    @@$(!eq,$?,$(?:s/delzip/zzz/) -$(RM) echo) $(uniq $@ $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@))
111*cdf0e10cSrcweir	@$(eq,$?,$(?:s/delzip/zzz/) noop echo ) rebuilding zipfiles
112*cdf0e10cSrcweir	@echo ------------------------------ $(eq,$?,$(?:s/delzip/zzz/) >&$(NULLDEV) )
113*cdf0e10cSrcweir.IF "$(common_build_zip)"!=""
114*cdf0e10cSrcweir.IF "$(ZIP$(TNR)DIR)" != ""
115*cdf0e10cSrcweir	@@-$(GNUCOPY) -p $@ $(ZIP$(TNR)TMP).$(ZIP$(TNR)TARGET){$(subst,$(ZIP$(TNR)HELPVAR),_ $(@:db))}$(ZIP$(TNR)EXT)
116*cdf0e10cSrcweir	$(COMMAND_ECHO)-$(CDD) $(subst,LANGDIR,{$(subst,$(ZIP$(TNR)HELPVAR)_, $(@:db))} $(ZIP$(TNR)DIR)) $(command_seperator) zip $(ZIP_VERBOSITY) $(ZIP$(TNR)FLAGS) $(ZIP$(TNR)TMP).$(ZIP$(TNR)TARGET){$(subst,$(ZIP$(TNR)HELPVAR),_ $(@:db))}$(ZIP$(TNR)EXT) $(subst,LANGDIR_away/, $(ZIP$(TNR)LIST:s/LANGDIR/LANGDIR_away/)) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
117*cdf0e10cSrcweir	$(COMMAND_ECHO)$(IFEXIST) $(ZIP$(TNR)TMP).$(ZIP$(TNR)TARGET){$(subst,$(ZIP$(TNR)HELPVAR),_ $(@:db))}$(ZIP$(TNR)EXT) $(THEN) \
118*cdf0e10cSrcweir	    $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $(ZIP$(TNR)TMP).$(ZIP$(TNR)TARGET){$(subst,$(ZIP$(TNR)HELPVAR),_ $(@:db))}$(ZIP$(TNR)EXT) \
119*cdf0e10cSrcweir	    $(FI)
120*cdf0e10cSrcweir    $(COMMAND_ECHO)$(COPY) $(ZIP$(TNR)TMP).$(ZIP$(TNR)TARGET){$(subst,$(ZIP$(TNR)HELPVAR),_ $(@:db))}$(ZIP$(TNR)EXT) $@.$(INPATH)
121*cdf0e10cSrcweir    $(COMMAND_ECHO)$(RM) $(ZIP$(TNR)TMP).$(ZIP$(TNR)TARGET){$(subst,$(ZIP$(TNR)HELPVAR),_ $(@:db))}$(ZIP$(TNR)EXT)
122*cdf0e10cSrcweir.ELSE			# "$(ZIP$(TNR)DIR)" != ""
123*cdf0e10cSrcweir	@@-$(GNUCOPY) -p $@ $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@)
124*cdf0e10cSrcweir	$(COMMAND_ECHO)zip $(ZIP_VERBOSITY) $(ZIP$(TNR)FLAGS) $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) $(foreach,j,$(ZIP$(TNR)LIST) $(subst,LANGDIR,{$(subst,$(ZIP$(TNR)HELPVAR)_, $(@:db))} $j )) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
125*cdf0e10cSrcweir	$(COMMAND_ECHO)$(IFEXIST) $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) $(THEN) \
126*cdf0e10cSrcweir	    $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) \
127*cdf0e10cSrcweir	    $(FI)
128*cdf0e10cSrcweir	@@-$(GNUCOPY) -p $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) $@.$(INPATH)
129*cdf0e10cSrcweir	@-$(RM) $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@)
130*cdf0e10cSrcweir.ENDIF			# "$(ZIP$(TNR)DIR)" != ""
131*cdf0e10cSrcweir	@@-$(RM) $@
132*cdf0e10cSrcweir	@$(IFEXIST) $@.$(INPATH) $(THEN) $(RENAME:s/+//) $@.$(INPATH) $@ $(FI)
133*cdf0e10cSrcweir#	@$(IFEXIST) $@ $(THEN) $(TOUCH) $@ $(FI)  # even if it's not used...
134*cdf0e10cSrcweir.ELSE			# "$(common_build_zip)"!=""
135*cdf0e10cSrcweir.IF "$(ZIP$(TNR)DIR)" != ""
136*cdf0e10cSrcweir	@@-$(GNUCOPY) -p $@ $(ZIP$(TNR)TMP).$(ZIP$(TNR)TARGET){$(subst,$(ZIP$(TNR)HELPVAR),_ $(@:db))}$(ZIP$(TNR)EXT)
137*cdf0e10cSrcweir	$(COMMAND_ECHO)-$(CDD) $(subst,LANGDIR,{$(subst,$(ZIP$(TNR)HELPVAR)_, $(@:db))} $(ZIP$(TNR)DIR)) $(command_seperator) zip $(ZIP_VERBOSITY) $(ZIP$(TNR)FLAGS) $(ZIP$(TNR)TMP).$(ZIP$(TNR)TARGET){$(subst,$(ZIP$(TNR)HELPVAR),_ $(@:db))}$(ZIP$(TNR)EXT) $(subst,LANGDIR_away/, $(ZIP$(TNR)LIST:s/LANGDIR/LANGDIR_away/)) -x delzip  $(avoid_cvs_dir) $(CHECKZIPRESULT)
138*cdf0e10cSrcweir	$(COMMAND_ECHO)$(IFEXIST) $(ZIP$(TNR)TMP).$(ZIP$(TNR)TARGET){$(subst,$(ZIP$(TNR)HELPVAR),_ $(@:db))}$(ZIP$(TNR)EXT) $(THEN) \
139*cdf0e10cSrcweir	    $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $(ZIP$(TNR)TMP).$(ZIP$(TNR)TARGET){$(subst,$(ZIP$(TNR)HELPVAR),_ $(@:db))}$(ZIP$(TNR)EXT) \
140*cdf0e10cSrcweir	    $(FI)
141*cdf0e10cSrcweir    $(COMMAND_ECHO)$(COPY) $(ZIP$(TNR)TMP).$(ZIP$(TNR)TARGET){$(subst,$(ZIP$(TNR)HELPVAR),_ $(@:db))}$(ZIP$(TNR)EXT)  $@
142*cdf0e10cSrcweir    $(COMMAND_ECHO)$(RM) $(ZIP$(TNR)TMP).$(ZIP$(TNR)TARGET){$(subst,$(ZIP$(TNR)HELPVAR),_ $(@:db))}$(ZIP$(TNR)EXT)
143*cdf0e10cSrcweir.ELSE			# "$(ZIP$(TNR)DIR)" != ""
144*cdf0e10cSrcweir	$(COMMAND_ECHO)zip $(ZIP_VERBOSITY) $(ZIP$(TNR)FLAGS) $@ $(foreach,j,$(ZIP$(TNR)LIST) $(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP$(TNR)TARGET)_, $(@:db))} $j )) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
145*cdf0e10cSrcweir	$(COMMAND_ECHO)$(IFEXIST) $@ $(THEN) \
146*cdf0e10cSrcweir	    $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $@ \
147*cdf0e10cSrcweir	    $(FI)
148*cdf0e10cSrcweir.ENDIF			# "$(ZIP$(TNR)DIR)" != ""
149*cdf0e10cSrcweir.ENDIF			# "$(common_build_zip)"!=""
150*cdf0e10cSrcweir.ENDIF
151*cdf0e10cSrcweir
152*cdf0e10cSrcweir# unroll end
153*cdf0e10cSrcweir#######################################################
154*cdf0e10cSrcweir
155