kvm: release: merge from trunk
[kvm-userspace.git] / kernel / Makefile
blob78e31a4c794334c29e97327a7aaf25dd53ffd02a
1 include ../config.mak
2 KERNELDIR ?= /lib/modules/$(shell uname -r)/build
3 KVERREL = $(patsubst /lib/modules/%/build,%,$(KERNELDIR))
5 DESTDIR=
7 INSTALLDIR = $(patsubst %/build,%/extra,$(KERNELDIR))
9 rpmrelease = devel
11 all::
12 $(MAKE) -C $(KERNELDIR) M=`pwd` "$$@"
14 install:
15 mkdir -p $(DESTDIR)/$(INSTALLDIR)
16 cp *.ko $(DESTDIR)/$(INSTALLDIR)
17 /sbin/depmod -a
19 tmpspec = .tmp.kvm-kmod.spec
20 RPMDIR = $$(pwd)/../RPMS
21 rpm: all
22 mkdir -p ../BUILD $(RPMDIR)/$$(uname -m)
23 sed 's/^Release:.*/Release: $(rpmrelease)/' kvm-kmod.spec > $(tmpspec)
24 rpmbuild --define="kverrel $(KVERREL)" \
25 --define="objdir $$(pwd)" \
26 --define="_rpmdir $(RPMDIR)" \
27 --define="_topdir $$(pwd)/.." \
28 -bb $(tmpspec)
30 clean:
31 $(MAKE) -C $(KERNELDIR) M=`pwd` $@
33 svnclean:
34 svn st | grep '^\?' | awk '{print $2}' | xargs rm -rf