From: Jerone Young <jyoung5@us.ibm.com>
To: kvm@vger.kernel.org
Cc: kvm-ppc@vger.kernel.org
Subject: [PATCH 2 of 4] Add Makefile and test changes required for x86 to use libcflat
Date: Wed, 25 Jun 2008 15:39:12 -0500 [thread overview]
Message-ID: <14745903b59252ac4d1d.1214426352@thinkpadL> (raw)
In-Reply-To: <patchbomb.1214426350@thinkpadL>
6 files changed, 25 insertions(+), 15 deletions(-)
user/Makefile | 11 ++++++++++-
user/config-x86-common.mak | 16 ++++++++++------
user/main.c | 2 +-
user/test/x86/port80.c | 3 +--
user/test/x86/smptest.c | 5 ++---
user/test/x86/tsc.c | 3 +--
Signed-off-by: Jerone Young <jyoung5@us.ibm.com>
diff --git a/user/Makefile b/user/Makefile
--- a/user/Makefile
+++ b/user/Makefile
@@ -9,6 +9,12 @@
CFLAGS =
libgcc := $(shell $(CC) --print-libgcc-file-name)
+
+libcflat := test/lib/libcflat.a
+cflatobjs := \
+ test/lib/panic.o \
+ test/lib/printf.o \
+ test/lib/string.o
#include architecure specific make rules
include config-$(ARCH).mak
@@ -41,10 +47,13 @@
kvmtrace: $(kvmtrace_objs)
$(CC) $(LDFLAGS) $^ -o $@
+$(libcflat): $(cflatobjs)
+ ar rcs $@ $^
+
%.o: %.S
$(CC) $(CFLAGS) -c -nostdlib -o $@ $^
-include .*.d
clean: arch_clean
- $(RM) kvmctl kvmtrace *.o *.a .*.d
+ $(RM) kvmctl kvmtrace *.o *.a .*.d $(libcflat) $(cflatobjs)
diff --git a/user/config-x86-common.mak b/user/config-x86-common.mak
--- a/user/config-x86-common.mak
+++ b/user/config-x86-common.mak
@@ -5,7 +5,15 @@
kvmctl_objs= main.o iotable.o ../libkvm/libkvm.a
balloon_ctl: balloon_ctl.o
-FLATLIBS = $(TEST_DIR)/libcflat.a $(libgcc)
+cflatobjs += \
+ test/lib/x86/io.o \
+ test/lib/x86/smp.o
+
+$(libcflat): LDFLAGS += -nostdlib
+$(libcflat): CFLAGS += -ffreestanding -I test/lib
+
+
+FLATLIBS = test/lib/libcflat.a $(libgcc)
%.flat: %.o $(FLATLIBS)
$(CC) $(CFLAGS) -nostdlib -o $@ -Wl,-T,flat.lds $^ $(FLATLIBS)
@@ -15,7 +23,7 @@
test_cases: $(tests-common) $(tests)
-$(TEST_DIR)/%.o: CFLAGS += -std=gnu99 -ffreestanding -I$(TEST_DIR)/lib
+$(TEST_DIR)/%.o: CFLAGS += -std=gnu99 -ffreestanding -I test/lib -I test/lib/x86
$(TEST_DIR)/bootstrap: $(TEST_DIR)/bootstrap.o
$(CC) -nostdlib -o $@ -Wl,-T,bootstrap.lds $^
@@ -41,10 +49,6 @@
$(TEST_DIR)/tsc.flat: $(cstart.o) $(TEST_DIR)/tsc.o
-$(TEST_DIR)/libcflat.a: $(TEST_DIR)/lib/exit.o $(TEST_DIR)/lib/printf.o \
- $(TEST_DIR)/lib/smp.o $(TEST_DIR)/lib/string.o
- ar rcs $@ $^
-
arch_clean:
$(RM) $(TEST_DIR)/bootstrap $(TEST_DIR)/*.o $(TEST_DIR)/*.flat \
$(TEST_DIR)/.*.d $(TEST_DIR)/lib/.*.d $(TEST_DIR)/lib/*.o
diff --git a/user/main.c b/user/main.c
--- a/user/main.c
+++ b/user/main.c
@@ -17,7 +17,7 @@
#define _GNU_SOURCE
#include <libkvm.h>
-#include "test/x86/lib/apic.h"
+#include "test/lib/x86/apic.h"
#include "test/x86/ioram.h"
#include <stdio.h>
diff --git a/user/test/x86/port80.c b/user/test/x86/port80.c
--- a/user/test/x86/port80.c
+++ b/user/test/x86/port80.c
@@ -1,5 +1,4 @@
-
-#include "printf.h"
+#include <libcflat.h>
int main()
{
diff --git a/user/test/x86/smptest.c b/user/test/x86/smptest.c
--- a/user/test/x86/smptest.c
+++ b/user/test/x86/smptest.c
@@ -1,6 +1,5 @@
-
-#include "smp.h"
-#include "printf.h"
+#include <libcflat.h>
+#include <smp.h>
static void ipi_test(void *data)
{
diff --git a/user/test/x86/tsc.c b/user/test/x86/tsc.c
--- a/user/test/x86/tsc.c
+++ b/user/test/x86/tsc.c
@@ -1,5 +1,4 @@
-
-#include "printf.h"
+#include <libcflat.h>
typedef unsigned long long u64;
next prev parent reply other threads:[~2008-06-25 20:41 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-25 20:39 [PATCH 0 of 4] [kvm-userspace][test] consolidate test libs to libcflat Jerone Young
2008-06-25 20:39 ` [PATCH 1 of 4] Consilidate libcflat for x86 to single lib for all archs Jerone Young
2008-06-25 20:39 ` Jerone Young [this message]
2008-06-25 20:39 ` [PATCH 3 of 4] Remove old x86 test libs, that are now appart of libcflat Jerone Young
2008-06-25 20:39 ` [PATCH 4 of 4] Add initial PowerPC libcflat files & make file changes Jerone Young
2008-06-25 21:28 ` Hollis Blanchard
2008-06-26 15:14 ` Jerone Young
2008-06-25 21:27 ` [PATCH 0 of 4] [kvm-userspace][test] consolidate test libs to libcflat Hollis Blanchard
2008-06-26 15:12 ` Jerone Young
2008-06-26 22:01 ` Hollis Blanchard
2008-06-29 9:10 ` Avi Kivity
2008-06-29 13:24 ` Avi Kivity
2008-07-01 7:33 ` Jerone Young
2008-07-05 9:28 ` Avi Kivity
2008-07-05 17:32 ` Jerone Young
2008-07-05 17:36 ` Avi Kivity
2008-07-05 17:59 ` Jerone Young
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=14745903b59252ac4d1d.1214426352@thinkpadL \
--to=jyoung5@us.ibm.com \
--cc=kvm-ppc@vger.kernel.org \
--cc=kvm@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox