Skip to contentSkip to conversation

build: Include config-host.mak as soon as possible

PATCH Applied Lluís Vilanova 3 participants 3 messages Mar 6, 2012 – Mar 11, 2012 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 build: Include config-host.mak as soon as possible

Current code depends on variables defined in config-host.mak before it is actually included.

Cc Anthony Liguori <[email protected]>
Cc Paul Brook <[email protected]>
---
 Makefile |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)
Makefile +8 -7
index 49c775b..408065e 100644
@@ -3,13 +3,7 @@
 # Always point to the root of the build tree (needs GNU make).
 BUILD_DIR=$(CURDIR)
 
-GENERATED_HEADERS = config-host.h trace.h qemu-options.def
-ifeq ($(TRACE_BACKEND),dtrace)
-GENERATED_HEADERS += trace-dtrace.h
-endif
-GENERATED_HEADERS += qmp-commands.h qapi-types.h qapi-visit.h
-GENERATED_SOURCES += qmp-marshal.c qapi-types.c qapi-visit.c
-
+# All following code might depend on configuration variables
 ifneq ($(wildcard config-host.mak),)
 # Put the all: rule here so that config-host.mak can contain dependencies.
 all: build-all
@@ -24,6 +18,13 @@ config-host.mak:
 	@exit 1
 endif
 
+GENERATED_HEADERS = config-host.h trace.h qemu-options.def
+ifeq ($(TRACE_BACKEND),dtrace)
+GENERATED_HEADERS += trace-dtrace.h
+endif
+GENERATED_HEADERS += qmp-commands.h qapi-types.h qapi-visit.h
+GENERATED_SOURCES += qmp-marshal.c qapi-types.c qapi-visit.c
+
 # Don't try to regenerate Makefile or configure
 # We don't generate any of them
 Makefile: ;
Applied
#2 lore raw
In reply to Lluís Vilanova

Thanks, applied.

Quoted 45 lines · Lluís Vilanova

Current code depends on variables defined in config-host.mak before it is actually included.

Cc Anthony Liguori <[email protected]>
Cc Paul Brook <[email protected]>

---
 Makefile |   15 ++++++++-------

 1 files changed, 8 insertions(+), 7 deletions(-)
Makefile +1 -7
index 49c775b..408065e 100644
@@ -3,13 +3,7 @@
  # Always point to the root of the build tree (needs GNU make).
  BUILD_DIR=$(CURDIR)
 
-GENERATED_HEADERS = config-host.h trace.h qemu-options.def
-ifeq ($(TRACE_BACKEND),dtrace)
-GENERATED_HEADERS += trace-dtrace.h
-endif
-GENERATED_HEADERS += qmp-commands.h qapi-types.h qapi-visit.h
-GENERATED_SOURCES += qmp-marshal.c qapi-types.c qapi-visit.c
-
+# All following code might depend on configuration variables
  ifneq ($(wildcard config-host.mak),)
  # Put the all: rule here so that config-host.mak can contain dependencies.

 all: build-all

Makefile +0 -0
@@ -24,6 +18,13 @@ config-host.mak:

       @exit 1
 endif

Makefile +7 -0
+GENERATED_HEADERS = config-host.h trace.h qemu-options.def
+ifeq ($(TRACE_BACKEND),dtrace)
+GENERATED_HEADERS += trace-dtrace.h
+endif
+GENERATED_HEADERS += qmp-commands.h qapi-types.h qapi-visit.h
+GENERATED_SOURCES += qmp-marshal.c qapi-types.c qapi-visit.c
+

 # Don't try to regenerate Makefile or configure
 # We don't generate any of them
 Makefile: ;