freebsd-dev/contrib/bmake/unit-tests/suff-main-several.mk
Simon J. Gerraty 06b9b3e0ad Merge bmake-20210110
Quite a lot of churn on style, but lots of
good work refactoring complicated functions
and lots more unit-tests.
Thanks mostly to rillig at NetBSD

Some interesting entries from ChangeLog

o .MAKE.{UID,GID} represent uid and gid running make.

o allow env var MAKE_OBJDIR_CHECK_WRITABLE=no to skip writable
  checks in InitObjdir.  Explicit .OBJDIR target always allows
  read-only directory.

o add more unit tests for META MODE

Merge commit '8e11a9b4250be3c3379c45fa820bff78d99d5946' into main

Change-Id: I464fd4c013067f0915671c1ccc96d2d8090b2b9c
2021-01-13 22:21:37 -08:00

43 lines
1.2 KiB
Makefile

# $NetBSD: suff-main-several.mk,v 1.1 2020/11/22 20:36:17 rillig Exp $
#
# Demonstrate that an inference rule is considered the main target if its
# suffixes are not known at the point of declaration.
.MAKEFLAGS: -dmps
.1.2 .1.3 .1.4:
: Making ${.TARGET} from ${.IMPSRC}.
# At this point, the above targets are normal targets.
# The target '.1.2' is now the default main target.
next-main:
: Making ${.TARGET}
# At this point, 'next-main' is just a regular target.
.SUFFIXES: .1 .2 .3 .4
# Since the targets '.1.2', '.1.3' and '.1.4' have now been turned into
# transformation rules, 'next-main' is the default main target now.
.SUFFIXES: # clear all
# At this point, 'next-main' is still the default main target, even though
# it is not the first regular target anymore.
# Define and undefine the suffixes, changing their order.
# XXX: This should have no effect, but as of 2020-11-22, it does.
# For some reason, mentioning the suffixes in reverse order disables them.
.SUFFIXES: .4 .3 .2 .1
.SUFFIXES: # none
.SUFFIXES: .1 .2 .3 .4
.SUFFIXES: # none
.SUFFIXES: .4 .3 .2 .1
suff-main-several.1:
: Making ${.TARGET} out of nothing.
next-main: suff-main-several.{2,3,4}
.MAKEFLAGS: -d0 -dg1