maint.mk: sc_tight_scope: propagate failure from sub-make
[gnulib.git] / top / maint.mk
index c9ffb95..bbb67ec 100644 (file)
@@ -1398,7 +1398,8 @@ _gl_TS_dir ?= src
 
 ALL_RECURSIVE_TARGETS += sc_tight_scope
 sc_tight_scope: tight-scope.mk
-       @if ! grep '^ *export _gl_TS_headers *=' $(srcdir)/cfg.mk       \
+       @fail=0;                                                        \
+       if ! grep '^ *export _gl_TS_headers *=' $(srcdir)/cfg.mk        \
                > /dev/null                                             \
           && ! grep -w noinst_HEADERS $(srcdir)/$(_gl_TS_dir)/Makefile.am \
                > /dev/null 2>&1; then                                  \
@@ -1410,8 +1411,9 @@ sc_tight_scope: tight-scope.mk
                -f $(abs_top_builddir)/$<                               \
              _gl_tight_scope                                           \
                || fail=1;                                              \
-       fi
-       @rm -f $<
+       fi;                                                             \
+       rm -f $<;                                                       \
+       exit $$fail
 
 tight-scope.mk: $(ME)
        @rm -f $@ $@-t