diff options
author | Jason Gross <jgross@mit.edu> | 2017-06-09 17:52:48 -0400 |
---|---|---|
committer | Jason Gross <jgross@mit.edu> | 2017-07-08 20:09:54 -0400 |
commit | 31098bfe8fa98a072330b851afb3a4f0916527ab (patch) | |
tree | 2b3839fe8f8b213d51300f58b7b14e5903bdf9b8 /Makefile.build | |
parent | ba7129f547d1f06c7eb67412404445681d22b920 (diff) |
Fix TIMED=1 on Mac OSX
This closes [bug #5596](https://coq.inria.fr/bugs/show_bug.cgi?id=5596).
Diffstat (limited to 'Makefile.build')
-rw-r--r-- | Makefile.build | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/Makefile.build b/Makefile.build index 05d751f54..3f870ed17 100644 --- a/Makefile.build +++ b/Makefile.build @@ -101,7 +101,21 @@ DEPENDENCIES := \ ########################################################################### # Default timing command -STDTIME=/usr/bin/time -f "$* (real: %e, user: %U, sys: %S, mem: %M ko)" +# Use /usr/bin/time on linux, gtime on Mac OS +TIMEFMT?="$* (real: %e, user: %U, sys: %S, mem: %M ko)" +ifneq (,$(TIMED)) +ifeq (0,$(shell /usr/bin/time -f $(TIMEFMT) true >/dev/null 2>/dev/null; echo $$?)) +STDTIME?=/usr/bin/time -f $(TIMEFMT) +else +ifeq (0,$(shell gtime -f $(TIMEFMT) true >/dev/null 2>/dev/null; echo $$?)) +STDTIME?=gtime -f $(TIMEFMT) +else +STDTIME?=time +endif +endif +else +STDTIME?=/usr/bin/time -f $(TIMEFMT) +endif TIMER=$(if $(TIMED), $(STDTIME), $(TIMECMD)) |