From 8b5579ad7e4154931e468130ccc35c98c2e1d578 Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Mon, 5 Apr 2021 12:56:43 -0600 Subject: set `CURDIR` --- src/makefile/mod.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/makefile/mod.rs b/src/makefile/mod.rs index edc9b6b..308d25d 100644 --- a/src/makefile/mod.rs +++ b/src/makefile/mod.rs @@ -76,6 +76,14 @@ impl<'a> Makefile<'a> { MacroSource::Builtin, TokenString::text(make_cmd_goals.join(" ")), ); + + if let Ok(curdir) = env::current_dir() { + macros.set( + "CURDIR".to_owned(), + MacroSource::Builtin, + TokenString::text(curdir.to_string_lossy()), + ); + } } Makefile { -- cgit v1.2.3