fmake
September 17, 2024 ยท View on GitHub
| > C:\AndroidApp\ - o x |
|---|
| $ fmake |
| ++ gradle buildDebug |
| !_______________________________! |
fmake is a tool that brings makes interface to almost any build system.
fmake offers a functionality similar to vim's makeprg, but does so in a way that it can be used in various other programs and applications.
fmake "intelligently" knows what targets to build and can be configured in the config.h file.
Usage
fmake [options] [target] ... Options: -? Prints fmake usage -1|2|3 Force fmake to start from the level specified -C path Change to directory before calling the programs -D Print various types of debugging information. -N Don't actually run any build commands; just print them. -V Print the version number of make and exit.
Build Chains
fmake automatically understands the following(and many more) sequences, and tries to run it one after the other
$ cmake -Bout .
$ cmake --build out
----------(vs)----------
$ fmake # You only have to type fmake!
++ cmake -Bout
...
++ cmake --build out
...
fmake can be forced to re-run the generator using fmake -2
Supported build files
fmake queries filenames from maker_config_t makers[] defined in config.h.
Building fmake
*NIX, make install
MSVC, * Open Developer Command Prompt * C:\fmake> nmake
Additionally 'type=release' can be passed to build as release. Default is debug.
config.h
config.h is a simple C header file, that contains a X macro which maps out the file to look for and the build command that understands the matched file.
All entries have a level, which fmake utilizes to select a build methodology to use when multiple types are found in the same folder.
An example would be GNU autotools,
file level configure.ac 3 configure 2 Makefile 1
$ ls
configure configure.ac src.c Makefile
$ fmake
Here since the Makefile has the lowest level of 1, make is invoked.
If you decide to delete the Makefile, sh configure is invoked, as configure
is the next lowest level of value 2.
FAQ
Why? "People disagree on priorities and therefore, you can't create the One & Only build system to end all other build systems." - jasode (a HN user)
fmake was born out of frustration with having to remember specific build commands for different software projects.
Why not use 'build/' instead of 'out/' as fallback default? Using 'build/' for storing build artifacts is not preferrable for two reasons,
- Some build systems use 'BUILD' as their manifest file, making it impossible to use 'build/' as output directory in case-insensitive file systems
- More and more projects are using the 'build' directory for various repo specific tasks such as setting up CI or maintianing editor configurations.
See Also
- errorformat by reviewdog