Open jk-ozlabs opened 9 years ago
Hi,
Finally got around to focusing on this again, was on the back burner for a while. Here are my findings:
Sourced: https://www.gnu.org/prep/standards/html_node/Command-Variables.html "If there are C compiler options that must be used for proper compilation of certain files, do not include them in CFLAGS. Users expect to be able to specify CFLAGS freely themselves. Instead, arrange to pass the necessary options to the C compiler independently of CFLAGS, by writing them explicitly in the compilation commands or by defining an implicit rule, like this:"
CFLAGS = -g
ALL_CFLAGS = -I. $(CFLAGS)
.c.o:
$(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $<
I switched all 'CFLAGS' variables to 'LOCAL_CFLAGS' and the following compiles
CFLAGS=-mbig-endian make -j8
"You cannot use "CFLAGS = $(CFLAGS) -Wall"; this would be a recursive definition and make does not allow this. You could use "CFLAGS := $(CFLAGS) -Wall", or "CFLAGS += -Wall", but those won't work either because an assignment on the command line has a higher precedence. You could use "override CFLAGS += -Wall", but generally we recommend you just choose different variables internally. The GNU Coding Standards require CFLAGS etc. be left for the user, and makefiles choose another variable, like "local_CFLAGS = $(CFLAGS) -Wall"."
I'm trying to compile hostboot with
-mbig-endian
, by providing a customCFLAGS
:but it looks like specifying
CFLAGS=
in the environment causes the make infrastructure to construct an invalid compiler command:CFLAGS+=
stanzas from the .env.mk files are being duplicated. If I do amake -p
, the top-level makefile is constructing a validCFLAGS
, but the rest have duplicated components.