2 # target-flags.mk - target specific flags
5 # Include this macro file after all others in a makefile and
6 # follow it with any target specific flag settings.
7 # For each such variable v in TARGET_FLAG_VARS we set:
11 # $v = ${${v}_${.TARGET:T}:U${_$v}}
14 # This allows one to do things like:
17 # TARGET_FLAG_VARS= CFLAGS
18 # .include <target-flags.mk>
19 # CFLAGS_fu.o = ${_CFLAGS:N-Wall}
22 # To turn off -Wall for just the target fu.o
23 # Actually CFLAGS is the default value for TARGET_FLAG_VARS.
26 # One must be careful to avoid creating circular references in
27 # variables. The original version of this macro file did
28 # elaborate things with CFLAGS. The current, simpler
29 # implementation is ultimately more flexible.
31 # It is important that target-flags.mk is included after other
32 # macro files and that target specific flags that may reference
33 # _$v are set after that.
35 # Only works with a make(1) that does nested evaluation correctly.
40 # $Id: target-flags.mk,v 1.9 2014/04/05 22:56:54 sjg Exp $
42 # @(#) Copyright (c) 1998-2002, Simon J. Gerraty
44 # This file is provided in the hope that it will
45 # be of use. There is absolutely NO WARRANTY.
46 # Permission to copy, redistribute or otherwise
47 # use this file is hereby granted provided that
48 # the above copyright notice and this notice are
51 # Please send copies of changes and bug-fixes to:
55 TARGET_FLAG_VARS?
= CFLAGS
56 .for v in
${TARGET_FLAG_VARS}
59 $v = ${${v}_
${.TARGET
:T
}:U
${_
$v}}