]> granicus.if.org Git - apache/commitdiff
Simplify last commit by only calling cat once (this should hopefully resolve
authorJustin Erenkrantz <jerenkrantz@apache.org>
Thu, 18 Apr 2002 18:44:03 +0000 (18:44 +0000)
committerJustin Erenkrantz <jerenkrantz@apache.org>
Thu, 18 Apr 2002 18:44:03 +0000 (18:44 +0000)
rbb's concern about maintainability and still address mine about annoying /s).

Don't call mkdir when we are the top-level directory.  We *have* to have
been created before hand.

Also add this fix to the bsd_makefile section.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94703 13f79535-47bb-0310-9956-ffa450edef68

build/fastgen.sh

index 1df631022e6db112d663416bda57b007423052c5..092a5e7eb73a67d7f3b73a711a4281e5fe756ad8 100755 (executable)
@@ -79,42 +79,48 @@ if test "$bsd_makefile" = "yes"; then
   for makefile in $@; do
     echo "creating $makefile"
     dir=`echo $makefile|sed 's%/*[^/][^/]*$%%'`
-    $mkdir_p "$dir/"
 
+    if test -z "$dir"; then
+        real_srcdir=$top_srcdir
+        real_builddir=$top_builddir
+        dir="."
+    else
+        $mkdir_p "$dir/"
+        real_srcdir=$top_srcdir/$dir
+        real_builddir=$top_builddir/$dir
+    fi
     cat - $top_srcdir/$makefile.in <<EOF |sed 's/^include \(.*\)/.include "\1"/' >$makefile 
 top_srcdir   = $top_srcdir
 top_builddir = $top_builddir
-srcdir       = $top_srcdir/$dir
-builddir     = $top_builddir/$dir
-VPATH        = $top_srcdir/$dir
+srcdir       = $real_srcdir
+builddir     = $real_builddir
+VPATH        = $real_srcdir
 EOF
     
-    test -z "$dir" && dir="."
     touch $dir/.deps
   done
 else  
   for makefile in $@; do
     echo "creating $makefile"
     dir=`echo $makefile|sed 's%/*[^/][^/]*$%%'`
-    $mkdir_p "$dir/"
+
     if test -z "$dir"; then
-        cat - $top_srcdir/$makefile.in <<EOF >$makefile
-top_srcdir   = $top_srcdir
-top_builddir = $top_builddir
-srcdir       = $top_srcdir
-builddir     = $top_builddir
-VPATH        = $top_srcdir
-EOF
+        real_srcdir=$top_srcdir
+        real_builddir=$top_builddir
         dir="."
     else
-        cat - $top_srcdir/$makefile.in <<EOF >$makefile
+        $mkdir_p "$dir/"
+        real_srcdir=$top_srcdir/$dir
+        real_builddir=$top_builddir/$dir
+    fi
+    cat - $top_srcdir/$makefile.in <<EOF >$makefile
 top_srcdir   = $top_srcdir
 top_builddir = $top_builddir
-srcdir       = $top_srcdir/$dir
-builddir     = $top_builddir/$dir
-VPATH        = $top_srcdir/$dir
+srcdir       = $real_srcdir
+builddir     = $real_builddir
+VPATH        = $real_srcdir
 EOF
-    fi 
+
     touch $dir/.deps
   done
 fi