xref: /aoo41x/main/solenv/inc/unitools.mk (revision 7871dc3e)
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
57NULLDEV:=/dev/null
58
59
60# iz29609 helpmacro to check if file exists
61IFEXIST:=if [ -f
62IFNOTEXIST:= if ! test -f
63THEN:= ] ; then
64FI:= ; fi
65PIPEERROR=2>&1 |
66
67# iz31658
68CHECKZIPRESULT:=|| ret=$$?; if [[ "$$ret" != "12" && "$$ret" != "1" ]] ; then exit $$ret ; fi && echo "Nothing to update for zip"
69
70# Platform specific
71.IF "$(GUI)"=="WNT"
72AWK*=awk
73SORT*=sort
74SED*=sed
75GNUPATCH*=patch
76# change drive and directory
77CDD=cd
78# expect cygwin tools to exist
79COPY*=cp
80COPYRECURSE=-r
81DEREFERENCE=-L
82COPYUPDATE=-u
83ECHON=echo -n
84ECHONL=echo
85FIND*=find
86FLIPCMD*=$(PERL) $(SOLARENV)/bin/slfl.pl
87GNUCOPY*=cp
88GNUMAKE*=make
89GREP*=grep
90LS*=ls
91PERL*:=perl
92.EXPORT : PERL
93RENAME*=mv
94TOUCH*=touch
95TYPE*=cat
96DUMPBIN*=dumpbin
97
98.ELIF "$(GUI)"=="UNX"	# "$(GUI)"=="WNT"
99SED*=sed
100SORT*=sort
101PERL*=perl
102.EXPORT : PERL
103TYPE=cat
104CDD=cd
105COPY=cp -f
106.IF "$(OS)"=="MACOSX"
107COPYRECURSE=-R
108.ELSE #"$(OS)"=="MACOSX"
109COPYRECURSE=-r
110.ENDIF
111.IF "$(OS)"=="SOLARIS"
112AWK*=nawk
113GNUCOPY*=gnucp
114GNUPATCH*=gnupatch
115GNUTAR*=/usr/sfw/bin/gtar
116DEREFERENCE=
117.ELSE			# "$(OS)"=="SOLARIS"
118AWK*=awk
119# this is not true, as BSD does not default to a GNU cp, but BSD cp
120# so in dmake makefiles one should be restricted to use the subset
121# of features that both BSD and GNU make support.
122# as the GNU make build system requires GNUCOPY to really be a GNU copy
123# we work around that for now by not setting GNUCOPY in sdev300.ini
124# for fbsd for now, but for all other platforms it is set.
125GNUCOPY*=cp
126GNUPATCH*=patch
127DEREFERENCE=-L
128.ENDIF			# "$(OS)"=="SOLARIS"
129.IF "$(OS)"=="LINUX" || "$(OS)"=="MACOSX"
130GNUMAKE*=make
131.ELSE			# "$(OS)"=="LINUX" || "$(OS)"=="MACOSX"
132GNUMAKE*=gmake
133.ENDIF			# "$(OS)"=="LINUX" || "$(OS)"=="MACOSX"
134TOUCH=touch
135RENAME=mv
136GREP=grep
137FIND=find
138LS=ls
139ECHON=echo -n
140ECHONL=echo
141.ELIF "$(GUI)"=="OS2"
142SED*=sed
143SORT*=sort
144PERL*=perl
145TYPE=cat
146CDD=@cd
147COPY*=$(SHELL) /c copy /b
148COPYRECURSE=/s
149COPYUPDATE=/u
150DELAY=sleep
151ECHON*=echos
152ECHONL=+echo.
153AWK*=awk
154GNUCOPY*=cp
155GNUPATCH*=gnupatch
156GNUMAKE*=make
157TOUCH=touch /c
158#YD rename doesn't work across different drives!
159RENAME=mv
160MKDIR=+md
161MKDIRHIER=+md /s
162GREP=grep
163FIND=find
164LS=ls
165DUMPBIN=echo
1664nt_force_shell:=+
167
168.ENDIF			# "$(GUI)"=="UNX"
169
170# (Global) Set if not set before
171DELAY*=sleep
172MKDIR*=mkdir$E
173MKDIRHIER*=mkdir$E -p
174RMDIR*=rmdir
175XARGS*=xargs
176GNUTAR*:=tar
177
178RM+=$(RMFLAGS)
179ADJUSTVISIBILITY*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/adjustvisibility
180CONVERT*:=$(PERL) $(SOLARENV)/bin/leconvert.pl
181EXECTEST := $(PERL) -w $(SOLARENV)/bin/exectest.pl
182GCCINSTLIB:=$(PERL) -w $(SOLARENV)/bin/gccinstlib.pl
183
184# The dmake $(PWD) apparantly produces paths with symlinks resolved, while the
185# bash pwd command by default produces paths with unresolved symlinks, so that
186# computing PATH_IN_MODULE in settings.mk would fail without the -P flag to the
187# bash pwd command:
188PWDFLAGS = -P
189