kvm: tessuite: disable stack protector in test suite
[qemu-kvm/fedora.git] / kvm / user / Makefile
blob52d44b3778d2934357c259cda3b399723aa08167
2 include config.mak
4 # cc-option
5 # Usage: OP_CFLAGS+=$(call cc-option, -falign-functions=0, -malign-functions=0)
7 cc-option = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \
8 > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
10 CFLAGS = -I $(KERNELDIR)/include $(autodepend-flags) -g -fomit-frame-pointer \
11 -Wall -m$(bits)
12 CFLAGS += $(call cc-option, -fno-stack-protector, "")
13 CFLAGS += $(call cc-option, -fno-stack-protector-all, "")
15 CXXFLAGS = $(autodepend-flags)
17 autodepend-flags = -MMD -MF $(dir $*).$(notdir $*).d
19 DESTDIR =
21 ifeq ($(shell uname -m), x86_64)
22 LIBDIR = /lib64
23 cstart.o = test/cstart64.o
24 bits = 64
25 ldarch = elf64-x86-64
26 else
27 LIBDIR = /lib
28 cstart.o = test/cstart.o
29 bits = 32
30 ldarch = elf32-i386
31 endif
33 all: kvmctl libkvm.a flatfiles
35 kvmctl: kvmctl.o main.o
37 balloon_ctl: balloon_ctl.o
39 libkvm.a: kvmctl.o
40 $(AR) rcs $@ $^
42 flatfiles-common = test/simple.flat test/stringio.flat test/memtest1.flat \
43 test/bootstrap test/vmexit.flat
45 flatfiles-32 =
47 flatfiles-64 = test/access.flat test/irq.flat test/sieve.flat
49 flatfiles: $(flatfiles-common) $(flatfiles-$(bits))
51 install:
52 install -D kvmctl.h $(DESTDIR)/$(PREFIX)/include/kvmctl.h
53 install -D $(KERNELDIR)/include/linux/kvm.h \
54 $(DESTDIR)/$(PREFIX)/include/linux/kvm.h
55 install -D libkvm.a $(DESTDIR)/$(PREFIX)/$(LIBDIR)/libkvm.a
57 %.flat: %.o
58 gcc $(CFLAGS) -nostdlib -o $@ -Wl,-T,flat.lds $^
60 test/bootstrap: test/bootstrap.o
61 gcc -nostdlib -o $@ -Wl,-T,bootstrap.lds $^
63 %.o: %.S
64 gcc $(CFLAGS) -c -nostdlib -o $@ $^
66 test/irq.flat: test/print.o
68 test/access.flat: $(cstart.o) test/access.o test/printf.o test/print.o
70 test/sieve.flat: $(cstart.o) test/sieve.o test/print.o test/vm.o
72 test/vmexit.flat: $(cstart.o) test/vmexit.o test/printf.o
74 test/test32.flat: test/test32.o
76 test/%.o: CFLAGS += -std=gnu99 -ffreestanding
78 -include .*.d
80 clean:
81 $(RM) kvmctl *.o *.a .*.d
82 $(RM) test/bootstrap test/*.o test/*.flat test/.*.d