kvm: external module: pci_get_bus_and_slot() compatibility
[kvm-userspace.git] / libkvm / Makefile
blob5d96e1d787e4f0eaaf600f66277b5c9c24474616
1 include ../config.mak
2 include config-$(ARCH).mak
4 # cc-option
5 # Usage: OP_CFLAGS+=$(call cc-option, -falign-functions=0, -malign-functions=0)
6 cc-option = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \
7 > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
9 CFLAGS += $(autodepend-flags) -g -fomit-frame-pointer -Wall
10 CFLAGS += $(call cc-option, -fno-stack-protector, "")
11 CFLAGS += $(call cc-option, -fno-stack-protector-all, "")
12 CFLAGS += -I $(LIBKVM_KERNELDIR)/include
14 LDFLAGS += $(CFLAGS)
16 CXXFLAGS = $(autodepend-flags)
18 autodepend-flags = -MMD -MF $(dir $*).$(notdir $*).d
21 all: libkvm.a
23 libkvm.a: libkvm.o $(libkvm-$(ARCH)-objs)
24 $(AR) rcs $@ $^
26 install:
27 install -D libkvm.h $(DESTDIR)/$(PREFIX)/include/libkvm.h
28 install -D $(LIBKVM_KERNELDIR)/include/linux/kvm.h \
29 $(DESTDIR)/$(PREFIX)/include/linux/kvm.h
30 install -D $(LIBKVM_KERNELDIR)/include/linux/kvm_para.h \
31 $(DESTDIR)/$(PREFIX)/include/linux/kvm_para.h
32 install -D libkvm.a $(DESTDIR)/$(PREFIX)/$(LIBDIR)/libkvm.a
34 -include .*.d
36 clean:
37 $(RM) *.o *.a .*.d