summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-09-07 03:13:19 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-09-07 03:13:19 (GMT)
commitb56961f2787247132483aeb5327018adb6e3b404 (patch)
tree39e27289b94fc3ab94b8929f103b77c396cc6015 /Makefile
parent6849009b8a267d8b350bb12bc9ac26f067af5500 (diff)
downloadeeshow-b56961f2787247132483aeb5327018adb6e3b404.zip
eeshow-b56961f2787247132483aeb5327018adb6e3b404.tar.gz
eeshow-b56961f2787247132483aeb5327018adb6e3b404.tar.bz2
Makefile: serialize linking to avoid concurrent compilations of version.o
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 9 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 48736f4..9b9b8fb 100644
--- a/Makefile
+++ b/Makefile
@@ -90,19 +90,25 @@ include Makefile.c-common
all:: eeshow eeplot eediff eetest
+#
+# We use order-only prerequisites to serialize linking. This is to ensure that
+# a parallel make run won't try to compile version.o more than once at the same
+# time, possibly producing corrupted output.
+#
+
eeshow: $(EESHOW_OBJS)
$(MAKE) -B version.o
$(CC) -o $@ $(EESHOW_OBJS) version.o $(LDLIBS)
-eeplot: $(EEPLOT_OBJS)
+eeplot: $(EEPLOT_OBJS) | eeshow
$(MAKE) -B version.o
$(CC) -o $@ $(EEPLOT_OBJS) version.o $(LDLIBS)
-eediff: $(EEDIFF_OBJS)
+eediff: $(EEDIFF_OBJS) | eeplot
$(MAKE) -B version.o
$(CC) -o $@ $(EEDIFF_OBJS) version.o $(LDLIBS)
-eetest: $(EETEST_OBJS)
+eetest: $(EETEST_OBJS) | eediff
$(MAKE) -B version.o
$(CC) -o $@ $(EETEST_OBJS) version.o $(LDLIBS)