3 # Copyright (C) 2003 Christophe Varoqui, <christophe.varoqui@free.fr>
8 # Try to supply the linux kernel headers.
11 KRNLLIB = /lib/modules/$(shell uname -r)
12 ifeq ($(shell test -r $(KRNLLIB)/source && echo 1),1)
13 KRNLSRC = $(KRNLLIB)/source
14 KRNLOBJ = $(KRNLLIB)/build
16 KRNLSRC = $(KRNLLIB)/build
17 KRNLOBJ = $(KRNLLIB)/build
23 BUILDDIRS = libmultipath libcheckers path_priority \
24 devmap_name multipath multipathd kpartx
25 ALLDIRS = $(shell find . -type d -maxdepth 1 -mindepth 1 ! -name \.git)
27 VERSION = $(shell basename ${PWD} | cut -d'-' -f3)
28 INSTALLDIRS = devmap_name multipath multipathd kpartx path_priority
33 @for dir in $(BUILDDIRS); do \
34 $(MAKE) -C $$dir BUILD=$(BUILD) VERSION=$(VERSION) \
35 KRNLSRC=$(KRNLSRC) KRNLOBJ=$(KRNLOBJ) || exit $?; \
39 @for dir in $(ALLDIRS); do\
40 $(MAKE) -C $$dir clean || exit $?; \
44 @for dir in $(INSTALLDIRS); do\
45 $(MAKE) -C $$dir install || exit $?; \
49 @for dir in $(INSTALLDIRS); do\
50 $(MAKE) -C $$dir uninstall || exit $?; \
54 rm -f multipath-tools.spec
57 install: recurse_install
59 uninstall: recurse_uninstall
62 sed -e "s/__VERSION__/${VERSION}/" \
63 multipath-tools.spec.in > multipath-tools.spec
66 rpmbuild -bb multipath-tools.spec