Redigera

Dela via


abspath NMAKE function

Gets the absolute path for each item in a list.

Syntax

$(abspath input)

Parameters

input
The list of file paths to convert.

Return value

A list with each of the items from input converted to their absolute form.

Remarks

abspath supports extended-length paths, either by using the \\?\ prefix, or when long paths are enabled. For more information about long paths, see Maximum Path Length Limitation.

This macro function is available starting in Visual Studio 2022 version 17.1, in NMAKE version 14.31 or later.

Example

$(abspath relative\path\file.c) # If run from "c:\temp", evaluates to "c:\temp\relative\path\file.c"
$(abspath c:\temp\..\file1.cpp c:\\temp\/dir//) # Evaluates to "c:\file1.cpp c:\temp\dir\". Follows path traversals and normalizes directory separators.

# abspath can be combined with filter to find which items exist within a directory tree
TEMP_SOURCES=$(filteri c:\temp\\%,$(abspath $(SOURCES)))

See also

Macros and NMAKE
NMAKE functions by category