1## README 2 3A WiP implementation of `make(1)`, aims to be compatible with [P1003.1™-202x/D3][posix draft] at some point. 4The name refers to the transitive verb for [*machen*][wiktionary machen], the German translation of the word *make*. 5 6### Motivation 7 8The goal is to write a clean, easily extendible implementation of POSIX make in order to enable experiments with fancy new make features. 9For example, [bazel][bazel web]-like [sandboxing][bazel sandbox] (executing each target in a Linux namespace) to find impure dependencies in existing Makefiles, or debugging features such as the ones provided by the [remake project][remake github].1011### Status1213Presently, the implementation is mainly a proof of concept.14Many parts of the POSIX standard are not implemented and some parts are implemented in a not fully conforming way.15However, some software which more simple Makefile configurations can already be compiled using mach, e.g. [pdpmake][pdpmake makefile].16Refer to the equivalence tests against a known-good make implementation in `tests/golden` for more information on what is known to work right now.17Further information is also available in the `TODO.md` file.1819### Installation2021This software is intended to work with recent version of GHC without requiring additional external dependencies, i.e. only relying on the libraries bundled with GHC.22Currently, GHC 9.2 and 9.4 are known to work, newer versions may works as well (if not, patches are more than welcome).23If a compatible GHC version is available on your system, mach can be installed using [Cabal][cabal web].24Otherwise, installation using [Guix][guix web] is recommended.25More details on both installation methods is provided below.2627#### Cabal2829Assuming the presence of a supported Haskell toolchain version, mach can be installed using Haskell's Cabal package manager.30In order to do so, clone the repository and running the following command from the repository root:3132 $ cabal install3334If Cabal is configured correctly, the mach executable show be available in your `$PATH`.3536#### Guix3738If a supported GHC version is not available on your system (e.g. because the GHC packaged by your distribution is too old) then you can also install mach using [Guix][guix web].39Guix is a functional [nix][nix web]-like package manager which can be used alongside your distributions package manger.40Once Guix is installed on your system, you can build mach by cloning the repository and running the following command:4142 $ guix time-machine -C channels.scm -- package -f guix.scm4344If Guix is configured correctly, this should add the mach executable to your user's profile.4546### Development4748Code should be formatted using [ormolu][ormolu github].49A githook for this purpose is available which can be enabled using:5051 $ git config --local core.hooksPath .githooks5253### Related Work5455* [The original Make paper by Stuart I. Feldman][feldman make]56* [Plan 9's rewrite of make, called mk][plan9 mk]57* [A re-implementation of Plan 9 mk in Haskell][hmk github]58* [A Linux port of NetBSD make][bmake web]59* [The make implementation provided by the GNU project][gnu make]60* [remake, an enhanced version of GNU make][remake github]61* [pdpmake, a implementation of POSIX make written from scratch in C][pdpmake web]6263### License6465This work is licensed under [CC BY-NC-SA 4.0][cc license].6667[posix draft]: https://www.opengroup.org/austin/login.html68[cc license]: http://creativecommons.org/licenses/by-nc-sa/4.069[feldman make]: https://doi.org/10.1002/spe.438009040270[plan9 mk]: https://plan9.io/sys/doc/mk.pdf71[hmk github]: https://github.com/mboes/hmk72[bmake web]: http://www.crufty.net/help/sjg/bmake.html73[gnu make]: https://www.gnu.org/software/make74[remake github]: https://github.com/rocky/remake75[pdpmake web]: https://frippery.org/make/76[pdpmake makefile]: https://github.com/rmyorston/pdpmake/blob/master/Makefile77[guix web]: https://guix.gnu.org78[nix web]: https://nixos.org/nix/79[cabal web]: https://haskell.org/cabal80[bazel web]: https://bazel.build81[bazel sandbox]: https://bazel.build/docs/sandboxing82[wiktionary machen]: https://en.wiktionary.org/wiki/machen83[ormolu github]: https://github.com/tweag/ormolu