Commit 1b468b3a authored by Andrew Jones's avatar Andrew Jones Committed by Paolo Bonzini
Browse files

makefile and run_tests tweaks



- remove a redundant '-display none'
- remove a redundant -g from CFLAGS
- remove a useless -I../include/x86 from CFLAGS
- remove lib autodep files on make clean
Signed-off-by: Andrew Jones's avatarAndrew Jones <drjones@redhat.com>
Acked-by: default avatarChristoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 2a814baa
...@@ -6,16 +6,16 @@ DESTDIR := $(PREFIX)/share/qemu/tests ...@@ -6,16 +6,16 @@ DESTDIR := $(PREFIX)/share/qemu/tests
.PHONY: arch_clean clean .PHONY: arch_clean clean
#make sure env CFLAGS variable is not used #make sure env CFLAGS variable is not used
CFLAGS = -g CFLAGS =
libgcc := $(shell $(CC) --print-libgcc-file-name) libgcc := $(shell $(CC) --print-libgcc-file-name)
libcflat := lib/libcflat.a libcflat := lib/libcflat.a
cflatobjs := \ cflatobjs := \
lib/argv.o \
lib/printf.o \ lib/printf.o \
lib/string.o \ lib/string.o \
lib/report.o lib/report.o
cflatobjs += lib/argv.o
#include architecure specific make rules #include architecure specific make rules
include config-$(ARCH).mak include config-$(ARCH).mak
...@@ -26,8 +26,9 @@ include config-$(ARCH).mak ...@@ -26,8 +26,9 @@ include config-$(ARCH).mak
cc-option = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \ cc-option = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \
> /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;) > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
CFLAGS += -O1 CFLAGS += -g
CFLAGS += $(autodepend-flags) -g -fomit-frame-pointer -Wall CFLAGS += $(autodepend-flags) -Wall
CFLAGS += $(call cc-option, -fomit-frame-pointer, "")
CFLAGS += $(call cc-option, -fno-stack-protector, "") CFLAGS += $(call cc-option, -fno-stack-protector, "")
CFLAGS += $(call cc-option, -fno-stack-protector-all, "") CFLAGS += $(call cc-option, -fno-stack-protector-all, "")
CFLAGS += -I. CFLAGS += -I.
...@@ -52,4 +53,4 @@ install: ...@@ -52,4 +53,4 @@ install:
install $(tests_and_config) $(DESTDIR) install $(tests_and_config) $(DESTDIR)
clean: arch_clean clean: arch_clean
$(RM) *.o *.a .*.d $(libcflat) $(cflatobjs) $(RM) *.o *.a .*.d lib/.*.d $(libcflat) $(cflatobjs)
#This is a make file with common rules for both x86 & x86-64 #This is a make file with common rules for both x86 & x86-64
CFLAGS += -I../include/x86
all: test_cases all: test_cases
cflatobjs += \ cflatobjs += lib/x86/io.o
lib/x86/io.o \ cflatobjs += lib/x86/smp.o
lib/x86/smp.o
cflatobjs += lib/x86/vm.o cflatobjs += lib/x86/vm.o
cflatobjs += lib/x86/fwcfg.o cflatobjs += lib/x86/fwcfg.o
cflatobjs += lib/x86/apic.o cflatobjs += lib/x86/apic.o
...@@ -20,15 +16,17 @@ $(libcflat): LDFLAGS += -nostdlib ...@@ -20,15 +16,17 @@ $(libcflat): LDFLAGS += -nostdlib
$(libcflat): CFLAGS += -ffreestanding -I lib $(libcflat): CFLAGS += -ffreestanding -I lib
CFLAGS += -m$(bits) CFLAGS += -m$(bits)
CFLAGS += -O1
libgcc := $(shell $(CC) -m$(bits) --print-libgcc-file-name) libgcc := $(shell $(CC) -m$(bits) --print-libgcc-file-name)
FLATLIBS = lib/libcflat.a $(libgcc) FLATLIBS = lib/libcflat.a $(libgcc)
%.elf: %.o $(FLATLIBS) flat.lds %.elf: %.o $(FLATLIBS) flat.lds
$(CC) $(CFLAGS) -nostdlib -o $@ -Wl,-T,flat.lds $(filter %.o, $^) $(FLATLIBS) $(CC) $(CFLAGS) -nostdlib -o $@ -Wl,-T,flat.lds \
$(filter %.o, $^) $(FLATLIBS)
%.flat: %.elf %.flat: %.elf
objcopy -O elf32-i386 $^ $@ $(OBJCOPY) -O elf32-i386 $^ $@
tests-common = $(TEST_DIR)/vmexit.flat $(TEST_DIR)/tsc.flat \ tests-common = $(TEST_DIR)/vmexit.flat $(TEST_DIR)/tsc.flat \
$(TEST_DIR)/smptest.flat $(TEST_DIR)/port80.flat \ $(TEST_DIR)/smptest.flat $(TEST_DIR)/port80.flat \
...@@ -109,7 +107,7 @@ $(TEST_DIR)/debug.elf: $(cstart.o) $(TEST_DIR)/debug.o ...@@ -109,7 +107,7 @@ $(TEST_DIR)/debug.elf: $(cstart.o) $(TEST_DIR)/debug.o
arch_clean: arch_clean:
$(RM) $(TEST_DIR)/*.o $(TEST_DIR)/*.flat $(TEST_DIR)/*.elf \ $(RM) $(TEST_DIR)/*.o $(TEST_DIR)/*.flat $(TEST_DIR)/*.elf \
$(TEST_DIR)/.*.d $(TEST_DIR)/lib/.*.d $(TEST_DIR)/lib/*.o $(TEST_DIR)/.*.d lib/x86/.*.d
api/%.o: CFLAGS += -m32 api/%.o: CFLAGS += -m32
......
...@@ -27,7 +27,7 @@ function run() ...@@ -27,7 +27,7 @@ function run()
return return
fi fi
cmdline="./x86-run $kernel -smp $smp -display none $opts" cmdline="./x86-run $kernel -smp $smp $opts"
if [ $verbose != 0 ]; then if [ $verbose != 0 ]; then
echo $cmdline echo $cmdline
fi fi
...@@ -92,8 +92,8 @@ Usage: $0 [-g group] [-h] [-v] ...@@ -92,8 +92,8 @@ Usage: $0 [-g group] [-h] [-v]
-h: Output this help text -h: Output this help text
-v: Enables verbose mode -v: Enables verbose mode
Set the environment variable QEMU=/path/to/qemu-system-x86_64 to allow the Set the environment variable QEMU=/path/to/qemu-system-x86_64 to
internally used x86-run to pick up the right qemu binary. specify the appropriate qemu binary for x86-run.
EOF EOF
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment