dir: Set srcdir correctly in src/dir/test 84/14384/2
authorAndrew Deason <adeason@sinenomine.net>
Tue, 13 Oct 2020 17:17:37 +0000 (12:17 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Thu, 15 Oct 2020 03:04:20 +0000 (23:04 -0400)
srcdir is a magic variable that needs to be set to @srcdir@, not some
relative path like ../../.. (which will usually be somewhere in the
objdir, not srcdir). Set it correctly in here.

Without this, objdir builds can fail with:

    make[4]: Entering directory '...obj/src/dir/test'
    make[4]: *** No rule to make target 'dtest.o', needed by 'dtest'.  Stop.

Which happens because the automatic rule for dtest.o can't be
constructed, since we cannot find dtest.c automatically because srcdir
isn't set properly.

This has been broken since commit 37b4195d (dtest-20021111), but was
not noticeable until commit 192a2ff4 (dir: make dtest buildable
again), since that caused dtest to actually get built.

Also set LIBS correctly in here, using the conventional ${TOP_LIBDIR},
since ${srcdir} no longer points to "../../..".

Change-Id: I539e01a4397c558dc0eda492834b3f9913f71634
Reviewed-on: https://gerrit.openafs.org/14384
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

src/dir/test/Makefile.in

index d2a1eb8..29824ea 100644 (file)
@@ -5,13 +5,13 @@
 # License.  For details, see the LICENSE file in the top-level source
 # directory or online at http://www.openafs.org/dl/license10.html
 
-srcdir=../../..
+srcdir=@srcdir@
 include @TOP_OBJDIR@/src/config/Makefile.config
 include @TOP_OBJDIR@/src/config/Makefile.lwp
 
 
-LIBS = ${srcdir}/lib/libdir.a ${srcdir}/lib/liblwp.a \
-          ${srcdir}/lib/libopr.a
+LIBS = ${TOP_LIBDIR}/libdir.a ${TOP_LIBDIR}/liblwp.a \
+          ${TOP_LIBDIR}/libopr.a
 
 all:   dtest