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

[analysis-scripts] add fallback when /usr/bin/time does not exist

parent 7b81fb76
No related branches found
No related tags found
No related merge requests found
...@@ -74,14 +74,26 @@ endif ...@@ -74,14 +74,26 @@ endif
UNAME := $(shell uname -s) UNAME := $(shell uname -s)
ifeq ($(UNAME),Darwin) ifeq ($(UNAME),Darwin)
SED_UNBUFFERED:=sed SED_UNBUFFERED:=sed
ifneq (,$(wildcard /usr/bin/time))
define time_with_output define time_with_output
/usr/bin/time -p /usr/bin/time -p
endef endef
else
define time_with_output
time
endef
endif
else else
SED_UNBUFFERED:=sed --unbuffered SED_UNBUFFERED:=sed --unbuffered
ifneq (,$(wildcard /usr/bin/time))
define time_with_output define time_with_output
/usr/bin/time --format='user_time=%U\nmemory=%M' --output="$(1)" /usr/bin/time --format='user_time=%U\nmemory=%M' --output="$(1)"
endef endef
else
define time_with_output
time
endef
endif
endif endif
# --- Utilities --- # --- Utilities ---
......
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