Skip to content
Snippets Groups Projects
Commit c8758b3f authored by Andre Maroneze's avatar Andre Maroneze
Browse files

[analysis-scripts] avoid issues with 'sed --unbuffered' in Busybox's sed

parent 35e93ec7
No related branches found
No related tags found
No related merge requests found
...@@ -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)"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment