Device-assignment: free device if hotplug fails
[qemu-kvm/fedora.git] / kvm / user / Makefile
blobcf7f8ed7410953dcf33afadadafba60597687b69
2 include config.mak
4 DESTDIR :=
6 .PHONY: arch_clean clean
8 #make sure env CFLAGS variable is not used
9 CFLAGS =
11 libgcc := $(shell $(CC) --print-libgcc-file-name)
13 libcflat := test/lib/libcflat.a
14 cflatobjs := \
15 test/lib/panic.o \
16 test/lib/printf.o \
17 test/lib/string.o
19 #include architecure specific make rules
20 include config-$(ARCH).mak
22 # cc-option
23 # Usage: OP_CFLAGS+=$(call cc-option, -falign-functions=0, -malign-functions=0)
25 cc-option = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \
26 > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
28 CFLAGS += -O1
29 CFLAGS += $(autodepend-flags) -g -fomit-frame-pointer -Wall
30 CFLAGS += $(call cc-option, -fno-stack-protector, "")
31 CFLAGS += $(call cc-option, -fno-stack-protector-all, "")
32 CFLAGS += -I ../libkvm
34 LDFLAGS += $(CFLAGS) -L ../libkvm
36 CXXFLAGS = $(autodepend-flags)
38 autodepend-flags = -MMD -MF $(dir $*).$(notdir $*).d
40 LDFLAGS += -pthread -lrt
42 kvmtrace_objs= kvmtrace.o
44 kvmctl: $(kvmctl_objs)
45 $(CC) $(LDFLAGS) $^ -o $@
47 kvmtrace: $(kvmtrace_objs)
48 $(CC) $(LDFLAGS) $^ -o $@
50 $(libcflat): $(cflatobjs)
51 $(AR) rcs $@ $^
53 %.o: %.S
54 $(CC) $(CFLAGS) -c -nostdlib -o $@ $^
56 -include .*.d
58 clean: arch_clean
59 $(RM) kvmctl kvmtrace *.o *.a .*.d $(libcflat) $(cflatobjs)