Scalable true implementation of recursive make (stirmake), user's guide
Next
Scalable true implementation of recursive make (stirmake), user's guide
Juha-Matti
Tilli
Copyright © 2018-2025 Juha-Matti Tilli
Copyright © 2017-2019 Aalto University
Table of Contents
I. Make, a historical tool
1. Make, the de facto build tool
Introduction to basics of make
Cleaning and dependency on Makefile
Somewhat larger single-directory projects
Header file dependencies
2. Where make fails, multi-directory projects
Make with directory separators
Another approach: Makefile per directory
Let's try recursive make
Fixing no common namespace: include file
Drawbacks and dangers of separating build to multiple DAGs
Another approach: one Makefile, module.mk per directory
Parallel make, jobserver and lack of multiple targets
II. Stirmake, a modern tool
3. Introducing stirmake
Compiling and installing stirmake
Compiling hello world
Modular hello from library
Environment and configuration commands
Multiprocessor machines
Tracing and debugging
4. Variables, data types and functions
Dump: hello from stirmake
Defining variables
Special variables
Data types, finally we can have spaces in filenames!
Conditionals
Loops
String
Array
Simple data types: number, boolean, nil
Tree
Functions and delayed evaluation
Functions, global variables and scoping
5. How Stirmake executes its commands
Different ways of executing commands
The dangers of shell expansion
Invoking shell manually
Build command, timestamp and file size database
Move madness
Command options: ignore, noecho, ismake, automatic make detection
@glob and the dangers of @glob in middle of many commands
6. Automated cleaning with stirmake
Automated cleaning
Hooks
7. Conditional compilation
8. Example projects
mploop
quictest
steamingatof
prettyftoa
rlctrans
jmalloc
abce
III. Stirmake in large-scale systems
9. Stirmake for entire project structures
Including sub-projects
Invoking stirmake: smka, smkp, smkt
Controlling what to export with holey scopes
10. Make revolution, one project at a time
Not everyone uses stirmake yet
Interfacing to command-line tools that specify flags etc
Interfacing to environment
Why compiler name should be a list with arguments
Integration to subproject cleaning systems with clean hooks
Recursive directory dependencies
11. Scoping and subdirectories
Lexical and dynamic scoping
Creating new scopes, and holey scopes
Named scopes and accessing them
Specifying library lists that work everywhere
12. Example large or complex projects
camftpd
fastdiv
pptk
nmsynproxy
ldpairwall
cghcpcli
yale
stirmake
caj
IV. Advanced stirmake programming
13. Programming Stirmake with Amyplan
abce and Amyplan
Installing Amyplan in abce
Creating Amyplan scripts
No read/eval/print loop (REPL)
Immutable strings and mutable packet buffers
I/O streams and interacting with them
Mathematical functions and floating-point numbers
JSON
14. Advanced tricks
Order-only dependencies
Separate build directory
Pattern rules
Scopes stored in variables
Function data types and builtin wrappers
@deponly for additional dependencies
@order and @wait
Dynamically adding dependencies
Dynamically adding rules
Finding stirmake version and version history
Version conditionals and minimum version requirements, future builtins
Hacking abce