aboutsummaryrefslogtreecommitdiffstats
path: root/mtools
diff options
context:
space:
mode:
Diffstat (limited to 'mtools')
-rw-r--r--mtools/Makefile6
1 files changed, 4 insertions, 2 deletions
diff --git a/mtools/Makefile b/mtools/Makefile
index 546e3d14..16d63a69 100644
--- a/mtools/Makefile
+++ b/mtools/Makefile
@@ -1,5 +1,7 @@
-gcc_ok = $(shell if gcc $(1) ../dummy.c -o /dev/null 2>/dev/null; \
- then echo '$(1)'; else echo '$(2)'; fi)
+TMPFILE = $(shell mktemp /tmp/gcc_ok.XXXXXX)
+
+gcc_ok = $(shell tmpf=$(TMPFILE); if gcc $(1) ../dummy.c -o $$tmpf 2>/dev/null; \
+ then echo '$(1)'; else echo '$(2)'; fi; rm -f $$tmpf)
comma := ,
LDHASH := $(call gcc_ok,-Wl$(comma)--hash-style=both,)