Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
halo
build
Commits
cc6be0a3
Commit
cc6be0a3
authored
10 years ago
by
Ed Heyl
Browse files
Options
Download
Email Patches
Plain Diff
wrap make and print success/failure message, more later
Change-Id: I48a4687d81bc4b950a1be42b34d2f0d76733574a
parent
b574564f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
2 deletions
+33
-2
envsetup.sh
envsetup.sh
+33
-2
No files found.
envsetup.sh
View file @
cc6be0a3
MAKE_UTIL
=(
`
which make
`
)
function
hmm
()
{
cat
<<
EOF
Invoke ". build/envsetup.sh" from your shell to add the following functions to your environment:
...
...
@@ -36,7 +37,7 @@ function get_abs_build_var()
return
fi
(
\c
d
$T
;
CALLED_FROM_SETUP
=
true
BUILD_SYSTEM
=
build/core
\
make
--no-print-directory
-f
build/core/config.mk dumpvar-abs-
$1
)
$MAKE_UTIL
--no-print-directory
-f
build/core/config.mk dumpvar-abs-
$1
)
}
# Get the exact value of a build variable.
...
...
@@ -48,7 +49,7 @@ function get_build_var()
return
fi
(
\c
d
$T
;
CALLED_FROM_SETUP
=
true
BUILD_SYSTEM
=
build/core
\
make
--no-print-directory
-f
build/core/config.mk dumpvar-
$1
)
$MAKE_UTIL
--no-print-directory
-f
build/core/config.mk dumpvar-
$1
)
}
# check to see if the supplied product is one we can build
...
...
@@ -1477,6 +1478,36 @@ function pez {
return
$retval
}
function
make
()
{
local
start_time
=
$(
date
+
"%s"
)
$MAKE_UTIL
$@
local
ret
=
$?
local
end_time
=
$(
date
+
"%s"
)
local
tdiff
=
$((
$end_time
-
$start_time
))
local
hours
=
$((
$tdiff
/
3600
))
local
mins
=
$((
(
$tdiff
%
3600
)
/
60
))
local
secs
=
$((
$tdiff
%
60
))
echo
if
[
$ret
-eq
0
]
;
then
echo
-n
-e
"
\e
[0;32m#### make completed successfully "
else
echo
-n
-e
"
\e
[0;31m#### make failed to build some targets "
fi
if
[
$hours
-gt
0
]
;
then
printf
"(%02g:%02g:%02g (hh:mm:ss))"
$hours
$mins
$secs
elif
[
$mins
-gt
0
]
;
then
printf
"(%02g:%02g (mm:ss))"
$mins
$secs
elif
[
$secs
-gt
0
]
;
then
printf
"(%s seconds)"
$secs
fi
echo
-e
" ####
\e
[00m"
echo
return
$ret
}
if
[
"x
$SHELL
"
!=
"x/bin/bash"
]
;
then
case
`
ps
-o
command
-p
$$
`
in
*
bash
*
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment