]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
[ng] vars: new variable $(am.conf.is-topdir)
authorStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 9 Aug 2012 22:13:10 +0000 (00:13 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 9 Aug 2012 23:33:15 +0000 (01:33 +0200)
* automake.in (generate_makefile): Define that variable to "yes" if the
Makefile being currently generated is in the top-level directory, define
it to the empty string otherwise.  This offers a way (alternative to the
'%?TOPDIR_P%' transform) to determine whether a recipe is being executed
in the top-level directory or not.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
automake.in

index 3a9cca33f2da70c1db70540a6faa957e1cefebd3..5acd4340adc0247b9473ca713152ecf562628e3d 100644 (file)
@@ -6739,6 +6739,8 @@ sub generate_makefile ($$)
 
   # Must do this after reading .am file.
   define_variable ('subdir', INTERNAL, $relative_dir);
+  define_variable ('am.conf.is-topdir', INTERNAL,
+                   $relative_dir eq '.' ? "yes" : "");
   define_variable ('am.conf.aux-dir', INTERNAL, $am_config_aux_dir);
   define_variable ('am.relpath.makefile', INTERNAL, basename ($makefile));
   define_variable ('am.relpath.makefile.am', INTERNAL,