summaryrefslogtreecommitdiff
path: root/libkvm/Makefile
blob: 72c36a617e9c338642141d7148c4509a630855c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
include ../config.mak
include config-$(ARCH).mak

# cc-option
# Usage: OP_CFLAGS+=$(call cc-option, -falign-functions=0, -malign-functions=0)
cc-option = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \
              > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)

CFLAGS += $(autodepend-flags) -g -fomit-frame-pointer -Wall
CFLAGS += $(call cc-option, -fno-stack-protector, "")
CFLAGS += $(call cc-option, -fno-stack-protector-all, "")
CFLAGS += -I $(LIBKVM_KERNELDIR)/include

LDFLAGS += $(CFLAGS)

CXXFLAGS = $(autodepend-flags)

autodepend-flags = -MMD -MF $(dir $*).$(notdir $*).d


all: libkvm.a

libkvm.a: libkvm.o $(libkvm-$(ARCH)-objs)
	$(AR) rcs $@ $^

install:
	@echo skipping libkvm install

install-libkvm:
	install -D libkvm.h $(DESTDIR)/$(PREFIX)/include/libkvm.h
	install -D libkvm.a $(DESTDIR)/$(PREFIX)/$(LIBDIR)/libkvm.a

install-kernel-headers:
	install -D $(LIBKVM_KERNELDIR)/include/linux/kvm.h \
		$(DESTDIR)/$(PREFIX)/include/linux/kvm.h
	install -D $(LIBKVM_KERNELDIR)/include/linux/kvm_para.h \
		$(DESTDIR)/$(PREFIX)/include/linux/kvm_para.h

-include .*.d

clean:
	$(RM) *.o *.a .*.d