update ooo310-m15
[ooovba.git] / solenv / inc / unitools.mk
bloba5224005a6f32cadc6203311b5599ad4a8a619b4
1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # Copyright 2008 by Sun Microsystems, Inc.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # $RCSfile: unitools.mk,v $
11 # $Revision: 1.59 $
13 # This file is part of OpenOffice.org.
15 # OpenOffice.org is free software: you can redistribute it and/or modify
16 # it under the terms of the GNU Lesser General Public License version 3
17 # only, as published by the Free Software Foundation.
19 # OpenOffice.org is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU Lesser General Public License version 3 for more details
23 # (a copy is included in the LICENSE file that accompanied this code).
25 # You should have received a copy of the GNU Lesser General Public License
26 # version 3 along with OpenOffice.org. If not, see
27 # <http://www.openoffice.org/license.html>
28 # for a copy of the LGPLv3 License.
30 #*************************************************************************
32 # Common tools - move this to the end / consolidate
33 TRANSEX*=transex3
34 ULFEX*=ulfex
35 XMLEX*=xmlex
36 XRMEX*=xrmex
37 CFGEX*=cfgex
38 XSLTPROC*=xsltproc
40 ULFCONV*=ulfconv
42 MAKEDEPEND*=$(SOLARBINDIR)$/makedepend
44 SCP_CHECK_TOOL:=checkscp$E
46 # Not 4nt means $(GUI)==UNX or $(GUI)==WNT with tcsh
47 .IF "$(USE_SHELL)"!="4nt"
48 # iz32110: Calling a cygwin application from a non-cygwin shell requires
49 # backslashes to be escaped by another backslash: EES .. extra escape slash
50 EES:=
52 # iz29675: 4nt must not quote special characters, but tcsh has to.
53 # *NIX shells needs to use " quotes, but 4nt must not.
54 # EMQ .. extra meta quote (\\ at line end is \)
55 # USQ .. unix shell quote
56 EMQ:=\\
57 USQ:="
59 NULLDEV:=/dev/null
61 # iz29609 helpmacro to check if file exists
62 .IF "$(USE_SHELL)"=="bash"
63 IFEXIST:=if test -e
64 THEN:= ; then
65 FI:= ; fi
66 PIPEERROR=2>&1 |
67 .ELSE
68 IFEXIST:=if ( -e
69 THEN:= )
70 FI:=
71 PIPEERROR=|&
72 .ENDIF
74 # iz31658
75 .IF "$(USE_SHELL)"=="bash"
76 CHECKZIPRESULT:=|| if test "$$?" != "12" && "$$?" != "1" ; then exit $$? ; fi && echo "Nothing to update for zip"
77 .ELSE
78 CHECKZIPRESULT:=|| if ("$$status" != "12" && "$$status" != "1") exit $$status && echo "Nothing to update for zip"
79 .ENDIF
81 .ELSE # "$(USE_SHELL)"!="4nt"
82 # (\\ at line end is \)
83 EES:=\\
85 EMQ:=
86 USQ:=
88 NULLDEV:=nul
90 # iz29609 helpmacro to check if file exists 4nt style
91 IFEXIST:=+if exist
92 THEN:=
93 FI:=
94 PIPEERROR=|&
96 # iz31658
97 CHECKZIPRESULT:=^ iff errorlevel == 12 .and. errorlevel == 12 then ( echo Nothing to update for zip ^ set somedummyvar=%somedummyvar)
99 # try the same for 4nt "copy /u"
100 CHECKCOPYURESULT:=^ iff errorlevel == 2 then ( echo Nothing to update for copy ^ set somedummyvar=%somedummyvar)
102 # tell makedepend to write windows native format
103 MKDEPFLAGS=-n
105 .ENDIF # "$(USE_SHELL)"!="4nt"
107 # Platform specific
108 .IF "$(GUI)"=="WNT"
109 AWK*=awk
110 SORT*=sort
111 SED*=sed
112 GNUPATCH*=patch
113 .IF "$(USE_SHELL)"!="4nt"
114 # change drive and directory
115 CDD=cd
116 # expect cygwin tools to exist
117 COPY*=cp
118 COPYRECURSE=-r
119 COPYUPDATE=-u
120 ECHON=echo -n
121 ECHONL=echo
122 FIND*=find
123 GNUCOPY*=cp
124 GNUMAKE*=make
125 GREP*=grep
126 LS*=ls
127 PERL*:=perl
128 .EXPORT : PERL
129 RENAME*=mv
130 TOUCH*=touch
131 TYPE*=cat
132 TRANSEX*=transex3
133 ULFEX*=ulfex
134 XMLEX*=xmlex
135 XRMEX*=xrmex
136 CFGEX*=cfgex
137 .ELSE # "$(USE_SHELL)"!="4nt"
138 CDD=+cdd
139 COPY*=+copy
140 COPYRECURSE=/s
141 COPYUPDATE=/u
142 DELAY*=+delay
143 ECHON*=+echos
144 ECHONL=+echo.
145 FIND*=$(BUILD_TOOLS)$/find.exe
146 .IF "$(use_cygcp)"!=""
147 GNUCOPY=$(BUILD_TOOLS)$/gnucp.exe
148 .ENDIF # "$(use_cygcp)"!=""
149 GNUCOPY*=$(BUILD_TOOLS)$/cp.exe
150 GNUMAKE*=$(BUILD_TOOLS)$/gnumake.exe
151 GREP*=$(BUILD_TOOLS)$/grep.exe
152 LS*=$(BUILD_TOOLS)$/ls.exe
153 #wraper for solenv\bin\mkdir.pl to fix mkdir /p problem
154 PERL*:=+call perl5.btm
155 .EXPORT : PERL
156 RENAME*=+ren
157 RMDIR:=$(PERL) $(SOLARENV)$/bin$/rmdir.pl
158 TOUCH*=$(PERL) $(SOLARENV)$/bin$/touch.pl
159 TYPE*=+type
160 XARGS*=tr -d "\015" | xargs
161 4nt_force_shell:=+
162 .ENDIF "$(USE_SHELL)"!="4nt"
163 DUMPBIN*=dumpbin
165 .ELIF "$(GUI)"=="UNX" # "$(GUI)"=="WNT"
166 SED*=sed
167 SORT*=sort
168 PERL*=perl
169 .EXPORT : PERL
170 TYPE=cat
171 CDD=cd
172 COPY=cp -f
173 COPYRECURSE=-r
174 .IF "$(OS)"=="SOLARIS"
175 AWK*=nawk
176 GNUCOPY*=gnucp
177 GNUPATCH*=gnupatch
178 .ELSE # "$(OS)"=="SOLARIS"
179 AWK*=awk
180 GNUCOPY*=cp
181 GNUPATCH*=patch
182 .ENDIF # "$(OS)"=="SOLARIS"
183 .IF "$(OS)"=="LINUX" || "$(OS)"=="MACOSX"
184 GNUMAKE*=make
185 .ELSE # "$(OS)"=="LINUX" || "$(OS)"=="MACOSX"
186 GNUMAKE*=gmake
187 .ENDIF # "$(OS)"=="LINUX" || "$(OS)"=="MACOSX"
188 TOUCH=touch
189 RENAME=mv
190 GREP=grep
191 FIND=find
192 LS=ls
193 ECHON=echo -n
194 ECHONL=echo
195 .ELIF "$(GUI)"=="OS2"
196 SED*=sed
197 SORT*=sort
198 PERL*=perl
199 TYPE=cat
200 CDD=@cd
201 COPY*=$(SHELL) /c copy /b
202 COPYRECURSE=/s
203 COPYUPDATE=/u
204 DELAY=sleep
205 ECHON*=echos
206 ECHONL=+echo.
207 AWK*=awk
208 GNUCOPY*=cp
209 GNUPATCH*=gnupatch
210 GNUMAKE*=make
211 TOUCH=touch /c
212 #YD rename doesn't work across different drives!
213 RENAME=mv
214 MKDIR=+md
215 MKDIRHIER=+md /s
216 GREP=grep
217 FIND=find
218 LS=ls
219 DUMPBIN=echo
220 4nt_force_shell:=+
221 .ENDIF # "$(GUI)"=="UNX"
223 # (Global) Set if not set before
224 DELAY*=sleep
225 MKDIR*=mkdir$E
226 MKDIRHIER*=mkdir$E -p
227 RMDIR*=rmdir
228 XARGS*=xargs
230 RM+=$(RMFLAGS)
231 ADJUSTVISIBILITY*:=adjustvisibility
232 CONVERT*:=$(PERL) $(SOLARENV)$/bin$/leconvert.pl
233 EXECTEST := $(PERL) -w $(SOLARENV)$/bin$/exectest.pl
234 GCCINSTLIB:=$(PERL) -w $(SOLARENV)$/bin$/gccinstlib.pl
236 # The dmake $(PWD) variable and the tcsh pwd command both apparantly produce
237 # paths with symlinks resolved, while the bash pwd command by default produces
238 # paths with unresolved symlinks, so that computing PATH_IN_MODULE in
239 # settings.mk would fail without the -P flag to the bash pwd command:
240 .IF "$(USE_SHELL)" == "bash"
241 PWDFLAGS = -P
242 .ENDIF