xref: /aoo41x/main/solenv/inc/unitools.mk (revision cdf0e10c)
1#*************************************************************************
2#
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# Copyright 2000, 2010 Oracle and/or its affiliates.
6#
7# OpenOffice.org - a multi-platform office productivity suite
8#
9# This file is part of OpenOffice.org.
10#
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.
14#
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).
20#
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.
25#
26#*************************************************************************
27
28# Common tools - move this to the end / consolidate
29TRANSEX*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/transex3
30ULFEX*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/ulfex
31XMLEX*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/xmlex
32XRMEX*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/xrmex
33CFGEX*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/cfgex
34AUTODOC*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/autodoc
35LOCALIZE_SL*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/localize_sl
36GSICHECK*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/gsicheck
37
38.IF "$(SYSTEM_LIBXSLT)"!="YES"
39XSLTPROC*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/xsltproc
40.ELSE			# "$(SYSTEM_LIBXSLT)"!="YES"
41XSLTPROC*=$(AUGMENT_LIBRARY_PATH) xsltproc
42.ENDIF			# "$(SYSTEM_LIBXSLT)"!="YES"
43
44ULFCONV*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/ulfconv
45
46MAKEDEPEND*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/makedepend
47
48SCP_CHECK_TOOL:=checkscp$E
49
50# iz32110: Calling a cygwin application from a non-cygwin shell requires
51# backslashes to be escaped by another backslash: EES .. extra escape slash
52EES:=
53
54# iz29675: 4nt must not quote special characters, but tcsh has to.
55# *NIX shells needs to use " quotes, but 4nt must not.
56# EMQ .. extra meta quote (\\ at line end is \)
57# USQ .. unix shell  quote
58EMQ:=\\
59USQ:="
60
61NULLDEV:=/dev/null
62
63
64# iz29609 helpmacro to check if file exists
65IFEXIST:=if [ -f
66IFNOTEXIST:= if ! test -f
67THEN:= ] ; then
68FI:= ; fi
69PIPEERROR=2>&1 |
70
71# iz31658
72CHECKZIPRESULT:=|| ret=$$?; if [[ "$$ret" != "12" && "$$ret" != "1" ]] ; then exit $$ret ; fi && echo "Nothing to update for zip"
73
74# Platform specific
75.IF "$(GUI)"=="WNT"
76AWK*=awk
77SORT*=sort
78SED*=sed
79GNUPATCH*=patch
80# change drive and directory
81CDD=cd
82# expect cygwin tools to exist
83COPY*=cp
84COPYRECURSE=-r
85DEREFERENCE=-L
86COPYUPDATE=-u
87ECHON=echo -n
88ECHONL=echo
89FIND*=find
90FLIPCMD*=$(PERL) $(SOLARENV)/bin/slfl.pl
91GNUCOPY*=cp
92GNUMAKE*=make
93GREP*=grep
94LS*=ls
95PERL*:=perl
96.EXPORT : PERL
97RENAME*=mv
98TOUCH*=touch
99TYPE*=cat
100DUMPBIN*=dumpbin
101
102.ELIF "$(GUI)"=="UNX"	# "$(GUI)"=="WNT"
103SED*=sed
104SORT*=sort
105PERL*=perl
106.EXPORT : PERL
107TYPE=cat
108CDD=cd
109COPY=cp -f
110.IF "$(OS)"=="MACOSX"
111COPYRECURSE=-R
112.ELSE #"$(OS)"=="MACOSX"
113COPYRECURSE=-r
114.ENDIF
115.IF "$(OS)"=="SOLARIS"
116AWK*=nawk
117GNUCOPY*=gnucp
118GNUPATCH*=gnupatch
119GNUTAR*=/usr/sfw/bin/gtar
120DEREFERENCE=
121.ELSE			# "$(OS)"=="SOLARIS"
122AWK*=awk
123# this is not true, as BSD does not default to a GNU cp, but BSD cp
124# so in dmake makefiles one should be restricted to use the subset
125# of features that both BSD and GNU make support.
126# as the GNU make build system requires GNUCOPY to really be a GNU copy
127# we work around that for now by not setting GNUCOPY in sdev300.ini
128# for fbsd for now, but for all other platforms it is set.
129GNUCOPY*=cp
130GNUPATCH*=patch
131DEREFERENCE=-L
132.ENDIF			# "$(OS)"=="SOLARIS"
133.IF "$(OS)"=="LINUX" || "$(OS)"=="MACOSX"
134GNUMAKE*=make
135.ELSE			# "$(OS)"=="LINUX" || "$(OS)"=="MACOSX"
136GNUMAKE*=gmake
137.ENDIF			# "$(OS)"=="LINUX" || "$(OS)"=="MACOSX"
138TOUCH=touch
139RENAME=mv
140GREP=grep
141FIND=find
142LS=ls
143ECHON=echo -n
144ECHONL=echo
145.ELIF "$(GUI)"=="OS2"
146SED*=sed
147SORT*=sort
148PERL*=perl
149TYPE=cat
150CDD=@cd
151COPY*=$(SHELL) /c copy /b
152COPYRECURSE=/s
153COPYUPDATE=/u
154DELAY=sleep
155ECHON*=echos
156ECHONL=+echo.
157AWK*=awk
158GNUCOPY*=cp
159GNUPATCH*=gnupatch
160GNUMAKE*=make
161TOUCH=touch /c
162#YD rename doesn't work across different drives!
163RENAME=mv
164MKDIR=+md
165MKDIRHIER=+md /s
166GREP=grep
167FIND=find
168LS=ls
169DUMPBIN=echo
1704nt_force_shell:=+
171
172.ENDIF			# "$(GUI)"=="UNX"
173
174# (Global) Set if not set before
175DELAY*=sleep
176MKDIR*=mkdir$E
177MKDIRHIER*=mkdir$E -p
178RMDIR*=rmdir
179XARGS*=xargs
180GNUTAR*:=tar
181
182RM+=$(RMFLAGS)
183ADJUSTVISIBILITY*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/adjustvisibility
184CONVERT*:=$(PERL) $(SOLARENV)/bin/leconvert.pl
185EXECTEST := $(PERL) -w $(SOLARENV)/bin/exectest.pl
186GCCINSTLIB:=$(PERL) -w $(SOLARENV)/bin/gccinstlib.pl
187
188# The dmake $(PWD) apparantly produces paths with symlinks resolved, while the
189# bash pwd command by default produces paths with unresolved symlinks, so that
190# computing PATH_IN_MODULE in settings.mk would fail without the -P flag to the
191# bash pwd command:
192PWDFLAGS = -P
193