Completed 'Build=Depends' (validated with pbuilder)
[senf.git] / Makefile
1 #----------------------------------------------------------------------
2 # Some SCONS shortcuts
3 #----------------------------------------------------------------------
4
5 CONCURRENCY_LEVEL ?= 1
6
7 SCONS=scons -j $(CONCURRENCY_LEVEL)
8
9 default: build
10
11 build:
12         $(SCONS)
13
14 clean:
15         $(SCONS) --clean all
16
17 all_docs all_tests all:
18         $(SCONS) $@
19
20 #----------------------------------------------------------------------
21 # Subversion stuff
22 #----------------------------------------------------------------------
23
24 svn_version:
25         @svnversion
26
27 #----------------------------------------------------------------------
28 # Building SENF requires some debian packages
29 #----------------------------------------------------------------------
30 DEB_BASE   = build-essential
31
32 # This line parses the 'Build-Depends' entry from debian/control
33 DEB_SENF   = $(shell perl -an -F'[:,]' -e '                                     \
34                          BEGIN{ $$,=" " }                                       \
35                          $$P=0 if /^\S/;                                        \
36                          map {s/\(.*\)//} @F;                                   \
37                          print @F if $$P;                                       \
38                          if (/^Build-Depends:/) { print @F[1..$$\#F]; $$P=1 }'  \
39                      debian/control | xargs echo)
40
41 prerequisites:
42         aptitude install $(DEB_BASE) $(DEB_SENF)
43
44 package:
45         $(SCONS) deb