What Is Fastmake?
Fastmake is a build automation tool. Designed for interactive work on large software projects it
is optimized by speed to greatly decrease responce time. Makefile syntax is close to GNU make's
with many critical extensions (e.g. no TAB curse). It is multiplatform with good Windows support
Why the fastmake?
- A typical software development situation is the following. You change a source file then you run build system that rebuilds
all dependent objects. Build system response time is the time taken by compiler plus the time taken by build system to parse
makefiles, build dependences, check file timestamps and so on. The percentage of time taken by build system depends on files quantity
needed to be rebuilt, the programming language of those files. If many files need to be rebuild then build system overhead
is not significant. But in typical development process one file is modified and compiled. In this case build system can take
bigger part of response time. The situation is worse when interpreter language is used like Perl or Python when only syntax check
and copying to build folder are needed. The situation is worst when you only want to check if everything is built (so called
incremental pass). In this case build system takes 100% of time. For big projects with thousands of files incremental pass
can take up to minute on the whole source tree and several seconds on specific folder. The programmer runs build system
hundreds times per day. That is why response time is very important thing. The fastmake is developed to solve this problem.
Now it passes the whole source tree which is thousands of files in less than 2 seconds and local working folders < 0.1 second.
Fastmake has improved syntax like cycles, block comments, and many others.
There is a lot of different build systems. Some of them written in universal interpreter languages like Perl or Python which makes
them slow. Some systems are fast but work only for specific platform or in specific IDE. Some systems are commercial and not open.
Fastmake is to be without these drawbacks.
Make syntax is the briefest for configuring software build. Also make is very widespread and known by many developers.
Weak declarative syntax of Make is less convenient than universal functional or imperative language because it is very incomplete.
This led to so called 'make syntax hell'. The future goal is to implement functional language features step by step to be closer to such
complete convenient languages as Haskel or Lisp. Disadvantages will be neutralized by syntax improvements and extensions later.
- Cycles (.FOREACH statement)
- No need to keep TAB before recipe. Indentation is enough
- include <file> - included in corner brackets includes file from this makefile location (not current directory)
- Possibility to avoid keeping makefile via 'lookup' features
- Extended function set
- .COMBINE rules to specify multiple source files to the compiler. Useful for MSVC
- .PARALLEL rules to specify run recipes in parallel. Useful for GCC
- Target/prerequisite up to date criterion other then modification date (e.g. file content)
- Infix operators. E.g. $(A:+.obj) - adds .obj at the end to each in $(A)
- Possibility to configure a build system within one makefile without Makefile in each directory
- In-recipe .CD operator to create a working directory scope for group of commands
- Target modifiers can be specified inside rule definition (.PHONY, .SILENT, ...)
- Block comments
Speed up tricks
The key is there is no process respawn for each directory. It allows to store different caches: include cache, date cache, target cache,
dependence cache and so on.
- Function $(make, ...) to respawn itself. One operating system process for entire pass
- Same <included> makefiles are parsed once.
- Built-in dependency analysis
- Internal target cache
- Dependences in one file for all source tree
- Date cache in one file for target files
- Take the first pattern rule that matches (no all pattern rules analysis)
- (Windows) WriteConsole(...) instead of std::cout which is many times slower
- Batched compilation (pass several source files to compiler). Useful for MSVC
- Parallel compilation (.PARALLEL rule modifier). Useful for gcc
- Functions like $(cp ), $(rm ) and so on to fasten popular shell commands
- Thorough C++ optimization: strings with static and shared buffer, fast memory allocator (Loki::SmallObject)
- Makefiles compilation
- Closer to functional language
- More GNU make compatibility
- Rewite on Haskel
- Plugins to different IDEs
Standart and compatibility
I am not going to reinvent a new build tool language or principle. And it is impossible to convince people to use this one
among existing plenty of build tools. Instead of this I took an existing well-known tool and rewrite it to extend it and
solve many problems that make people to create other tools or generate makefiles with the other tools. It allows people
not to learn new tools, reuse GNU make documentation, reuse their knowledge and expearance in GNU make concept. Fastmake
is the reimplementation from scratch therefore it is not full compatible with GNU make and it is hard to be. However
Fastmake is constanly moving towards GNU make which can be traced by viewing Changelog
Fastmake is distributed under the GNU General Public License v.2
. Later the license will be
lesser after some license analysis is performed.
I will be delighted if you place a link to this site on your site.
What GNU make features are not supported yet
Fastmake does not provide checksum file content comparison because it is too slow. On the other hand file modification date checking
works in 99% cases. However simple file content comparison is supported.
- Intermediate targets
- VPATH variable. 'vpath' directive is supported.
- Order only prerequisites
- define/endef canned command sequences
- Makefile remaking
- Double-colon rules
- $?,$|,$% automatic variables
- Computed variables like $($($(x))), use $(call ) instead
- Working with archives
Vitaly Grechko email@example.com
. Comments, requests, bug reports are welcome