Remove autoconf.h on "make distclean".
authorGreg Hudson <ghudson@mit.edu>
Wed, 16 Sep 2009 22:54:59 +0000 (22:54 +0000)
committerGreg Hudson <ghudson@mit.edu>
Wed, 16 Sep 2009 22:54:59 +0000 (22:54 +0000)
Check for the presence of a build in the src tree for "make depend".
Suggest "make distclean" when "make depend" detects a build in the
 src tree or an attempt to make depend in the src tree.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22776 dc483132-0cff-0310-8789-dd5450dbe970

src/config/post.in
src/include/Makefile.in

index 6ac10b05ffa9dcc6eae83c35b6fff3c10b3b8482..023fd4797475322429156c769e7ac1c504fd2b38 100644 (file)
@@ -28,6 +28,11 @@ $(BUILDTOP)/.depend-verify-srcdir:
        @if test "$(srcdir)" = "." ; then \
                echo 1>&2 error: cannot build dependencies with srcdir=. ; \
                echo 1>&2 "(can't distinguish generated files from source files)" ; \
+               echo 1>&2 "Run 'make distclean' and create a separate build dir" ; \
+               exit 1 ; \
+       elif test -f "$(top_srcdir)/include/autoconf.h"; then \
+               echo 1>&2 "error: generated headers found in source tree" ; \
+               echo 1>&2 "Run 'make distclean' in source tree first" ; \
                exit 1 ; \
        else \
                if test -r $(BUILDTOP)/.depend-verify-srcdir; then :; \
index 4c8ca59d493d19fec8ff83ca0ebf3779dbbf62a8..ec6a3f25e0d702caccd792172cbbff842b9cfa69 100644 (file)
@@ -130,6 +130,9 @@ clean-windows::
 clean::
        $(RM) osconf.new $(BUILT_HEADERS)
 
+distclean::
+       $(RM) autoconf.h
+
 install-headers-unix install:: krb5/krb5.h profile.h
        $(INSTALL_DATA) $(srcdir)/krb5.h $(DESTDIR)$(KRB5_INCDIR)$(S)krb5.h
        $(INSTALL_DATA) $(srcdir)/kdb.h $(DESTDIR)$(KRB5_INCDIR)$(S)kdb.h