- A build system – an alternative to make, Scons, Ant etc.
- Reliable and robust – having been relied on commercially for over five years.
- Powerful – letting you express the problem precisely and directly.
- Fast to run – both to build from scratch and to rebuild.
Large build systems written using Shake tend to be significantly simpler, while also running faster. If your project can use a canned build system (e.g. Visual Studio, cabal) do that; if your project is very simple use a Makefile; otherwise use Shake.
The original motivation behind the creation of Shake was to allow rules to discover additional dependencies after running previous rules, allowing the build system to generate files and then examine them to determine their dependencies – something that cannot be expressed directly in most build systems. However, now Shake is a suitable build tool even if you do not require that feature.
To try Shake you need to install the Haskell Stack, then type
stack install shake, then run
stack exec -- shake --demo. The final step will create a sample Shake build system and run it (you should see this output).
To write your own Shake build system, read the user manual and refer to the API documentation. Further documentation on specific topics, including more examples, is available from the FAQ. Shake build systems are Haskell programs, but can be treated as a powerful version of make with slightly funny syntax. The build system requires no significant Haskell knowledge, and is designed so that most features are accessible by learning the "Shake syntax", without any appreciation of what the underlying Haskell means.
Stuck? Confused? Frustrated? Please get in contact! If in doubt, just email the mailing list.
You can ask questions on StackOverflow using the tag
shake-build-system. You can email the mailing list with anything about Shake. If you find a bug you can report it at the GitHub issue tracker. If your question needs to remain confidential you can email me, although any insights from your question won't be public, so the other approaches are preferred.
Shake can execute Ninja files, allowing integration with CMake and Meson. Shake can predict completion time, profile build systems and sanity check builds. Shake is based on a robust underlying theory from this academic paper. Shake is an open source project under the BSD license hosted on GitHub with a range of contributors.
Shake is used by lots of companies, but only a few have declared so publicly.
- Standard Chartered have been using Shake since 2009, as described in the section 6 of the academic paper.
- factis research GmbH use Shake to compile their Checkpad MED application, as described in their blog post.
- Samplecount have been using Shake since 2012, as mentioned in their tweet, producing several open-source projects for working with Shake.
- CovenantEyes use Shake to build their Windows client, as mentioned in their tweet.
- Keystone Tower Systems has a robotic welder with a Shake build system plus Haskell code running in the control system, as mentioned in their tweet.
- FP Complete use Shake to create Docker images.
- Genomics Plc use Shake for the build system, their first major use of Haskell in the company.
There are several libraries providing pre-made rules for Shake:
- shake-language-c allows cross-compiling C, C++ and Objective-C code to various target platforms.
- shake-cpp is an abstraction layer for Shake, providing simple C++ rules.
- kansas-lava-shake provides a set of rules to work with Kansas Lava and compile down to Xilinx chips.
- avr-shake provides rules for building things with AVR Crosspack.
- shake-minify uses native Haskell code (no external
$PATHdependencies) to minify CSS and JS files.
- shake-pack uses bz2 lib on the system to tar and bzip compress given files.
Several open-source projects make key use of Shake:
- ToolCabal is a rewrite of Cabal using Shake as the dependency engine.
- ghc-make uses Shake to build programs with GHC, speeding up checking if the build is clean.
- GHC is in the process of migrating to a Shake-based build system.
- shake-install helps build a set of cabal packages in the correct order.
- OpenSUSE Haskell packaging makes use of Shake to convert a Stack project to OBS.
And finally, here are a few tutorials and blog posts:
- Many articles from the author of Shake, covering ongoing development.
- Writing a simple Blog with Shake and Pandoc.
Do you have a link that should be included above? Let me know with a tweet to