1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
fmake
=====
_______________________________
| > C:\AndroidApp\ - o x |
|-------------------------------|
| $ fmake |
| ++ gradle buildDebug |
!_______________________________!
fmake is a tool that brings `make`s 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
$ 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,
1. Some build systems use 'BUILD' as their manifest file, making it impossible
to use 'build/' as output directory in case-insensitive file systems
2. 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