Public domain POSIX make

This is a public domain implementation of make which follows the POSIX standard.

If you've got here I assume you know what make is and why you might want to use it. If not, Chris Wellons has a nice Tutorial on Portable Makefiles.

The code is based on Neil Russell's public domain make, as submitted to the Usenet newsgroups net.sources and mod.sources in 1986. The basic data structures and algorithms remain but everything else has changed. This version is also dedicated to the public domain.

The problem with make is that it's a tool for developers, and developers like to tinker with their tools. There are therefore many slightly different versions of make around. POSIX attempts to standardise their common behaviour but leaves a lot of the details unspecified or implementation dependent. It's also rather lax, in that it allows extensions to exist provided they don't interfere with the specified functionality.

This version implements the make utility as defined in both the 2017 and 2024 POSIX standards. The default build from source includes a number of extensions but a key feature of the program is that it can be switched to a strictly POSIX-compliant mode at runtime. This can be achieved in several ways:

The standard mechanism (.POSIX in the makefile) is actually the least useful. Any processing that happens before the makefile is read won't be done in POSIX mode.

Some extensions beyond the POSIX standard are provided. These are all compatible with GNU make, though some are supported by other implementations. Full feature parity with GNU make is not an objective.

To make POSIX mode more convenient certain limitations can be relaxed through the use of pragmas. These can be specified in three ways:

Available pragmas are:

macro_name
Allow '-' as a valid character in macro names.
target_name
Allow '-' and '/' as a valid characters in target names.
command_comment
Don't treat the '#' character as introducing a comment in the build commands of target or inference rules.
empty_suffix
Permit an empty suffix in macro expansions of the form $(VAR:=.c).
posix_2017
Enforce the POSIX 2017 standard.
posix_2024
Enforce the POSIX 2024 standard. In this case the macro_name and target_name pragmas aren't required as the additional characters are allowed.
posix_202x
This is an alias for posix_2024, provided for backward compatibility.
windows
Allow target names of the form C:/path in builds for Microsoft Windows. This may also require the target_name pragma.

The .PRAGMA special target should be used as early as possible in the makefile. Altering pragmas at different places in the makefile is likely to result in inconsistencies.

There is a brief summary of the features added since the 2017 revision of the POSIX standard.

The most recent source tarball is pdpmake-2.0.3.tgz. The release notes describe recent changes.

Source is also available in a Git repository mirrored on GitHub, Gitlab and with (IPv6 only):

   git clone git://git.frippery.org/pdpmake

A default build supports non-POSIX extensions and features from both POSIX 2024 and 2017. When strict POSIX compliance is requested at runtime the POSIX 2024 standard is enforced by default.

Non-POSIX extensions and POSIX 2024 features can be controlled separately at build time by setting the preprocessor symbols ENABLE_FEATURE_MAKE_EXTENSIONS and ENABLE_FEATURE_MAKE_POSIX_2024 to 0 or 1 when building a binary.

The POSIX standard enforced by default at runtime can be set using the preprocessor symbol DEFAULT_POSIX_LEVEL. Use 0 for POSIX 2017 and 1 for POSIX 2024.

Microsoft Windows users will find a native build of pdpmake included in the BusyBox for Windows binaries. Download an appropriate binary for your system and rename it make.exe or pdpmake.exe. BusyBox for Windows includes a Unix shell and many utilities. These can be used in Makefiles without any further setup.

It's also possible to build pdpmake for Windows using Cygwin.

Bug reports can be submitted via GitHub, GitLab or by email to the address below.

Remember, though, this is just a bunch of zeroes and ones you happened to find on the internet. If it does anything useful that's an unexpected bonus.


Ron Yorston
3rd February 2022 (updated 30th August 2025)