23 Dec 2020 15:48:23 UTC
- Distribution: Make
- Module version: 2.011
- Source (raw)
- Browse (raw)
- How to Contribute
- Testers (189 / 0 / 0)
- KwaliteeBus factor: 1
- 87.37% Coverage
- License: perl_5
- Perl: v5.6.0
- Download (25.58KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version++ed by:2 non-PAUSE users
- Nick Ing-Simmons
- COPYRIGHT AND LICENSE
Make::Functions - Functions in Makefile macros
require Make::Functions; my ($dir) = Make::Functions::dir($fsmap, "x/y"); # $dir now "x"
Package that contains the various functions used by Make.
Implements GNU-make style functions. The call interface for all these Perl functions is:
my @return_list = func($fsmap, @args);
The args will have been extracted from the Makefile, comma-separated, as in GNU make. The first arg is a "FSFunctionMap" in Make.
Returns all its args expanded using
Runs the command, returns the output with all newlines replaced by spaces.
Prefixes each word in the second arg with first arg:
$(addprefix x/,1 2) # becomes x/1 x/2
Suffixes each word in the second arg with first arg:
$(addprefix /x,1 2) # becomes 1/x 2/x
Returns everything after last
Returns everything up to last
/. If no
In the third arg, replace every instance of first arg with second. E.g.:
$(subst .o,.c,a.o b.o c.o) # becomes a.c b.c c.c
Since, as with GNU make, all whitespace gets ignored in the expression as written, and the commas cannot be quoted, you need to use variable expansion for some scenarios:
comma = , empty = space = $(empty) $(empty) foo = a b c bar = $(subst $(space),$(comma),$(foo)) # bar is now "a,b,c"
Like "subst", but only operates when the pattern is at the end of a word.
Like the dmake macro, but does not support a file argument straight after the macro-name.
The text after further whitespace is inserted in a temporary file, whose name is returned. E.g.:
$(mktmp $(shell echo hi)) # becomes a temporary filename, and that file contains "hi"
Copyright (c) 1996-1999 Nick Ing-Simmons.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
|s||Focus search bar|
|?||Bring up this help dialog|
|g p||Go to pull requests|
|g i||go to github issues (only if github is preferred repository)|
|g a||Go to author|
|g c||Go to changes|
|g i||Go to issues|
|g d||Go to dist|
|g r||Go to repository/SCM|
|g s||Go to source|
|g b||Go to file browse|