Scroll to navigation

PDPMAKE(1) Usage Manual PDPMAKE(1)

NAME

pdpmake – public domain POSIX make

SYNOPSIS

pdpmake [--posix] [-ehiknpqrSst] [-C dir] [-f file] [-j num_jobs] [-x pragma] [macro[:[:[:]]]=value ...] [target ...]

DESCRIPTION

The pdpmake utility creates or updates files following a set of rules. The created or updated files, called targets, are typically derived from other files, called prerequisites. Targets are described by rules which list commands to be executed. Rules may be inferred by the utility or explicitly defined in one or more files. A target may also depend on other targets, whose rules must be executed before its. Files which contain these targets are known as makefiles.

OPTIONS

Enable strict POSIX-compliant mode. This option must be the first given on the command line.
Before execution, switch to dir. If specified multiple times, each invocation is interpreted relative to the previous one: ‘-C / -C etc’ is equivalent to ‘-C /etc’.
Allow environment variables to override macro assignments.
Specify a makefile file from which to read. If invoked multiple times, specified files are read in order of invocation. See INPUT FILES section.
Display help information.
If commands in rules exit unsuccessfully, ignore them and continue. This option is equivalent to specifying the special target .IGNORE without prerequisites.
Ignored. Exists for compatibility with other make(1) implementations.
If an error is encountered, continue processing rules. Recipes for targets which depend on other targets that have caused errors are not executed.
Print without executing commands that are not prefixed with ‘+’.
Print macro definitions and rules during execution.
If specified targets are up to date, exit successfully. Otherwise, exit with an error code of 1. Do not execute any rules.
Do not use the built-in rules. Clear the suffix list.
Stop processing if an error is encountered. This is the default behaviour and the opposite of -k.
Do not print commands as they are executed. This is equivalent to using the special target .SILENT without prerequisites.
Instead of executing rules, touch target files. Ignores targets that are up-to-date or those which have no rules specified.
Allow certain extensions when using strict POSIX-compliant mode. For a list of supported pragmas, see the PRAGMAS section. This option may be specified more than once to utilize multiple extensions.
Assign value to macro, overriding the value of macro in the input if it exists. Macro assignments and targets may be mixed on the command line. Assignments will be processed before targets.

INPUT FILES

If an input makefile is unspecified, the working directory will be searched for a file named ‘PDPmakefile’, ‘makefile’ or ‘Makefile’, in that order. The first found will be used.

If the input file is ‘-’, the standard input shall be used as the input.

PRAGMAS

While in strict POSIX-compliant mode, pragmas may be utilized to selectively enable certain extensions.

Allow ‘-’ in macro names.
Allow ‘-’ and ‘/’ in target names.
Don't treat the ‘#’ character as introducing a comment in commands or in target and inference rules.
Permit an empty suffix in macro expansions. This takes the form of $(VAR:=.c).
Enforce the old POSIX.1-2017 standard.
Enforce the current POSIX.1-2024 standard. In this case the macro_name and target_name pragmas aren’t required as this standard allows these additional characters.
An alias for the posix_2024 pragma.
Allow Microsoft Windows-style paths as target names. This may also require specifying the target_name pragma.

STANDARDS

This utility follows the Section 12.2, Utility Syntax Guidelines of the POSIX.1-2024 standard for the make utility.

The behavior in this utility should match the behavior described in this section but also includes a set of extensions. Its behavior may be fine-tuned using command line options, environment variables, or special targets. See the PRAGMAS section.

By default, all extensions are enabled. The following list contains all of the methods for disabling all extensions and enabling strict POSIX-compliant mode:

  • Add the special target .POSIX as the first non-comment line in the first input to be processed. This is the standard approach for declaring a makefile to be POSIX-compliant.
  • Add the --posix flag as the first command line option given to pdpmake. This flag is unique to pdpmake and may not be available in other make(1) implementations.
  • Set the PDPMAKE_POSIXLY_CORRECT environment variable to any value. This environment variable is unique to pdpmake and may not be available in other make(1) implementations.

A set of extensions to the POSIX standard are implemented for this utility. These may be compatible with other make(1) implementations. The available extensions are:

  • The -C directory command line option changes the current working directory.
  • Double-colon rules are allowed.
  • The conditional keywords ifdef, ifndef, ifeq, ifneq, else, and endif are implemented.
  • Archive members can be specified using the form lib.a(mem1.o mem2.o...).
  • The macro assignment operator := is implemented. It is equivalent to the POSIX-specified ::= macro assignment operator.
  • The suffixes used in the definition of inference rules can contain any number of periods or none.
  • Chained inference rules can be used when searching for the prerequisites of a target. This means that if there are inference rules .p.q and .q.r and the file thing.p exists, the method by which the file thing.r is created can be deduced.
  • The wildcards ‘*’, ‘?’ and ‘[]’ can be used in the targets and prerequisites of target rules.
  • The ‘#’ character on a command line or in a macro expansion doesn’t indicate the start of a comment. In other locations, ‘#’ can be escaped by preceding it with a backslash.
  • Duplicated prerequisites are removed when the internal macro $? is expanded.
  • An include line with no files specified is silently ignored. At least one blank must follow the include for the line to be valid.
  • The shell used to process build commands isn’t started with the -e option when errors aren’t being ignored.
  • Macro definitions and targets may be mixed on the command line. The macro definitions are processed first, then the targets.
  • The $< and $* internal macros are given values in target rules.
  • When a build command receives a signal, the target is removed.
  • Inference rules and the .DEFAULT target aren't used for phony targets.
  • Pragmas are propagated to recursive invocations of pdpmake.

The following implementation details apply only to the POSIX.1-2024 standard:

  • Nested macro expansion syntax: $(FOO$(BAR))
  • Prerequisites of the .PHONY special target are always considered out-of-date.
  • More than one file can be specified on each include line.
  • Missing include files can be ignored by using -include file instead of include file.
  • Missing or out-of-date include files are rebuilt if an appropriate rule can be found.
  • The $^ and $+ internal macros evaluate to all prerequisites of the current target (not just out-of-date ones, as with $?). $^ removes duplicated prerequisites from the list, $+ doesn’t.
  • If no MAKE environment variable is provided the MAKE macro is initialised from argv[0], with a relative path converted to absolute.
  • The ::=, :::=, +=, ?=, and != macro assignments.
  • Pattern macros extend the standard suffix substitution in macro expansion to allow changes to prefixes.
  • An escaped newline within a macro expansion in a rule is replaced by a space.
  • The CURDIR macro is set to the current directory during program start up.

COPYRIGHT

pdpmake is free and unencumbered software released into the public domain. See <https://unlicense.org>.

SEE ALSO

make(1p)

19 January 2025 Ron Yorston