xref: /aoo4110/main/solenv/inc/unitools.mk (revision b1cdbd2c)
1#**************************************************************
2#
3#  Licensed to the Apache Software Foundation (ASF) under one
4#  or more contributor license agreements.  See the NOTICE file
5#  distributed with this work for additional information
6#  regarding copyright ownership.  The ASF licenses this file
7#  to you under the Apache License, Version 2.0 (the
8#  "License"); you may not use this file except in compliance
9#  with the License.  You may obtain a copy of the License at
10#
11#    http://www.apache.org/licenses/LICENSE-2.0
12#
13#  Unless required by applicable law or agreed to in writing,
14#  software distributed under the License is distributed on an
15#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16#  KIND, either express or implied.  See the License for the
17#  specific language governing permissions and limitations
18#  under the License.
19#
20#**************************************************************
21
22
23
24# Common tools - move this to the end / consolidate
25TRANSEX*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/transex3
26ULFEX*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/ulfex
27XMLEX*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/xmlex
28XRMEX*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/xrmex
29CFGEX*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/cfgex
30AUTODOC*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/autodoc
31LOCALIZE_SL*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/localize_sl
32GSICHECK*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/gsicheck
33
34.IF "$(SYSTEM_LIBXSLT)"!="YES"
35XSLTPROC*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/xsltproc
36.ELSE			# "$(SYSTEM_LIBXSLT)"!="YES"
37XSLTPROC*=$(AUGMENT_LIBRARY_PATH) xsltproc
38.ENDIF			# "$(SYSTEM_LIBXSLT)"!="YES"
39
40ULFCONV*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/ulfconv
41
42MAKEDEPEND*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/makedepend
43
44SCP_CHECK_TOOL:=checkscp$E
45
46# iz32110: Calling a cygwin application from a non-cygwin shell requires
47# backslashes to be escaped by another backslash: EES .. extra escape slash
48EES:=
49
50# iz29675: 4nt must not quote special characters, but tcsh has to.
51# *NIX shells needs to use " quotes, but 4nt must not.
52# EMQ .. extra meta quote (\\ at line end is \)
53# USQ .. unix shell  quote
54EMQ:=\\
55USQ:="
56
57.IF "$(GUI)" == "OS2"
58NULLDEV:=NUL
59.ELSE
60NULLDEV:=/dev/null
61.ENDIF
62
63
64# iz29609 helpmacro to check if file exists
65IFEXIST:=if [ -f
66IFDIREXIST:=if [ -d
67IFNOTEXIST:= if ! test -f
68THEN:= ] ; then
69FI:= ; fi
70PIPEERROR=2>&1 |
71
72# iz31658
73CHECKZIPRESULT:=|| ret=$$?; if [[ "$$ret" != "12" && "$$ret" != "1" ]] ; then exit $$ret ; fi && echo "Nothing to update for zip"
74
75# Platform specific
76.IF "$(GUI)"=="WNT"
77AWK*=awk
78SORT*=sort
79SED*=sed
80GNUPATCH*=patch
81# change drive and directory
82CDD=cd
83# expect cygwin tools to exist
84COPY*=cp
85COPYRECURSE=-r
86DEREFERENCE=-L
87COPYUPDATE=-u
88ECHON=echo -n
89ECHONL=echo
90FIND*=find
91FLIPCMD*=$(PERL) $(SOLARENV)/bin/slfl.pl
92GNUCOPY*=cp
93GNUMAKE*=make
94GREP*=grep
95LS*=ls
96PERL*:=perl
97.EXPORT : PERL
98RENAME*=mv
99TOUCH*=touch
100TYPE*=cat
101DUMPBIN*=dumpbin
102
103.ELIF "$(GUI)"=="UNX"	# "$(GUI)"=="WNT"
104SED*=sed
105SORT*=sort
106PERL*=perl
107.EXPORT : PERL
108TYPE=cat
109CDD=cd
110COPY=cp -f
111.IF "$(OS)"=="MACOSX" || "$(OS)"=="FREEBSD"
112COPYRECURSE=-R
113.ELSE # Not BSD based
114COPYRECURSE=-r
115.ENDIF
116.IF "$(OS)"=="SOLARIS"
117AWK*=nawk
118GNUCOPY*=gnucp
119GNUPATCH*=gnupatch
120GNUTAR*=/usr/sfw/bin/gtar
121DEREFERENCE=
122.ELSE			# "$(OS)"=="SOLARIS"
123AWK*=awk
124# this is not true, as BSD does not default to a GNU cp, but BSD cp
125# so in dmake makefiles one should be restricted to use the subset
126# of features that both BSD and GNU make support.
127# as the GNU make build system requires GNUCOPY to really be a GNU copy
128# we work around that for now by not setting GNUCOPY in sdev300.ini
129# for fbsd for now, but for all other platforms it is set.
130GNUCOPY*=cp
131GNUPATCH*=patch
132GPERF*=gperf
133DEREFERENCE=-L
134.ENDIF			# "$(OS)"=="SOLARIS"
135.IF "$(OS)"=="LINUX" || "$(OS)"=="MACOSX"
136GNUMAKE*=make
137.ELSE			# "$(OS)"=="LINUX" || "$(OS)"=="MACOSX"
138GNUMAKE*=gmake
139.ENDIF			# "$(OS)"=="LINUX" || "$(OS)"=="MACOSX"
140TOUCH=touch
141RENAME=mv
142GREP=grep
143FIND=find
144LS=ls
145ECHON=echo -n
146ECHONL=echo
147.ELIF "$(GUI)"=="OS2"
148GPERF*=gperf
149SED*=sed
150SORT*=sort
151PERL*=perl
152TYPE=cat
153CDD=@cd
154COPY=cp -f
155COPYRECURSE=-r
156COPYUPDATE=-u
157DELAY=sleep
158ECHON*=echo -n
159ECHONL=echo
160AWK*=awk
161GNUCOPY*=cp
162GNUPATCH*=gnupatch
163GNUMAKE*=make
164TOUCH=touch
165#YD rename doesn't work across different drives!
166RENAME=mv
167GREP=grep
168FIND=find
169LS=ls
170DUMPBIN=echo
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