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
ec24b5df
Commit
ec24b5df
authored
3 years ago
by
Andre Maroneze
Browse files
Options
Downloads
Patches
Plain Diff
[analysis-scripts] simplify checking of 'time' command options
parent
31117906
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
share/analysis-scripts/analysis.mk
+6
-19
6 additions, 19 deletions
share/analysis-scripts/analysis.mk
with
6 additions
and
19 deletions
share/analysis-scripts/analysis.mk
+
6
−
19
View file @
ec24b5df
...
...
@@ -69,32 +69,19 @@ endif
# nor Busybox' have it, in which case we ignore it)
SED_UNBUFFERED
:=
sed
$(
shell
sed
--unbuffered
//p /dev/null 2>/dev/null
&&
echo
" --unbuffered"
||
true
)
# Test if on a Mac;
# test if /usr/bin/time is available, otherwise use the shell builtin
# (which has less options)
UNAME
:=
$(
shell
uname
-s
)
ifeq
($(UNAME),Darwin)
ifneq
(,$(wildcard /usr/bin/time))
# 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),
# use them; otherwise, use any time (be it a shell builtin or a command).
# Note: usage of 'env' is necessary to avoid invoking a shell builtin.
ifneq
(1,$(shell env time --help | grep -C100 '\-f' | grep '\-o' -q; echo $$?))
define
time_with_output
/usr/bin/time
-p
$(
shell
which
time
)
-f
'user_time=%U\nmemory=%M'
-o
"$(1)"
endef
else
define
time_with_output
time
endef
endif
else
TIMEBIN
:=
$(
shell which
-a
time
|
grep
'^/'
)
ifneq
(,$(TIMEBIN))
define
time_with_output
$(TIMEBIN)
-f
'user_time=%U\nmemory=%M'
-o
"$(1)"
endef
else
define
time_with_output
time
endef
endif
endif
# --- Utilities ---
...
...
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