fmake

make any project just by typing `fmake`
git clone git@getsh.org:fmake.git
Log | Files | Refs | README | LICENSE

README (3171B)


      1 fmake
      2 =====
      3  _______________________________
      4 | > C:\AndroidApp\        - o x |
      5 |-------------------------------|
      6 | $ fmake                       |
      7 | ++ gradle buildDebug          |
      8 !_______________________________!
      9 
     10 fmake is a tool that brings `make`s interface to almost any build system.
     11 
     12 fmake offers a functionality similar to vim's makeprg, but does so in a
     13 way that it can be used in various other programs and applications.
     14 
     15 fmake "intelligently" knows what targets to build and can be
     16 configured in the config.h file.
     17 
     18 Usage
     19 -----
     20 
     21 fmake [options] [target] ...
     22 Options:
     23   -?            Prints fmake usage
     24   -1|2|3        Force fmake to start from the level specified
     25   -C path       Change to directory before calling the programs
     26   -D            Print various types of debugging information.
     27   -N            Don't actually run any build commands; just print them.
     28   -V            Print the version number of make and exit.
     29 
     30 Build Chains
     31 ------------
     32 fmake automatically understands the following(and many more) sequences,
     33 and tries to run it one after the other
     34 
     35     $ cmake -Bout .
     36     $ cmake --build out
     37 
     38     ----------(vs)----------
     39 
     40     $ fmake # You only have to type fmake!
     41     ++ cmake -Bout
     42     ...
     43     ++ cmake --build out
     44     ...
     45 
     46 fmake can be forced to re-run the generator using `fmake -2`
     47 
     48 
     49 Supported build files
     50 ---------------------
     51 fmake queries filenames from `maker_config_t makers[]` defined in config.h.
     52 
     53 Building fmake
     54 --------------
     55 *NIX,
     56         $ make
     57         $ make install
     58 
     59 MSVC,
     60         * Open Developer Command Prompt *
     61         C:\fmake> nmake
     62 
     63 Additionally 'type=release' can be passed to build as release.
     64 Default is debug.
     65 
     66 config.h
     67 --------
     68 config.h is a simple C header file, that contains a X macro which maps out the
     69 file to look for and the build command that understands the matched file.
     70 
     71 All entries have a level, which fmake utilizes to select a build methodology to
     72 use when multiple types are found in the same folder.
     73 
     74 An example would be GNU autotools,
     75 
     76    file            level
     77    configure.ac      3
     78    configure         2
     79    Makefile          1
     80 
     81     $ ls
     82     configure configure.ac src.c Makefile
     83     $ fmake
     84 
     85 Here since the Makefile has the lowest level of 1, `make` is invoked.
     86 If you decide to delete the Makefile, `sh configure` is invoked, as `configure`
     87 is the next lowest level of value 2.
     88 
     89 FAQ
     90 ---
     91 > Why?
     92 "People disagree on priorities and therefore, you can't create
     93 the One & Only build system to end all other build systems."
     94                                                 - jasode (a HN user)
     95 
     96 fmake was born out of frustration with having to remember specific build
     97 commands for different software projects.
     98 
     99 > Why not use 'build/' instead of 'out/' as fallback default?
    100 Using 'build/' for storing build artifacts is not preferrable for two reasons,
    101 1. Some build systems use 'BUILD' as their manifest file, making it impossible
    102    to use 'build/' as output directory in case-insensitive file systems
    103 2. More and more projects are using the 'build' directory for various repo
    104    specific tasks such as setting up CI or maintianing editor configurations.
    105 
    106 See Also
    107 --------
    108 * errorformat by reviewdog