debian/rules
author Faheem Mitha <faheem@faheem.info>
Sat, 11 Oct 2014 02:27:21 +0530
changeset 1127 87625964c333
parent 1126 aef5e42a4fde
child 1165 f0978cb993a0
permissions -rwxr-xr-x
debian: remove .PHONY line completely This does not work in the case of implicit pattern matching rules as used by dh. Consider this example from Geoffrey Thomas: $ ls -l total 16 -rw-r--r-- 1 faheem faheem 17 Aug 16 20:27 blue.c -rw-r--r-- 1 faheem faheem 17 Aug 16 20:27 green.c -rw-r--r-- 1 faheem faheem 35 Aug 16 20:26 Makefile -rw-r--r-- 1 faheem faheem 17 Aug 16 20:27 red.c $ cat Makefile %: %.c gcc -o $@ $< .PHONY: blue $ make red gcc -o red red.c $ make green gcc -o green green.c $ make blue make: Nothing to be done for blue'. The Make manual (http://www.gnu.org/software/make/manual/make.html#Phony-Targets) says Since it knows that phony targets do not name actual files that could be remade from other files, make skips the implicit rule search for phony targets (see Implicit Rules). Thanks to the good folks on #debian-mentors on OFTC for instruction and explanation in these matters.

#!/usr/bin/make -f
#export DH_VERBOSE=1

%:
	dh $@ --with python2 --buildsystem=python_distutils

override_dh_auto_build:
	dh_auto_build
	$(MAKE) -C docs

ifeq (,$(filter nocheck, $(DEB_BUILD_OPTIONS)))
override_dh_auto_test:
	cd tests &&  python run-tests.py --with-hg=`which hg`
endif

override_dh_python2:
	# avoid conflict with mercurial's own hgext/__init__.py
	find debian -name __init__.py -delete
	dh_python2

override_dh_auto_clean: clean-docs
	dh_auto_clean
	rm -f tests/*.err

clean-docs:
	rm -rf html
	rm -f docs/static/logo-evolve.ico
	rm -f docs/tutorials/tutorial.rst