The Makefile supports building two Bible editions in parallel:
| Edition | Identifier | Scope | Source URL | Directory |
|---|---|---|---|---|
| Berean Standard Bible | BSB | Full Bible (66 books) | https://bereanbible.com/bsb_tables.tsv | bereanbible/ |
| Majority Standard Bible | MSB | New Testament (27 books) | https://majoritybible.com/msb_nt_tables.tsv | majoritybible/ |
Each edition is built into its own directory with identical internal structure.
The Makefile uses GNU Make's define/eval/foreach macros to generate per-edition targets from a single template. Edition-specific parameters are defined as variables:
EDITIONS = bereanbible majoritybible
bereanbible_URL = https://bereanbible.com/bsb_tables.tsv
bereanbible_ID = BSB
bereanbible_SENTINEL = GEN
majoritybible_URL = https://majoritybible.com/msb_nt_tables.tsv
majoritybible_ID = MSB
majoritybible_SENTINEL = MATThe SENTINEL variable defines which book file Make uses to track whether the build step has completed (GEN for full Bible, MAT for NT-only).
Each edition has its own cached source file at <edition>/temp/source.tsv. The cache rule:
- Runs on every build to check for remote updates
- Uses
curl -z(time conditional) to only download if remote is newer - Downloads to a temporary file first, then replaces the cache only if updated
- Falls back to a full download if no cached file exists
All output files depend on both bsb2usfm.py AND the edition's cached source file:
<edition>/results/<SENTINEL>.usfm: bsb2usfm.py <edition>/temp/source.tsv
Output files are regenerated if EITHER:
- The Python script is modified, OR
- The remote data file is updated
After generating all format variants, each edition runs:
adapt_usx_for_DBL.py- Adapts USX files for Digital Bible Libraryadapt_usfm_for_paratext.py- Adapts USFM files for Paratextcreate_zips.py- Creates ZIP archives in<edition>/workspace/
make allmake bereanbible # BSB only
make majoritybible # MSB onlymake forceThis removes all cached data files and rebuilds everything from scratch.
make cleanRemoves all generated files (results, workspace, etc.) for both editions.
make clean-cacheRemoves only the cached data files, forcing a fresh download on next build.
| Command | Description |
|---|---|
make all |
Build both editions (default) |
make bereanbible |
Build BSB edition only |
make majoritybible |
Build MSB edition only |
make clean |
Remove generated files for both editions |
make clean-cache |
Remove cached source data for both editions |
make force |
Clean cache and rebuild all |
To add a third edition:
-
Define its parameters:
new_edition_URL = https://example.com/source.tsv new_edition_ID = NEW new_edition_SENTINEL = GEN # or MAT for NT-only
-
Add it to the EDITIONS list:
EDITIONS = bereanbible majoritybible new_edition -
Add it to the
.PHONYtarget list
The foreach/eval macros automatically generate all necessary targets.
Since Make tracks build completion via file timestamps, each build step uses a "sentinel" file - the first book generated:
- BSB (full Bible):
GEN.usfm(book code 01) - MSB (NT-only):
MAT.usfm(book code 40)
Helper functions compute the sentinel filenames for variants:
sentinel_int = <bookcode><SENTINEL><ID>_int # e.g., 01GENBSB_int
sentinel_strongs = <bookcode><SENTINEL><ID>_strongs # e.g., 40MATMSB_strongsThe Makefile uses curl -z which performs a conditional GET request:
- Sends the local file's timestamp to the remote server
- Server compares with its Last-Modified header
- If remote is newer: downloads to temporary file, then replaces cache
- If remote is same/older: no download (cache unchanged)
This means:
- Every
makechecks for updates (minimal network overhead) - Full download only happens when remote is actually newer
- Timestamp-based rebuilds work correctly
curlmust be installed (standard on most Unix-like systems)- GNU Make (for
define/eval/foreachsupport) - Internet connection required to check for remote updates