xref: /aoo42x/main/solenv/inc/unitools.mk (revision 2b25ddf3)
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
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" || "$(OS)"=="FREEBSD"
111COPYRECURSE=-R
112.ELSE # Not BSD based
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
131GPERF*=gperf
132DEREFERENCE=-L
133.ENDIF			# "$(OS)"=="SOLARIS"
134.IF "$(OS)"=="LINUX" || "$(OS)"=="MACOSX"
135GNUMAKE*=make
136.ELSE			# "$(OS)"=="LINUX" || "$(OS)"=="MACOSX"
137GNUMAKE*=gmake
138.ENDIF			# "$(OS)"=="LINUX" || "$(OS)"=="MACOSX"
139TOUCH=touch
140RENAME=mv
141GREP=grep
142FIND=find
143LS=ls
144ECHON=echo -n
145ECHONL=echo
146.ELIF "$(GUI)"=="OS2"
147GPERF*=gperf
148SED*=sed
149SORT*=sort
150PERL*=perl
151TYPE=cat
152CDD=@cd
153COPY=cp -f
154COPYRECURSE=-r
155COPYUPDATE=-u
156DELAY=sleep
157ECHON*=echo -n
158ECHONL=echo
159AWK*=awk
160GNUCOPY*=cp
161GNUPATCH*=gnupatch
162GNUMAKE*=make
163TOUCH=touch
164#YD rename doesn't work across different drives!
165RENAME=mv
166MKDIR*=mkdir$E
167MKDIRHIER*=mkdir$E -p
168GREP=grep
169FIND=find
170LS=ls
171DUMPBIN=echo
172
173.ENDIF			# "$(GUI)"=="UNX"
174
175# (Global) Set if not set before
176DELAY*=sleep
177MKDIR*=mkdir$E
178MKDIRHIER*=mkdir$E -p
179RMDIR*=rmdir
180XARGS*=xargs
181GNUTAR*:=tar
182
183RM+=$(RMFLAGS)
184ADJUSTVISIBILITY*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/adjustvisibility
185CONVERT*:=$(PERL) $(SOLARENV)/bin/leconvert.pl
186EXECTEST := $(PERL) -w $(SOLARENV)/bin/exectest.pl
187GCCINSTLIB:=$(PERL) -w $(SOLARENV)/bin/gccinstlib.pl
188
189# The dmake $(PWD) apparantly produces paths with symlinks resolved, while the
190# bash pwd command by default produces paths with unresolved symlinks, so that
191# computing PATH_IN_MODULE in settings.mk would fail without the -P flag to the
192# bash pwd command:
193PWDFLAGS = -P
194