aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMelody Horn <melody@boringcactus.com>2021-04-14 11:52:16 -0600
committerMelody Horn <melody@boringcactus.com>2021-04-14 11:52:16 -0600
commit41e2af5ad66352fef6fffa4cffa6347bf56bef03 (patch)
tree5ca947ab5764d16510e3cc0824aff27cd0fea460
parent457bcbfd1116f0b3330f9b409395beabffe6ca18 (diff)
downloadmakers-41e2af5ad66352fef6fffa4cffa6347bf56bef03.tar.gz
makers-41e2af5ad66352fef6fffa4cffa6347bf56bef03.zip
define MAKE even if using no-builtins
-rw-r--r--src/makefile/macro.rs1
-rw-r--r--src/makefile/mod.rs12
2 files changed, 12 insertions, 1 deletions
diff --git a/src/makefile/macro.rs b/src/makefile/macro.rs
index 2dfd84f..af7e354 100644
--- a/src/makefile/macro.rs
+++ b/src/makefile/macro.rs
@@ -369,7 +369,6 @@ fn builtins() -> Vec<(&'static str, TokenString)> {
}
make![
- MAKE=(std::env::current_exe().map_or_else(|_| TokenString::text("makers"), |x| TokenString::text(x.to_string_lossy())))
AR=ar
YACC=yacc
YFLAGS=""
diff --git a/src/makefile/mod.rs b/src/makefile/mod.rs
index 228a170..8c50f41 100644
--- a/src/makefile/mod.rs
+++ b/src/makefile/mod.rs
@@ -55,6 +55,18 @@ impl<'a> Makefile<'a> {
let mut targets = HashMap::new();
let first_non_special_target = None;
+ macros.set(
+ "MAKE".to_owned(),
+ Macro {
+ source: ItemSource::Builtin,
+ text: std::env::current_exe().map_or_else(
+ |_| TokenString::text("makers"),
+ |x| TokenString::text(x.to_string_lossy()),
+ ),
+ #[cfg(feature = "full")]
+ eagerly_expanded: false,
+ },
+ );
if !args.no_builtin_rules {
inference_rules.extend(builtin_inference_rules());
macros.add_builtins();