diff --git a/doc/JUST-MAKE-SHAKE.md b/doc/JUST-MAKE-SHAKE.md new file mode 100644 index 000000000..65b79a176 --- /dev/null +++ b/doc/JUST-MAKE-SHAKE.md @@ -0,0 +1,37 @@ +# Just, make, and Shake + +After many years of using on GNU Make for automating project tasks, +we now primarily use `just` instead. +`just` is better enough, and clean consolidated efficient project automation is so valuable, +that it is worthwhile, even though, for now, it is usually not installed by default and it lacks Make's file dependency tracking. +When dependency tracking, or more powerful code, is really needed, we typically use [[SHAKE|Shake.hs]] instead of make or just. + +`Justfile` in the main repo's top directory is where we keep the recipes (scripts); +this is the starting point for automating hledger project tasks. +Install and run `just` to see the list of recipes. I suggest using a shorter command alias `j`. +Eg: + +```cli +$ alias j=just +$ j # list all scripts +$ j h test # list scripts mentioning "test" +``` + +## Make + +[GNU Make](https://www.gnu.org/software/make) makefiles are still used in a number of subdirectories - site, finance etc. + +## Shake + +`Shake.hs` in the main repo's top directory complements the Justfile; +it is used for tasks requiring file dependencies or more complex code, such as building documentation and the web site. +Eg: + +```cli +$ ./Shake.hs # compile it for speed and git branch independence. Or: just Shake +$ ./Shake # list scripts +``` + +## tools + +Additional helper scripts and tools can be found in the `tools/` subdirectory. diff --git a/doc/MAKE.md b/doc/MAKE.md deleted file mode 100644 index 61e6090f2..000000000 --- a/doc/MAKE.md +++ /dev/null @@ -1,40 +0,0 @@ -# Make - -A Makefile is provided to make common developer tasks easy to remember, -and to insulate us a little from the ever-evolving Haskell tools ecosystem. -Using it is entirely optional, but recommended. -You'll need [GNU Make](https://www.gnu.org/software/make) installed. - -The Makefile contains a fair amount of obsolete cruft and needs cleanup. Some tasks (docs, website) are now handled by the [Shake](#shake) file instead. - -The Makefile is self-documenting. Run `make` to see a list of the main make rules: - -```cli -$ make -Makefile:37: -------------------- hledger make rules -------------------- -Makefile:39: make [help] -- list documented rules in this makefile. make -n RULE shows more detail. -Makefile:204: (INSTALLING:) -Makefile:206: make install -- download dependencies and install hledger executables to ~/.local/bin or equivalent (with stack) -Makefile:231: (BUILDING:) -Makefile:235: make build -- download dependencies and build hledger executables (with stack) -Makefile:304: make hledgerdev -- quickly build the hledger executable (with ghc and -DDEVELOPMENT) -... -``` - -To see what a make rule will do without actually doing it, use the `-n` flag: - -```cli -$ make build -n -stack build -``` -```cli -$ make test -n -(stack test \ - && echo pkgtest PASSED) || echo pkgtest FAILED -(stack exec hledger test \ - && echo builtintest PASSED) || echo builtintest FAILED -(COLUMNS=80 PATH=`pwd`/bin:/home/simon/src/hledger/bin:/home/simon/.local/bin:/home/simon/.cabal/bin:/opt/ghc/7.10.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/var/lib/gems/1.9.1/bin stack exec -- shelltest --execdir -- -j16 --hide-successes tests \ - && echo functest PASSED) || echo functest FAILED -``` - - diff --git a/doc/SHAKE.md b/doc/SHAKE.md deleted file mode 100644 index 22f9870b1..000000000 --- a/doc/SHAKE.md +++ /dev/null @@ -1,13 +0,0 @@ -# Shake - -`Shake.hs` in the top directory complements the Makefile; it is used for some more complex tasks, such as building documentation and the web site. - -Compile it: - - ./Shake.hs # or, make Shake - -See help: - - ./Shake - - diff --git a/doc/dev.md b/doc/dev.md index e5e187415..0ea692682 100644 --- a/doc/dev.md +++ b/doc/dev.md @@ -27,14 +27,13 @@ and then symlinked into the hledger_site repo for rendering on hledger.org. - [FINANCE](FINANCE.md) - [Investment Accounting Feature Ladder](investment-accounting-features.md) - [ISSUES](ISSUES.md) +- [JUST-MAKE-SHAKE](JUST-MAKE-SHAKE.md) - [LINKS](LINKS.md) -- [MAKE](MAKE.md) - [MOCKUPS](MOCKUPS.md) - [PULLREQUESTS](PULLREQUESTS.md) - [REGRESSIONS](REGRESSIONS.md) - [RELEASING](RELEASING.md) - [REPOS](REPOS.md) -- [SHAKE](SHAKE.md) - [TESTS](TESTS.md) - [VERSIONNUMBERS](VERSIONNUMBERS.md)