aboutsummaryrefslogtreecommitdiff
path: root/src/makefile
diff options
context:
space:
mode:
authorMelody Horn <melody@boringcactus.com>2021-03-26 21:06:26 -0600
committerMelody Horn <melody@boringcactus.com>2021-03-26 21:06:26 -0600
commit18c80339a728dadaec94b3918eb58c7def68462d (patch)
tree83db3d8f18f405b4429c10a65f5a53e76681e683 /src/makefile
parent6626a20ea9dde169ca75a4e4c83b5fb5b85c1e47 (diff)
downloadmakers-18c80339a728dadaec94b3918eb58c7def68462d.tar.gz
makers-18c80339a728dadaec94b3918eb58c7def68462d.zip
add & remove leading dots in extensions
Diffstat (limited to 'src/makefile')
-rw-r--r--src/makefile/mod.rs11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/makefile/mod.rs b/src/makefile/mod.rs
index f38815d..bd8838a 100644
--- a/src/makefile/mod.rs
+++ b/src/makefile/mod.rs
@@ -36,7 +36,7 @@ impl fmt::Display for InferenceRule {
}
}
-#[derive(PartialEq, Eq, Clone)]
+#[derive(PartialEq, Eq, Clone, Debug)]
pub struct Target {
name: String,
prerequisites: Vec<String>,
@@ -161,11 +161,6 @@ impl CommandLine {
let execution_line = file.expand_macros(&self.execution_line, Some(target));
- let avoid_execution = file.args.dry_run || file.args.question || file.args.touch;
- if avoid_execution && !self.always_execute {
- return;
- }
-
if !silent {
println!("{}", execution_line);
}
@@ -549,7 +544,7 @@ impl Makefile {
if !targets.contains_key(name) || exists_but_infer_anyway {
// When no target rule is found to update a target, the inference rules shall
// be checked. The suffix of the target to be built...
- let suffix = Path::new(name).extension().map_or_else(String::new, |ext| ext.to_string_lossy().into());
+ let suffix = Path::new(name).extension().map_or_else(String::new, |ext| format!(".{}", ext.to_string_lossy()));
// is compared to the list of suffixes specified by the .SUFFIXES special
// targets. If the .s1 suffix is found in .SUFFIXES...
if self.special_target_has_prereq(".SUFFIXES", &suffix) || suffix.is_empty() {
@@ -558,7 +553,7 @@ impl Makefile {
// for the first .s2.s1 rule...
if rule.product == suffix {
// whose prerequisite file ($*.s2) exists.
- let prereq_path = Path::new(name).with_extension(rule.prereq.clone());
+ let prereq_path = Path::new(name).with_extension(rule.prereq.trim_start_matches('.'));
let prereq_path_options = if prereq_path.is_absolute() {
vec![prereq_path]
} else {