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
c8758b3f
Commit
c8758b3f
authored
3 years ago
by
Andre Maroneze
Browse files
Options
Downloads
Patches
Plain Diff
[analysis-scripts] avoid issues with 'sed --unbuffered' in Busybox's sed
parent
35e93ec7
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
-4
6 additions, 4 deletions
share/analysis-scripts/analysis.mk
with
6 additions
and
4 deletions
share/analysis-scripts/analysis.mk
+
6
−
4
View file @
c8758b3f
...
@@ -65,12 +65,15 @@ ifneq (4.0,$(firstword $(sort $(MAKE_VERSION) 4.0)))
...
@@ -65,12 +65,15 @@ ifneq (4.0,$(firstword $(sort $(MAKE_VERSION) 4.0)))
$(error This Makefile requires Make >= 4.0 - available at http
:
//ftp.gnu.org/gnu/make/)
$(error This Makefile requires Make >= 4.0 - available at http
:
//ftp.gnu.org/gnu/make/)
endif
endif
# Test if on a Mac (and therefore sed has fewer options)
# Test if sed has the '--unbuffered' option (GNU sed has, but neither macOS'
# Also test if /usr/bin/time is available, otherwise use the shell builtin
# 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)
# (which has less options)
UNAME
:=
$(
shell
uname
-s
)
UNAME
:=
$(
shell
uname
-s
)
ifeq
($(UNAME),Darwin)
ifeq
($(UNAME),Darwin)
SED_UNBUFFERED
:=
sed
ifneq
(,$(wildcard /usr/bin/time))
ifneq
(,$(wildcard /usr/bin/time))
define
time_with_output
define
time_with_output
/usr/bin/time
-p
/usr/bin/time
-p
...
@@ -81,7 +84,6 @@ define time_with_output
...
@@ -81,7 +84,6 @@ define time_with_output
endef
endef
endif
endif
else
else
SED_UNBUFFERED
:=
sed
--unbuffered
ifneq
(,$(wildcard /usr/bin/time))
ifneq
(,$(wildcard /usr/bin/time))
define
time_with_output
define
time_with_output
/usr/bin/time
-f
'user_time=%U\nmemory=%M'
-o
"$(1)"
/usr/bin/time
-f
'user_time=%U\nmemory=%M'
-o
"$(1)"
...
...
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