Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
0a8a5624
Commit
0a8a5624
authored
3 years ago
by
Virgile Prevosto
Committed by
Andre Maroneze
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[scripts] more portable detection of 'time' command, take 2
parent
ec24b5df
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
share/analysis-scripts/analysis.mk
+5
-5
5 additions, 5 deletions
share/analysis-scripts/analysis.mk
with
5 additions
and
5 deletions
share/analysis-scripts/analysis.mk
+
5
−
5
View file @
0a8a5624
...
@@ -70,12 +70,12 @@ endif
...
@@ -70,12 +70,12 @@ endif
SED_UNBUFFERED
:=
sed
$(
shell
sed
--unbuffered
//p /dev/null 2>/dev/null
&&
echo
" --unbuffered"
||
true
)
SED_UNBUFFERED
:=
sed
$(
shell
sed
--unbuffered
//p /dev/null 2>/dev/null
&&
echo
" --unbuffered"
||
true
)
# If there is a GNU time in the PATH, which contains the desired options
# If there is a GNU time in the PATH, which contains the desired options
# (-f and -o,
whose presence is tested using the --help message),
# (-f and -o
)
,
use them; otherwise, use any time (be it a shell builtin
#
use them; otherwise, use any time (be it a shell builtin or a command).
#
or a command). 'env' allows bypassing shell builtins (if they exist),
#
Note: usage of 'env' is necessary to avoid invoking a shell builtin
.
#
since they usually don't have the required options
.
if
n
eq
(
1
,$(shell env time -
-help | grep -C100 '\-f' | grep '\-o' -q;
echo
$$?
))
ifeq
(
OK
,$(shell env time -
f 'test' -o '/dev/null' echo OK ||
echo
KO
))
define
time_with_output
define
time_with_output
$(
shell
which
time
)
-f
'user_time=%U\nmemory=%M'
-o
"$(1)"
env
time
-f
'user_time=%U\nmemory=%M'
-o
"$(1)"
endef
endef
else
else
define
time_with_output
define
time_with_output
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment