Re: [PATCH] Support SPARSE in Makefile, better SPARSE_FLAGS
- From
- H. Peter Anvin <hpa@zytor.com>
- Date
- Sep 30, 2005, 19:19 UTC
- Message-ID
- <433D8FA6.2080808@zytor.com>
- In-Reply-To
- <1128087662.14543.14.camel@dv>
Pavel Roskin wrote:
Show 5 quoted lines
> > I hate to say that, but a better alternative is to fix sparse to act > like the native compiler by default (possibly with options to imitate > other architectures or to be fully arch-neutral). >
$(CC) $(CFLAGS) -E -dM -x c /dev/null -o builtin.h
... will output a file containing all the buildin macros that you can feed to sparse with -include.
Replacing -x c with, say, -x c++ gives you the builtins for C++; including $(CFLAGS) gives the appropriate set of macros for any particular combination of options (which can affect the builtin macro set.)
-hpa