4 # kBuild - Stamp out GNU Make predefines.
6 # Copyright (c) 2004 knut st. osmundsen <bird-srcspam@anduin.net>
9 # This file is part of kBuild.
11 # kBuild is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13 # the Free Software Foundation; either version 2 of the License, or
14 # (at your option) any later version.
16 # kBuild is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
21 # You should have received a copy of the GNU General Public License
22 # along with kBuild; if not, write to the Free Software
23 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30 ifeq ($(MAKEFLAGS
),$(MAKEFLAGS
:R
=x
))
31 # add the -R makeflag to avoid doing this for submakes
32 MAKEFLAGS
:= R
$(MAKEFLAGS
)
34 define def_undefine_default
35 ifeq ($(origin $1), default
)
40 _DEFAULT_VARIABLES
:= .LIBPATTERNS .VARIABLES AR ARFLAGS AS CC CHECKOUT
,v CO COFLAGS COMPILE.C COMPILE.F COMPILE.S COMPILE.c COMPILE.
cc COMPILE.
cpp COMPILE.def COMPILE.f COMPILE.mod COMPILE.p COMPILE.r COMPILE.s CPP CTANGLE CWEAVE CXX F77 F77FLAGS FC GET LD LEX LEX.l LINK.C LINK.F LINK.S LINK.c LINK.
cc LINK.
cpp LINK.f LINK.o LINK.p LINK.r LINK.s LINT LINT.c M2C MAKEINFO OUTPUT_OPTION PC PREPROCESS.F PREPROCESS.S PREPROCESS.r RM TANGLE TEX TEXI2DVI WEAVE YACC YACC.y
41 $(foreach i
, $(_DEFAULT_VARIABLES
), $(eval
$(call def_undefine_default
,$(i
))))
43 def_undefine_default
:=
55 ifeq ($(MAKEFLAGS
),$(MAKEFLAGS
:r
=x
))
56 MAKEFLAGS
:= r
$(MAKEFLAGS
)
57 # add the -r makeflag to avoid doing this for submakes