]>
Commit | Line | Data |
---|---|---|
064af421 BP |
1 | #!/usr/bin/make -f |
2 | # -*- makefile -*- | |
3 | # Sample debian/rules that uses debhelper. | |
4 | # | |
5 | # This file was originally written by Joey Hess and Craig Small. | |
6 | # As a special exception, when this file is copied by dh-make into a | |
7 | # dh-make output file, you may use that output file without restriction. | |
8 | # This special exception was added by Craig Small in version 0.37 of dh-make. | |
9 | # | |
10 | # Modified to make a template file for a multi-binary package with separated | |
11 | # build-arch and build-indep targets by Bill Allombert 2001 | |
12 | ||
064af421 BP |
13 | # Official build number. Leave set to 0 if not an official build. |
14 | BUILD_NUMBER = 0 | |
15 | ||
819a2d4c | 16 | ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) |
a1b3608f BP |
17 | PARALLEL = -j$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) |
18 | else | |
19 | PARALLEL = | |
819a2d4c | 20 | endif |
a1b3608f | 21 | MAKEFLAGS += $(PARALLEL) |
819a2d4c BP |
22 | |
23 | ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS))) | |
24 | CFLAGS += -O0 | |
25 | else | |
26 | CFLAGS += -O2 | |
27 | endif | |
28 | ||
064af421 BP |
29 | configure: configure-stamp |
30 | configure-stamp: | |
31 | dh_testdir | |
32 | test -e configure || ./boot.sh | |
33 | test -d _debian || mkdir _debian | |
6aa7dc83 | 34 | echo $(DEB_BUILD_OPTIONS) |
a84edf54 | 35 | echo $$CC |
064af421 BP |
36 | cd _debian && ( \ |
37 | test -e Makefile || \ | |
38 | ../configure --prefix=/usr --localstatedir=/var --enable-ssl \ | |
39 | --with-build-number=$(BUILD_NUMBER) \ | |
819a2d4c | 40 | CFLAGS="$(CFLAGS)" $(DATAPATH_CONFIGURE_OPTS)) |
064af421 BP |
41 | touch configure-stamp |
42 | ||
43 | #Architecture | |
44 | build: build-arch build-indep | |
45 | ||
46 | build-arch: build-arch-stamp | |
47 | build-arch-stamp: configure-stamp | |
48 | $(MAKE) -C _debian | |
52db0bbe | 49 | ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) |
a1b3608f BP |
50 | if $(MAKE) -C _debian check TESTSUITEFLAGS='$(PARALLEL)'; then :; \ |
51 | else \ | |
ff8c6aa1 BP |
52 | cat _debian/tests/testsuite.log; \ |
53 | exit 1; \ | |
54 | fi | |
52db0bbe | 55 | endif |
064af421 BP |
56 | touch $@ |
57 | ||
58 | build-indep: build-indep-stamp | |
59 | build-indep-stamp: configure-stamp | |
60 | $(MAKE) -C _debian dist distdir=openvswitch | |
61 | touch $@ | |
62 | ||
63 | clean: | |
64 | dh_testdir | |
65 | dh_testroot | |
66 | rm -f build-arch-stamp build-indep-stamp configure-stamp | |
67 | rm -rf _debian | |
68 | [ ! -f Makefile ] || $(MAKE) distclean | |
69 | dh_clean | |
064af421 | 70 | |
064af421 BP |
71 | install: install-indep install-arch |
72 | install-indep: build-indep | |
73 | dh_testdir | |
74 | dh_testroot | |
75 | dh_clean -k -i | |
76 | dh_installdirs -i | |
77 | dh_install -i | |
a84edf54 BP |
78 | sed 's/^BUILD_NUMBER = .*/BUILD_NUMBER = $(BUILD_NUMBER)/' \ |
79 | < debian/rules.modules \ | |
80 | > debian/openvswitch-datapath-source/usr/src/modules/openvswitch-datapath/debian/rules | |
81 | chmod 755 debian/openvswitch-datapath-source/usr/src/modules/openvswitch-datapath/debian/rules | |
064af421 | 82 | cd debian/openvswitch-datapath-source/usr/src && tar -c modules | bzip2 -9 > openvswitch-datapath.tar.bz2 && rm -rf modules |
064af421 BP |
83 | |
84 | install-arch: build-arch | |
85 | dh_testdir | |
86 | dh_testroot | |
87 | dh_clean -k -s | |
88 | dh_installdirs -s | |
89 | $(MAKE) -C _debian DESTDIR=$(CURDIR)/debian/openvswitch install | |
064af421 BP |
90 | cp debian/openvswitch-switch.template debian/openvswitch-switch/usr/share/openvswitch/switch/default.template |
91 | dh_install -s | |
064af421 BP |
92 | |
93 | # Must not depend on anything. This is to be called by | |
94 | # binary-arch/binary-indep | |
95 | # in another 'make' thread. | |
96 | binary-common: | |
97 | dh_testdir | |
98 | dh_testroot | |
99 | dh_installchangelogs | |
100 | dh_installdocs | |
101 | dh_installexamples | |
102 | dh_installdebconf | |
103 | dh_installlogrotate | |
d3643fc5 | 104 | dh_installinit -R |
064af421 BP |
105 | dh_installcron |
106 | dh_installman | |
107 | dh_link | |
108 | dh_strip --dbg-package=openvswitch-dbg | |
109 | dh_compress | |
110 | dh_fixperms -X var/log/core | |
c0c2489a | 111 | dh_pysupport |
064af421 BP |
112 | dh_perl |
113 | dh_makeshlibs | |
114 | dh_installdeb | |
115 | dh_shlibdeps | |
116 | dh_gencontrol | |
117 | dh_md5sums | |
118 | dh_builddeb | |
119 | binary-indep: install-indep | |
120 | $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common | |
121 | binary-arch: install-arch | |
122 | $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common | |
123 | ||
124 | binary: binary-arch binary-indep | |
125 | .PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure | |
6aa7dc83 BP |
126 | |
127 | # This GNU make extensions disables parallel builds for the current Makefile | |
128 | # but not for sub-Makefiles. This is appropriate here because build-arch and | |
129 | # build-indep both invoke "make" on OVS, which can update some of the same | |
130 | # targets in ways that conflict (e.g. both update tests/testsuite). | |
131 | .NOTPARALLEL: |