This document describes the fastmake functions that are fastmake specific (extend GNU make functionality). Other functions can be found in GNU make documentation.
| Fastmake functions | This document describes the fastmake functions that are fastmake specific (extend GNU make functionality). |
| ${pwd} | Returns current directory. |
| $(delprefix prefix, list) | Removes prefix from each element of a list |
| $(delsuffix suffix, list) | Removes suffix from each element of a list |
| $(base paths) | Takes a list of paths as parameter and returns file names without directory and suffix. |
| $(mkdir dir) | Recursively creates a directory <dir> if it does not exist. |
| $(make command_line_arguments) | This is the main function that makes the fastmake fast and to be in a single process. |
| $(makedep src_files, out_files, dep_files, include_paths, include_files, enclosure) | Searches for dependecies in C/C++ src_files and write them to out_files |
| $(cp source, destination) | Copies source file to destination. |
| $(rm file_list) | Removes each file or directory from a file_list. |
| $(ls dir, flags[, regex]) | Enumerates files and/or directories in a specified location. |
| $(intersect list1 list2) | Returns a set intersection of two lists |
| $(exclude from, what) | Takes first argument as a list and removes from it the elements that are in the second argument. |
| $(replace source, regex, with) | Performs replacement in source according to given regular expression with the third argument. |
| $(ln source, destination) | Makes a hard link of source to destination. |
| $(echo arg[, filename]) | If filename is not specified prints arg to standart output otherwise writes arg to filename. |
| $(arith expression) | Evaluates simple arithmetic expression |
| $(cat expression) | Prints the content of a specified file to standart output. |
| $(tolower arg) | Converts expanded arg to lower case |
| $(toupper arg) | Converts expanded arg to upper case |
This is the main function that makes the fastmake fast and to be in a single process. The function emulates recursive running of make by creating a new context and running a logic with this context. It does not return exit code because it is not needed. It throws an exception like any other function in a fastmake or exited normaly. In case of exception fastmake treats the recipe failed as if a command $(MAKE) in GNU make returns exitcode other than 0.
DIRS = $(ls .,d) # enumerate directories in a current directory all : $(DIRS:+.dir) # add .dir to each dir in DIRS and make 'all' dependent from them %.dir :; $(make -C $* $(MAKEFLAGS) $(MAKEMACROS)) # dive into each dir with command args that were passed to current 'make'
Searches for dependecies in C/C++ src_files and write them to out_files
| src_files | a list of files to scan for dependencies. |
| out_files | a list of output files to put generated dependencies |
| dep_files | a list of files which will be written as dependent from generated dependecies |
| include_paths | include search paths. Usualy the same as those passed to -I flag of a compiler |
| include_files | forced include header files. The same as those include to -FI (msvc) or -include (gcc) |
| enclosure | a list of symbol pairs for example “” or <> or both <> “” |
Enumerates files and/or directories in a specified location.
| dir | where to enumerate files and/or directories |
| flags | can be a combination of flag symbols (f - files, d - directories, r - dive to subdirectories, p - preserve dir in the result) |
| regex | if specified it is used to filter enumerated entries |
$(ls .,f,.*\\.cpp) - returns all .cpp files in a current directory