File: Makefile

package info (click to toggle)
multipath-tools 0.4.7-1.1etch2
  • links: PTS
  • area: main
  • in suites: etch
  • size: 1,204 kB
  • ctags: 2,144
  • sloc: ansic: 18,261; makefile: 398; sh: 286
file content (67 lines) | stat: -rw-r--r-- 1,359 bytes parent folder | download | duplicates (2)
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Makefile
#
# Copyright (C) 2003 Christophe Varoqui, <christophe.varoqui@free.fr>

BUILD = glibc

#
# Try to supply the linux kernel headers.
#
ifeq    ($(KRNLSRC),)
KRNLLIB = /lib/modules/$(shell uname -r)
ifeq    ($(shell test -r $(KRNLLIB)/source && echo 1),1)
KRNLSRC = $(KRNLLIB)/source
KRNLOBJ = $(KRNLLIB)/build
else
KRNLSRC = $(KRNLLIB)/build
KRNLOBJ = $(KRNLLIB)/build
endif
endif
export KRNLSRC
export KRNLOBJ

BUILDDIRS = $(shell find . -mindepth 2 -name Makefile -exec dirname {} \; | grep -v ^lib)

ifeq   ($(MULTIPATH_VERSION),)
VERSION = $(shell basename ${PWD} | cut -d'-' -f3)
else
VERSION = $(MULTIPATH_VERSION)
endif

all: recurse

recurse:
	@for dir in $(BUILDDIRS); do \
	$(MAKE) -C $$dir BUILD=$(BUILD) VERSION=$(VERSION) \
		KRNLSRC=$(KRNLSRC) KRNLOBJ=$(KRNLOBJ) || exit $?; \
	done

recurse_clean:
	@for dir in $(BUILDDIRS); do \
	$(MAKE) -C $$dir clean || exit $?; \
	done

recurse_install:
	@for dir in $(BUILDDIRS); do \
	$(MAKE) -C $$dir install || exit $?; \
	done

recurse_uninstall:
	@for dir in $(BUILDDIRS); do \
	$(MAKE) -C $$dir uninstall || exit $?; \
	done

clean:	recurse_clean
	rm -f multipath-tools.spec
	rm -rf rpms

install:	recurse_install

uninstall:	recurse_uninstall

release:
	sed -e "s/__VERSION__/${VERSION}/" \
	multipath-tools.spec.in > multipath-tools.spec

rpm: release
	rpmbuild -bb multipath-tools.spec