Fail if we can't change to a directory

This commit is contained in:
Ondřej Kuzník 2018-07-25 16:18:20 +01:00
parent 8ee03cea88
commit 0f320b3442
3 changed files with 20 additions and 20 deletions

View file

@ -35,4 +35,4 @@ distclean: veryclean FORCE
check: test check: test
test: FORCE test: FORCE
cd tests; $(MAKE) test cd tests && $(MAKE) test

View file

@ -21,7 +21,7 @@ all-common: FORCE
@echo "Making all in `$(PWD)`" @echo "Making all in `$(PWD)`"
@for i in $(SUBDIRS) $(ALLDIRS); do \ @for i in $(SUBDIRS) $(ALLDIRS); do \
echo " Entering subdirectory $$i"; \ echo " Entering subdirectory $$i"; \
( cd $$i; $(MAKE) $(MFLAGS) all ); \ ( cd $$i && $(MAKE) $(MFLAGS) all ); \
if test $$? != 0 ; then exit 1; fi ; \ if test $$? != 0 ; then exit 1; fi ; \
echo " "; \ echo " "; \
done done
@ -30,7 +30,7 @@ install-common: FORCE
@echo "Making install in `$(PWD)`" @echo "Making install in `$(PWD)`"
@for i in $(SUBDIRS) $(INSTALLDIRS); do \ @for i in $(SUBDIRS) $(INSTALLDIRS); do \
echo " Entering subdirectory $$i"; \ echo " Entering subdirectory $$i"; \
( cd $$i; $(MAKE) $(MFLAGS) install ); \ ( cd $$i && $(MAKE) $(MFLAGS) install ); \
if test $$? != 0 ; then exit 1; fi ; \ if test $$? != 0 ; then exit 1; fi ; \
echo " "; \ echo " "; \
done done
@ -39,7 +39,7 @@ clean-common: FORCE
@echo "Making clean in `$(PWD)`" @echo "Making clean in `$(PWD)`"
@for i in $(SUBDIRS) $(CLEANDIRS); do \ @for i in $(SUBDIRS) $(CLEANDIRS); do \
echo " Entering subdirectory $$i"; \ echo " Entering subdirectory $$i"; \
( cd $$i; $(MAKE) $(MFLAGS) clean ); \ ( cd $$i && $(MAKE) $(MFLAGS) clean ); \
if test $$? != 0 ; then exit 1; fi ; \ if test $$? != 0 ; then exit 1; fi ; \
echo " "; \ echo " "; \
done done
@ -48,7 +48,7 @@ veryclean-common: FORCE
@echo "Making veryclean in `$(PWD)`" @echo "Making veryclean in `$(PWD)`"
@for i in $(SUBDIRS) $(CLEANDIRS); do \ @for i in $(SUBDIRS) $(CLEANDIRS); do \
echo " Entering subdirectory $$i"; \ echo " Entering subdirectory $$i"; \
( cd $$i; $(MAKE) $(MFLAGS) veryclean ); \ ( cd $$i && $(MAKE) $(MFLAGS) veryclean ); \
if test $$? != 0 ; then exit 1; fi ; \ if test $$? != 0 ; then exit 1; fi ; \
echo " "; \ echo " "; \
done done
@ -57,7 +57,7 @@ depend-common: FORCE
@echo "Making depend in `$(PWD)`" @echo "Making depend in `$(PWD)`"
@for i in $(SUBDIRS) $(DEPENDDIRS); do \ @for i in $(SUBDIRS) $(DEPENDDIRS); do \
echo " Entering subdirectory $$i"; \ echo " Entering subdirectory $$i"; \
( cd $$i; $(MAKE) $(MFLAGS) depend ); \ ( cd $$i && $(MAKE) $(MFLAGS) depend ); \
if test $$? != 0 ; then exit 1; fi ; \ if test $$? != 0 ; then exit 1; fi ; \
echo " "; \ echo " "; \
done done

View file

@ -260,7 +260,7 @@ slapd.exp: libslapd.a
--base-file slapd.base --output-exp $@ --base-file slapd.base --output-exp $@
slapi/libslapi.la: FORCE slapi/libslapi.la: FORCE
(cd slapi; $(MAKE) $(MFLAGS) all) cd slapi && $(MAKE) $(MFLAGS) all
slapd: $(SLAPD_DEPENDS) @LIBSLAPI@ slapd: $(SLAPD_DEPENDS) @LIBSLAPI@
$(LTLINK) -o $@ $(SLAPD_OBJECTS) $(LIBS) \ $(LTLINK) -o $@ $(SLAPD_OBJECTS) $(LIBS) \
@ -274,11 +274,11 @@ sslapd: version.o
$(LTLINK) -static -o $@ $(OBJS) version.o $(LIBS) $(WRAP_LIBS) $(LTLINK) -static -o $@ $(OBJS) version.o $(LIBS) $(WRAP_LIBS)
dummy $(SLAPD_DYNAMIC_BACKENDS): slapd dummy $(SLAPD_DYNAMIC_BACKENDS): slapd
cd $@; $(MAKE) $(MFLAGS) all cd $@ && $(MAKE) $(MFLAGS) all
@touch $@ @touch $@
dynamic_overlays: slapd dynamic_overlays: slapd
cd overlays; $(MAKE) $(MFLAGS) dynamic cd overlays && $(MAKE) $(MFLAGS) dynamic
# #
# In Windows, dynamic backends have to be built after slapd. For this # In Windows, dynamic backends have to be built after slapd. For this
@ -289,8 +289,8 @@ dynamic_overlays: slapd
echo "building static backends..."; \ echo "building static backends..."; \
for i in XX $(SLAPD_STATIC_BACKENDS); do \ for i in XX $(SLAPD_STATIC_BACKENDS); do \
if test $$i != XX; then \ if test $$i != XX; then \
echo " "; echo " cd $$i; $(MAKE) $(MFLAGS) all"; \ echo " "; echo " cd $$i && $(MAKE) $(MFLAGS) all"; \
( cd $$i; $(MAKE) $(MFLAGS) all ); \ ( cd $$i && $(MAKE) $(MFLAGS) all ); \
if test $$? != 0; then exit 1; fi; \ if test $$? != 0; then exit 1; fi; \
fi; \ fi; \
done; \ done; \
@ -322,7 +322,7 @@ libbackends.a: .backend
@ls -l libbackends.a; echo "" @ls -l libbackends.a; echo ""
liboverlays.a: FORCE liboverlays.a: FORCE
cd overlays; $(MAKE) $(MFLAGS) static cd overlays && $(MAKE) $(MFLAGS) static
version.c: Makefile version.c: Makefile
@-$(RM) $@ @-$(RM) $@
@ -335,8 +335,8 @@ backends.o: backends.c $(srcdir)/slap.h
depend-local-srv: FORCE depend-local-srv: FORCE
@for i in $(SUBDIRS); do \ @for i in $(SUBDIRS); do \
if test -d $$i && test -f $$i/Makefile ; then \ if test -d $$i && test -f $$i/Makefile ; then \
echo; echo " cd $$i; $(MAKE) $(MFLAGS) depend"; \ echo; echo " cd $$i && $(MAKE) $(MFLAGS) depend"; \
( cd $$i; $(MAKE) $(MFLAGS) depend ); \ ( cd $$i && $(MAKE) $(MFLAGS) depend ); \
if test $$? != 0 ; then exit 1; fi ; \ if test $$? != 0 ; then exit 1; fi ; \
fi; \ fi; \
done done
@ -351,8 +351,8 @@ veryclean-local:
clean-local-srv: FORCE clean-local-srv: FORCE
@for i in $(SUBDIRS); do \ @for i in $(SUBDIRS); do \
if test -d $$i && test -f $$i/Makefile ; then \ if test -d $$i && test -f $$i/Makefile ; then \
echo; echo " cd $$i; $(MAKE) $(MFLAGS) clean"; \ echo; echo " cd $$i && $(MAKE) $(MFLAGS) clean"; \
( cd $$i; $(MAKE) $(MFLAGS) clean ); \ ( cd $$i && $(MAKE) $(MFLAGS) clean ); \
if test $$? != 0 ; then exit 1; fi ; \ if test $$? != 0 ; then exit 1; fi ; \
fi; \ fi; \
done done
@ -361,8 +361,8 @@ clean-local-srv: FORCE
veryclean-local-srv: FORCE veryclean-local-srv: FORCE
@for i in $(SUBDIRS); do \ @for i in $(SUBDIRS); do \
if test -d $$i && test -f $$i/Makefile ; then \ if test -d $$i && test -f $$i/Makefile ; then \
echo; echo " cd $$i; $(MAKE) $(MFLAGS) clean"; \ echo; echo " cd $$i && $(MAKE) $(MFLAGS) clean"; \
( cd $$i; $(MAKE) $(MFLAGS) veryclean ); \ ( cd $$i && $(MAKE) $(MFLAGS) veryclean ); \
fi; \ fi; \
done done
@ -382,8 +382,8 @@ install-slapd: FORCE
slapd$(EXEEXT) $(DESTDIR)$(libexecdir) slapd$(EXEEXT) $(DESTDIR)$(libexecdir)
@for i in $(SUBDIRS); do \ @for i in $(SUBDIRS); do \
if test -d $$i && test -f $$i/Makefile ; then \ if test -d $$i && test -f $$i/Makefile ; then \
echo; echo " cd $$i; $(MAKE) $(MFLAGS) install"; \ echo; echo " cd $$i && $(MAKE) $(MFLAGS) install"; \
( cd $$i; $(MAKE) $(MFLAGS) install ); \ ( cd $$i && $(MAKE) $(MFLAGS) install ); \
if test $$? != 0 ; then exit 1; fi ; \ if test $$? != 0 ; then exit 1; fi ; \
fi; \ fi; \
done done