1*06b9b3e0SSimon J. Gerraty# $NetBSD: suff-main-several.mk,v 1.1 2020/11/22 20:36:17 rillig Exp $ 2*06b9b3e0SSimon J. Gerraty# 3*06b9b3e0SSimon J. Gerraty# Demonstrate that an inference rule is considered the main target if its 4*06b9b3e0SSimon J. Gerraty# suffixes are not known at the point of declaration. 5*06b9b3e0SSimon J. Gerraty 6*06b9b3e0SSimon J. Gerraty.MAKEFLAGS: -dmps 7*06b9b3e0SSimon J. Gerraty 8*06b9b3e0SSimon J. Gerraty.1.2 .1.3 .1.4: 9*06b9b3e0SSimon J. Gerraty : Making ${.TARGET} from ${.IMPSRC}. 10*06b9b3e0SSimon J. Gerraty 11*06b9b3e0SSimon J. Gerraty# At this point, the above targets are normal targets. 12*06b9b3e0SSimon J. Gerraty# The target '.1.2' is now the default main target. 13*06b9b3e0SSimon J. Gerraty 14*06b9b3e0SSimon J. Gerratynext-main: 15*06b9b3e0SSimon J. Gerraty : Making ${.TARGET} 16*06b9b3e0SSimon J. Gerraty 17*06b9b3e0SSimon J. Gerraty# At this point, 'next-main' is just a regular target. 18*06b9b3e0SSimon J. Gerraty 19*06b9b3e0SSimon J. Gerraty.SUFFIXES: .1 .2 .3 .4 20*06b9b3e0SSimon J. Gerraty 21*06b9b3e0SSimon J. Gerraty# Since the targets '.1.2', '.1.3' and '.1.4' have now been turned into 22*06b9b3e0SSimon J. Gerraty# transformation rules, 'next-main' is the default main target now. 23*06b9b3e0SSimon J. Gerraty 24*06b9b3e0SSimon J. Gerraty.SUFFIXES: # clear all 25*06b9b3e0SSimon J. Gerraty 26*06b9b3e0SSimon J. Gerraty# At this point, 'next-main' is still the default main target, even though 27*06b9b3e0SSimon J. Gerraty# it is not the first regular target anymore. 28*06b9b3e0SSimon J. Gerraty 29*06b9b3e0SSimon J. Gerraty# Define and undefine the suffixes, changing their order. 30*06b9b3e0SSimon J. Gerraty# XXX: This should have no effect, but as of 2020-11-22, it does. 31*06b9b3e0SSimon J. Gerraty# For some reason, mentioning the suffixes in reverse order disables them. 32*06b9b3e0SSimon J. Gerraty.SUFFIXES: .4 .3 .2 .1 33*06b9b3e0SSimon J. Gerraty.SUFFIXES: # none 34*06b9b3e0SSimon J. Gerraty.SUFFIXES: .1 .2 .3 .4 35*06b9b3e0SSimon J. Gerraty.SUFFIXES: # none 36*06b9b3e0SSimon J. Gerraty.SUFFIXES: .4 .3 .2 .1 37*06b9b3e0SSimon J. Gerraty 38*06b9b3e0SSimon J. Gerratysuff-main-several.1: 39*06b9b3e0SSimon J. Gerraty : Making ${.TARGET} out of nothing. 40*06b9b3e0SSimon J. Gerratynext-main: suff-main-several.{2,3,4} 41*06b9b3e0SSimon J. Gerraty 42*06b9b3e0SSimon J. Gerraty.MAKEFLAGS: -d0 -dg1 43