make
command MUST be named Makefile
,
with a capital "M".
Rationale: although the latter name makefile
is also valid, common
usage prefer the former.
Makefile
(provided or generated by configure
) SHOULD
contain the all
, clean
and distclean
rules.
Makefile
MUST NOT use non-standard syntax. In particular,
it MUST NOT expect to be parsed by GNU make ("gmake
").
all
rule.
clean
rule SHOULD clear object files, temporaries and
automatic editor backups from the source tree.
distclean
rule MUST depend on the clean
rule, and
SHOULD clear executables, shared objects and library archives from
the source tree.
Makefile
s" is discouraged; when used,
the amount of redundancy between Makefile
s SHOULD be kept low by
proper use of include
directives.
Especially, when GCC is available as a standard compiler on a system, source code MUST compile with GCC and the following options:
-Wall -W -ansi -WerrorAdditionally, it SHOULD compile without warnings with GCC and the following options (all documented in the GCC manual page):
-Wall -W -ansi -pedantic -Wfloat-equal -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wunreachable-code
Makefile
must actually use these flags. It does not imply that GCC must be
always used: only the command cc
is guaranteed to be available, and may
point to a different compiler.
Makefile
rules MUST NOT expect the presence of GCC on all
target architectures.
uname
command. In particular, the environment variable
HOSTTYPE
MUST NOT be used for this purpose, since it has a
shell-dependant and architecture-dependent behaviour.