3 # Sample debian/rules that uses debhelper.
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.
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
13 # Official build number. Leave set to 0 if not an official build.
16 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
17 PARALLEL = -j$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
21 MAKEFLAGS += $(PARALLEL)
23 ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
29 configure: configure-stamp
32 test -e configure || ./boot.sh
33 test -d _debian || mkdir _debian
34 echo $(DEB_BUILD_OPTIONS)
38 ../configure --prefix=/usr --localstatedir=/var --enable-ssl \
39 --sysconfdir=/etc --with-build-number=$(BUILD_NUMBER) \
40 CFLAGS="$(CFLAGS)" $(DATAPATH_CONFIGURE_OPTS))
44 build: build-arch build-indep
46 build-arch: build-arch-stamp
47 build-arch-stamp: configure-stamp
49 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
50 if $(MAKE) -C _debian check TESTSUITEFLAGS='$(PARALLEL)'; then :; \
52 cat _debian/tests/testsuite.log; \
58 build-indep: build-indep-stamp
59 build-indep-stamp: configure-stamp
60 $(MAKE) -C _debian dist distdir=openvswitch
66 rm -f build-arch-stamp build-indep-stamp configure-stamp
68 [ ! -f Makefile ] || $(MAKE) distclean
71 install: install-indep install-arch
72 install-indep: build-indep
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
82 cd debian/openvswitch-datapath-source/usr/src && tar -c modules | bzip2 -9 > openvswitch-datapath.tar.bz2 && rm -rf modules
84 install-arch: build-arch
89 $(MAKE) -C _debian DESTDIR=$(CURDIR)/debian/openvswitch install
90 cp debian/openvswitch-switch.template debian/openvswitch-switch/usr/share/openvswitch/switch/default.template
93 # Must not depend on anything. This is to be called by
94 # binary-arch/binary-indep
95 # in another 'make' thread.
108 dh_strip --dbg-package=openvswitch-dbg
110 dh_fixperms -X var/log/core
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
124 binary: binary-arch binary-indep
125 .PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure
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).