From: Justin Erenkrantz Date: Mon, 17 Feb 2003 01:00:50 +0000 (+0000) Subject: Rework the delete-exports target once more. Leave a comment there explaining X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b2563c86bb1e482f313e908f22655dab09efe0bc;p=apache Rework the delete-exports target once more. Leave a comment there explaining why we have to be complicated. (Why make's dependency code doesn't catch this, I don't know.) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98683 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/Makefile.in b/server/Makefile.in index 2314051816..74bb1a0594 100644 --- a/server/Makefile.in +++ b/server/Makefile.in @@ -32,14 +32,22 @@ util.lo: test_char.h EXPORT_DIRS = $(top_srcdir)/include $(top_srcdir)/os/$(OS_DIR) $(APR_INCLUDEDIR) $(APU_INCLUDEDIR) $(top_srcdir)/modules/http -delete-exports: export_files +# If export_files is a dependency here, but we remove it during this stage, +# when exports.c is generated, make will not detect that export_files is no +# longer here and deadlock. So, export_files can't be a dependency of +# delete-exports. +delete-exports: @if test -f exports.c; then \ - files=`cat $?`; \ - headers="`find $$files -newer exports.c`"; \ - if test -n "$$headers"; then \ - echo Found newer headers. Will rebuild exports.c.; \ - echo rm -f exports.c export_files; \ - rm -f exports.c export_files; \ + if test -f export_files; then \ + files=`cat export_files`; \ + headers="`find $$files -newer exports.c`"; \ + if test -n "$$headers"; then \ + echo Found newer headers. Will rebuild exports.c.; \ + echo rm -f exports.c export_files; \ + rm -f exports.c export_files; \ + fi; \ + else \ + rm -f exports.c; \ fi; \ fi