From a61f65cbd5aea86715689527aad2a4f1c5063b99 Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Tue, 6 Apr 2021 19:27:05 -0600 Subject: implement function `abspath` --- src/makefile/functions.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/makefile/functions.rs b/src/makefile/functions.rs index c111fba..51bf0f9 100644 --- a/src/makefile/functions.rs +++ b/src/makefile/functions.rs @@ -85,6 +85,10 @@ pub fn expand_call( assert_eq!(args.len(), 1); file_name::realpath(macros, &args[0]) } + "abspath" => { + assert_eq!(args.len(), 1); + file_name::abspath(macros, &args[0]) + } "if" => { assert!(args.len() == 2 || args.len() == 3); @@ -382,6 +386,11 @@ mod file_name { .collect::>(); Ok(results.join(" ")) } + + pub fn abspath(macros: &MacroSet, targets: &TokenString) -> Result { + // TODO don't resolve symlinks + realpath(macros, targets) + } } // Functions for Conditionals -- cgit v1.2.3