Version 4.0.0.1, tag libreoffice-4.0.0.1
[LibreOffice.git] / solenv / inc / tg_jar.mk
blobdf39ba65229f65cbfdf6dd5136cfce699862b653
1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # Copyright 2000, 2010 Oracle and/or its affiliates.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # This file is part of OpenOffice.org.
11 # OpenOffice.org is free software: you can redistribute it and/or modify
12 # it under the terms of the GNU Lesser General Public License version 3
13 # only, as published by the Free Software Foundation.
15 # OpenOffice.org is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU Lesser General Public License version 3 for more details
19 # (a copy is included in the LICENSE file that accompanied this code).
21 # You should have received a copy of the GNU Lesser General Public License
22 # version 3 along with OpenOffice.org. If not, see
23 # <http://www.openoffice.org/license.html>
24 # for a copy of the LGPLv3 License.
26 #*************************************************************************
29 .IF "$(VERBOSE)"!="TRUE"
30 ZIP_VERBOSITY=-q
31 .ENDIF
33 .IF "$(JARTARGETN)"!=""
35 .IF "$(JARCOMPRESS)"==""
36 JARCOMPRESS_FLAG=0
37 .ENDIF
39 $(JARTARGETN) : $(JARMANIFEST) $(JAVACLASSFILES) $(JAVATARGET)
41 .IF "$(JARMANIFEST)"!=""
43 .IF "$(CUSTOMMANIFESTFILE)"!=""
45 CUSTOMMANIFESTFILEDEP:=$(MISC)/$(TARGET)_$(CUSTOMMANIFESTFILE:f)
47 $(MISC)/$(TARGET)_$(CUSTOMMANIFESTFILE:f) : $(subst,/,/ $(DMAKE_WORK_DIR))/$(CUSTOMMANIFESTFILE)
48 $(COMMAND_ECHO)-$(RM) $@
49 $(COMMAND_ECHO)$(COPY) $< $@
50 .ENDIF # "$(CUSTOMMANIFESTFILE)"!=""
52 $(JARMANIFEST) .PHONY : $(CUSTOMMANIFESTFILEDEP)
53 @@-$(MKDIRHIER) $(@:d)
54 @@-$(RM) $@
55 $(COMMAND_ECHO)echo Manifest-Version: 1.0 > $@
56 .IF "$(JARCLASSPATH)" != ""
57 $(COMMAND_ECHO)echo $(USQ)Class-Path: $(JARCLASSPATH)$(USQ) >> $@
58 .ENDIF
59 # $(RSCREVISION) contains chars that must be quoted (for *NIX shells)
60 $(COMMAND_ECHO)echo $(USQ)Solar-Version: $(RSCREVISION)$(USQ) >> $@
61 .IF "$(CUSTOMMANIFESTFILE)"!=""
62 $(COMMAND_ECHO)$(TYPE) $(MISC)/$(TARGET)_$(CUSTOMMANIFESTFILE:f) >> $@
63 .ENDIF # "$(CUSTOMMANIFESTFILE)"!=""
64 .ENDIF # "$(JARMANIFEST)"!=""
66 .IF "$(JARCLASSEXCLUDES)" == ""
67 ZIPJAR_EXCLUDE=
68 .ELSE # "$(JARCLASSEXCLUDES)" == ""
69 ZIPJAR_EXCLUDE=$(foreach,i,$(JARCLASSEXCLUDES) -x "$i")
70 # format:
71 # JARCLASSEXCLUDES=foo/* bar/*
72 .ENDIF # "$(JARCLASSEXCLUDES)" == ""
75 # build jar
77 $(JARTARGETN) .PHONY :
78 # $(JARMANIFEST)
79 .IF "$(OS)$(CPU)"=="SOLARISS"
80 @-find . -type d -user $(USER) ! -perm -5 -print | xargs test "$$1" != "" && chmod +r $$1
81 .ENDIF
82 .IF "$(JARMANIFEST)"!=""
83 $(COMMAND_ECHO)cd $(CLASSDIR)/$(TARGET) && zip $(ZIP_VERBOSITY) -u -rX ../$(@:f) $(subst,$(CLASSDIR)/$(TARGET)/, $(JARMANIFEST)) $(ZIPJAR_EXCLUDE) $(CHECKZIPRESULT)
84 .ENDIF # "$(JARMANIFEST)"!=""
85 $(COMMAND_ECHO)cd $(CLASSDIR) && zip $(ZIP_VERBOSITY) -u -rX $(@:f) $(subst,\,/ $(JARCLASSDIRS)) $(ZIPJAR_EXCLUDE) $(CHECKZIPRESULT)
86 .ENDIF