From b17d4d91359078a00ec60e6016b8c5c9c6b41a91 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Mon, 20 Nov 2017 16:18:03 -0700 Subject: [PATCH] build: only touch output if build is successful Running the 'touch' command unconditionally causes the compile step to return 0 even if the compilation failed. Instead, only run it if the compiler succeeded. Fixes: 4f1634435640 ("make: Update build artifact timestamps for clang support") Change-Id: I46907851fde8bb9e3f73549276e489b6c30ed1fd Signed-off-by: Daniel Verkamp Reviewed-on: https://review.gerrithub.io/388324 Tested-by: SPDK Automated Test System Reviewed-by: Jim Harris Reviewed-by: --- mk/spdk.common.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mk/spdk.common.mk b/mk/spdk.common.mk index 46e7462bf..037c44844 100644 --- a/mk/spdk.common.mk +++ b/mk/spdk.common.mk @@ -166,12 +166,12 @@ DEPFLAGS = -MMD -MP -MF $*.d.tmp COMPILE_C=\ $(Q)echo " CC $S/$@"; \ $(CC) -o $@ $(DEPFLAGS) $(CFLAGS) -c $< && \ - mv -f $*.d.tmp $*.d;touch -c $@ + mv -f $*.d.tmp $*.d && touch -c $@ COMPILE_CXX=\ $(Q)echo " CXX $S/$@"; \ $(CXX) -o $@ $(DEPFLAGS) $(CXXFLAGS) -c $< && \ - mv -f $*.d.tmp $*.d;touch -c $@ + mv -f $*.d.tmp $*.d && touch -c $@ # Link $(OBJS) and $(LIBS) into $@ (app) LINK_C=\