1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 # Copyright 2008 by Sun Microsystems, Inc.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # $RCSfile: unitools.mk,v $
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
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
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
61 # iz29609 helpmacro to check if file exists
62 .IF "$(USE_SHELL
)"=="bash
"
75 .IF "$(USE_SHELL
)"=="bash
"
76 CHECKZIPRESULT:=|| if test "$$?
" != "12" && "$$?
" != "1" ; then exit $$? ; fi && echo "Nothing to update for zip
"
78 CHECKZIPRESULT:=|| if ("$$status" != "12" && "$$status" != "1") exit $$status && echo "Nothing to update for zip
"
81 .ELSE # "$(USE_SHELL
)"!="4nt
"
82 # (\\ at line end is \)
90 # iz29609 helpmacro to check if file exists 4nt style
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
105 .ENDIF # "$(USE_SHELL
)"!="4nt
"
113 .IF "$(USE_SHELL
)"!="4nt
"
114 # change drive and directory
116 # expect cygwin tools to exist
137 .ELSE # "$(USE_SHELL
)"!="4nt
"
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
157 RMDIR:=$(PERL) $(SOLARENV)$/bin$/rmdir.pl
158 TOUCH*=$(PERL) $(SOLARENV)$/bin$/touch.pl
160 XARGS*=tr -d "\015" | xargs
162 .ENDIF "$(USE_SHELL
)"!="4nt
"
165 .ELIF "$(GUI
)"=="UNX
" # "$(GUI
)"=="WNT
"
174 .IF "$(OS
)"=="SOLARIS
"
178 .ELSE # "$(OS
)"=="SOLARIS
"
182 .ENDIF # "$(OS
)"=="SOLARIS
"
183 .IF "$(OS
)"=="LINUX
" || "$(OS
)"=="MACOSX
"
185 .ELSE # "$(OS
)"=="LINUX
" || "$(OS
)"=="MACOSX
"
187 .ENDIF # "$(OS
)"=="LINUX
" || "$(OS
)"=="MACOSX
"
195 .ELIF "$(GUI
)"=="OS2
"
201 COPY*=$(SHELL) /c copy /b
212 #YD rename doesn't work across different drives!
221 .ENDIF # "$(GUI
)"=="UNX
"
223 # (Global) Set if not set before
226 MKDIRHIER*=mkdir$E -p
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
"