2000-09-20 08:43:26 -05:00
|
|
|
#*************************************************************************
|
2001-06-20 03:09:38 -05:00
|
|
|
#
|
2005-09-08 03:50:16 -05:00
|
|
|
# OpenOffice.org - a multi-platform office productivity suite
|
2001-06-20 03:09:38 -05:00
|
|
|
#
|
2005-09-08 03:50:16 -05:00
|
|
|
# $RCSfile: tg_zip.mk,v $
|
2001-06-20 03:09:38 -05:00
|
|
|
#
|
2008-03-05 09:34:23 -06:00
|
|
|
# $Revision: 1.38 $
|
2001-06-20 03:09:38 -05:00
|
|
|
#
|
2008-03-05 09:34:23 -06:00
|
|
|
# last change: $Author: kz $ $Date: 2008-03-05 16:34:23 $
|
2001-06-20 03:09:38 -05:00
|
|
|
#
|
2005-09-08 03:50:16 -05:00
|
|
|
# The Contents of this file are made available subject to
|
|
|
|
# the terms of GNU Lesser General Public License Version 2.1.
|
2001-06-20 03:09:38 -05:00
|
|
|
#
|
|
|
|
#
|
2005-09-08 03:50:16 -05:00
|
|
|
# GNU Lesser General Public License Version 2.1
|
|
|
|
# =============================================
|
|
|
|
# Copyright 2005 by Sun Microsystems, Inc.
|
|
|
|
# 901 San Antonio Road, Palo Alto, CA 94303, USA
|
2001-06-20 03:09:38 -05:00
|
|
|
#
|
2005-09-08 03:50:16 -05:00
|
|
|
# This library is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU Lesser General Public
|
|
|
|
# License version 2.1, as published by the Free Software Foundation.
|
2001-06-20 03:09:38 -05:00
|
|
|
#
|
2005-09-08 03:50:16 -05:00
|
|
|
# This library is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
# Lesser General Public License for more details.
|
2001-06-20 03:09:38 -05:00
|
|
|
#
|
2005-09-08 03:50:16 -05:00
|
|
|
# You should have received a copy of the GNU Lesser General Public
|
|
|
|
# License along with this library; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
|
|
# MA 02111-1307 USA
|
2001-06-20 03:09:38 -05:00
|
|
|
#
|
2000-09-20 08:43:26 -05:00
|
|
|
#*************************************************************************
|
|
|
|
|
|
|
|
#######################################################
|
|
|
|
# unroll begin
|
|
|
|
|
2001-01-18 08:02:41 -06:00
|
|
|
.IF "$(GUI)"=="WNT"
|
|
|
|
command_seperator=&&
|
|
|
|
#command_seperator=^
|
2001-06-12 09:07:20 -05:00
|
|
|
avoid_cvs_dir=-x "*CVS*"
|
2001-01-18 08:02:41 -06:00
|
|
|
.ELSE
|
|
|
|
command_seperator=;
|
2001-06-12 09:07:20 -05:00
|
|
|
avoid_cvs_dir=-x "*CVS*"
|
2001-01-18 08:02:41 -06:00
|
|
|
.ENDIF
|
|
|
|
|
2002-06-21 07:13:59 -05:00
|
|
|
.IF "$(ZIP$(TNR)TARGET)"!=""
|
2006-07-19 03:38:41 -05:00
|
|
|
|
|
|
|
ZIP$(TNR)EXT*=.zip
|
|
|
|
.IF "$(common_build_zip)"!=""
|
|
|
|
.IF "$(ZIP$(TNR)LIST:s/LANGDIR//)" == "$(ZIP$(TNR)LIST)"
|
|
|
|
ZIP$(TNR)TARGETN=$(COMMONBIN)$/$(ZIP$(TNR)TARGET)$(ZIP$(TNR)EXT)
|
|
|
|
.ELSE
|
|
|
|
ZIP$(TNR)TARGETN=$(foreach,i,$(zip$(TNR)alllangiso) $(COMMONBIN)$/$(ZIP$(TNR)TARGET)_$i$(ZIP$(TNR)EXT) )
|
|
|
|
.ENDIF
|
|
|
|
.ELSE # "$(common_build_zip)"!=""
|
|
|
|
.IF "$(ZIP$(TNR)LIST:s/LANGDIR//)" == "$(ZIP$(TNR)LIST)"
|
|
|
|
ZIP$(TNR)TARGETN=$(BIN)$/$(ZIP$(TNR)TARGET)$(ZIP$(TNR)EXT)
|
|
|
|
.ELSE
|
|
|
|
ZIP$(TNR)TARGETN=$(foreach,i,$(zip$(TNR)alllangiso) $(BIN)$/$(ZIP$(TNR)TARGET)_$i$(ZIP$(TNR)EXT) )
|
|
|
|
.ENDIF
|
|
|
|
.ENDIF # "$(common_build_zip)"!=""
|
|
|
|
ZIP$(TNR)DEPFILE=$(subst,$(COMMON_OUTDIR),$(OUTPATH) $(subst,$/bin$/,$/misc$/ $(ZIP$(TNR)TARGETN:s/$(ZIP$(TNR)EXT)/.dpzz/)))
|
|
|
|
ZIPDEPFILES+=$(ZIP$(TNR)DEPFILE)
|
|
|
|
|
2001-11-02 10:59:44 -06:00
|
|
|
ZIP$(TNR)DIR*=$(ZIPDIR)
|
|
|
|
ZIP$(TNR)FLAGS*=$(ZIPFLAGS)
|
2004-08-30 11:21:53 -05:00
|
|
|
.IF "$(zip$(TNR)generatedlangs)"!=""
|
2004-12-16 05:58:28 -06:00
|
|
|
zip$(TNR)langdirs*=$(alllangiso)
|
2004-08-30 11:21:53 -05:00
|
|
|
.ELSE # "$(zip$(TNR)generatedlangs)"!=""
|
2002-06-21 07:13:59 -05:00
|
|
|
.IF "$(GUI)"=="UNX" || "$(USE_SHELL)"!="4nt"
|
2007-11-06 08:47:03 -06:00
|
|
|
zip$(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 "." | sed "s/\.\/\///" | sed "s/\.\///" )
|
2002-06-21 07:13:59 -05:00
|
|
|
.ELSE # "$(GUI)"=="UNX"
|
2008-03-05 09:34:23 -06:00
|
|
|
zip$(TNR)langdirs:=$(subst,CVS, $(shell @$(4nt_force_shell)-dir {$(subst,$/$(LANGDIR), $(ZIP$(TNR)DIR))} /ba:d ))
|
2002-06-21 07:13:59 -05:00
|
|
|
.ENDIF # "$(GUI)"=="UNX"
|
2004-08-30 11:21:53 -05:00
|
|
|
.ENDIF # "$(zip$(TNR)generatedlangs)"!=""
|
2004-06-25 10:14:07 -05:00
|
|
|
.IF "$(ZIP$(TNR)FORCEALLLANG)"!=""
|
|
|
|
zip$(TNR)alllangiso:=$(foreach,i,$(completelangiso) $(foreach,j,$(zip$(TNR)langdirs) $(eq,$i,$j $i $(NULL))))
|
|
|
|
.ELSE # "$(ZIP$(TNR)ALLLANG)" != ""
|
2006-07-13 06:08:18 -05:00
|
|
|
zip$(TNR)alllangiso*:=$(foreach,i,$(alllangiso) $(foreach,j,$(zip$(TNR)langdirs) $(eq,$i,$j $i $(NULL))))
|
2004-06-25 10:14:07 -05:00
|
|
|
.ENDIF # "$(ZIP$(TNR)ALLLANG)" != ""
|
2002-06-21 07:13:59 -05:00
|
|
|
.ENDIF # "$(ZIP$(TNR)TARGET)"!=""
|
|
|
|
|
|
|
|
.IF "$(ZIP$(TNR)TARGETN)"!=""
|
|
|
|
|
2001-11-02 10:59:44 -06:00
|
|
|
ZIP$(TNR)TMP:=$(mktmp iii)
|
|
|
|
|
2000-09-20 08:43:26 -05:00
|
|
|
$(MISC)$/$(TARGET).$(PWD:f).$(ZIP$(TNR)TARGET).dpzz : $(ZIP$(TNR)TARGETN)
|
|
|
|
|
2001-01-29 08:38:02 -06:00
|
|
|
.IF "$(common_build_zip)"!=""
|
2007-05-10 08:21:58 -05:00
|
|
|
.IF "$(PRJ)"!="."
|
2000-09-20 08:43:26 -05:00
|
|
|
ZIP$(TNR)HELPVAR={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))$/$(ZIP$(TNR)TARGET)}
|
2007-05-10 08:21:58 -05:00
|
|
|
.ELSE # "$(PRJ)"=="."
|
|
|
|
ZIP$(TNR)HELPVAR=$(subst,.$/,$(NULL) {$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))$/$(ZIP$(TNR)TARGET)})
|
|
|
|
.ENDIF # "$(PRJ)"=="."
|
2001-01-29 08:38:02 -06:00
|
|
|
.ELSE # "$(common_build_zip)"!=""
|
2007-05-10 08:21:58 -05:00
|
|
|
.IF "$(PRJ)"!="."
|
2001-01-29 08:38:02 -06:00
|
|
|
ZIP$(TNR)HELPVAR=$(BIN)$/$(ZIP$(TNR)TARGET)
|
2007-05-10 08:21:58 -05:00
|
|
|
.ELSE # "$(PRJ)"=="."
|
|
|
|
ZIP$(TNR)HELPVAR=$(subst,.$/,$(NULL) $(BIN)$/$(ZIP$(TNR)TARGET))
|
|
|
|
.ENDIF # "$(PRJ)"=="."
|
2001-01-29 08:38:02 -06:00
|
|
|
.ENDIF # "$(common_build_zip)"!=""
|
|
|
|
|
2003-08-25 08:48:05 -05:00
|
|
|
$(ZIP$(TNR)DEPFILE) :
|
2006-10-05 04:42:24 -05:00
|
|
|
echo # > $(MISC)$/$(@:f)
|
2003-08-25 08:48:05 -05:00
|
|
|
.IF "$(common_build_zip)"!=""
|
|
|
|
.IF "$(ZIP$(TNR)DIR)" != ""
|
2006-10-05 04:42:24 -05:00
|
|
|
@echo type 1
|
2006-11-21 08:11:25 -06:00
|
|
|
-$(MKDIRHIER) $(ZIP$(TNR)DIR)
|
2007-01-25 05:58:06 -06:00
|
|
|
$(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)
|
2003-08-25 08:48:05 -05:00
|
|
|
.ELSE # "$(ZIP$(TNR)DIR)" != ""
|
2006-10-05 04:42:24 -05:00
|
|
|
@echo type 2
|
2007-01-25 05:58:06 -06:00
|
|
|
-$(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)
|
2003-08-25 08:48:05 -05:00
|
|
|
.ENDIF # "$(ZIP$(TNR)DIR)" != ""
|
|
|
|
.ELSE # "$(common_build_zip)"!=""
|
|
|
|
.IF "$(ZIP$(TNR)DIR)" != ""
|
2006-10-05 04:42:24 -05:00
|
|
|
@echo type 3
|
2006-11-21 08:11:25 -06:00
|
|
|
-$(MKDIRHIER) $(ZIP$(TNR)DIR)
|
2007-01-25 05:58:06 -06:00
|
|
|
$(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)
|
2003-08-25 08:48:05 -05:00
|
|
|
.ELSE # "$(ZIP$(TNR)DIR)" != ""
|
2006-10-05 04:42:24 -05:00
|
|
|
@echo type 4
|
2007-01-25 05:58:06 -06:00
|
|
|
-$(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)
|
2003-08-25 08:48:05 -05:00
|
|
|
.ENDIF # "$(ZIP$(TNR)DIR)" != ""
|
|
|
|
.ENDIF # "$(common_build_zip)"!=""
|
2006-10-05 04:42:24 -05:00
|
|
|
@echo $@ : makefile.mk >> $(MISC)$/$(@:f)
|
2003-08-25 08:48:05 -05:00
|
|
|
|
2005-09-07 10:09:30 -05:00
|
|
|
|
2007-03-09 02:06:34 -06:00
|
|
|
$(ZIP$(TNR)TARGETN) : delzip $(ZIP$(TNR)DEPS)
|
2006-10-05 04:42:24 -05:00
|
|
|
@echo ------------------------------
|
|
|
|
@echo Making: $@
|
2007-02-06 07:02:07 -06:00
|
|
|
@@$(!eq,$?,$(?:s/delzip/zzz/) -$(RM) echo) $(uniq $@ $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@))
|
|
|
|
@$(eq,$?,$(?:s/delzip/zzz/) noop echo ) rebuilding zipfiles
|
2006-10-05 04:42:24 -05:00
|
|
|
@echo ------------------------------ $(eq,$?,$(?:s/delzip/zzz/) >&$(NULLDEV) )
|
2000-09-20 08:43:26 -05:00
|
|
|
.IF "$(common_build_zip)"!=""
|
2001-11-02 10:59:44 -06:00
|
|
|
.IF "$(ZIP$(TNR)DIR)" != ""
|
2007-02-06 07:02:07 -06:00
|
|
|
@@-$(GNUCOPY) -p $@ $(ZIP$(TNR)TMP).$(ZIP$(TNR)TARGET){$(subst,$(ZIP$(TNR)HELPVAR),_ $(@:db))}$(ZIP$(TNR)EXT)
|
2007-01-25 05:58:06 -06:00
|
|
|
-$(CDD) $(subst,LANGDIR,{$(subst,$(ZIP$(TNR)HELPVAR)_, $(@:db))} $(ZIP$(TNR)DIR)) $(command_seperator) zip $(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)
|
|
|
|
$(COPY) $(ZIP$(TNR)TMP).$(ZIP$(TNR)TARGET){$(subst,$(ZIP$(TNR)HELPVAR),_ $(@:db))}$(ZIP$(TNR)EXT) $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@)
|
|
|
|
$(RM) $(ZIP$(TNR)TMP).$(ZIP$(TNR)TARGET){$(subst,$(ZIP$(TNR)HELPVAR),_ $(@:db))}$(ZIP$(TNR)EXT)
|
2001-11-02 10:59:44 -06:00
|
|
|
.ELSE # "$(ZIP$(TNR)DIR)" != ""
|
2007-02-06 07:02:07 -06:00
|
|
|
@@-$(GNUCOPY) -p $@ $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@)
|
2007-01-25 05:58:06 -06:00
|
|
|
zip $(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)
|
2001-11-02 10:59:44 -06:00
|
|
|
.ENDIF # "$(ZIP$(TNR)DIR)" != ""
|
2007-02-06 07:02:07 -06:00
|
|
|
@@-$(GNUCOPY) -p $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) $@.$(INPATH)
|
2007-01-25 05:58:06 -06:00
|
|
|
@-$(RM) $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@)
|
2007-02-06 07:02:07 -06:00
|
|
|
@@-$(RM) $@
|
2007-01-25 05:58:06 -06:00
|
|
|
@$(IFEXIST) $@.$(INPATH) $(THEN) $(RENAME:s/+//) $@.$(INPATH) $@ $(FI)
|
|
|
|
# @$(IFEXIST) $@ $(THEN) $(TOUCH) $@ $(FI) # even if it's not used...
|
2000-09-20 08:43:26 -05:00
|
|
|
.ELSE # "$(common_build_zip)"!=""
|
2001-11-02 10:59:44 -06:00
|
|
|
.IF "$(ZIP$(TNR)DIR)" != ""
|
2007-02-06 07:02:07 -06:00
|
|
|
@@-$(GNUCOPY) -p $@ $(ZIP$(TNR)TMP).$(ZIP$(TNR)TARGET){$(subst,$(ZIP$(TNR)HELPVAR),_ $(@:db))}$(ZIP$(TNR)EXT)
|
2007-01-25 05:58:06 -06:00
|
|
|
-$(CDD) $(subst,LANGDIR,{$(subst,$(ZIP$(TNR)HELPVAR)_, $(@:db))} $(ZIP$(TNR)DIR)) $(command_seperator) zip $(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)
|
|
|
|
$(COPY) $(ZIP$(TNR)TMP).$(ZIP$(TNR)TARGET){$(subst,$(ZIP$(TNR)HELPVAR),_ $(@:db))}$(ZIP$(TNR)EXT) $@
|
|
|
|
$(RM) $(ZIP$(TNR)TMP).$(ZIP$(TNR)TARGET){$(subst,$(ZIP$(TNR)HELPVAR),_ $(@:db))}$(ZIP$(TNR)EXT)
|
2001-11-02 10:59:44 -06:00
|
|
|
.ELSE # "$(ZIP$(TNR)DIR)" != ""
|
2007-01-25 05:58:06 -06:00
|
|
|
zip $(ZIP$(TNR)FLAGS) $@ $(foreach,j,$(ZIP$(TNR)LIST) $(subst,LANGDIR,{$(subst,$(BIN)$/$(ZIP$(TNR)TARGET)_, $(@:db))} $j )) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
|
2001-11-02 10:59:44 -06:00
|
|
|
.ENDIF # "$(ZIP$(TNR)DIR)" != ""
|
2000-09-20 08:43:26 -05:00
|
|
|
.ENDIF # "$(common_build_zip)"!=""
|
|
|
|
.ENDIF
|
|
|
|
|
|
|
|
# unroll end
|
|
|
|
#######################################################
|
|
|
|
|