[PATCH V2 evolve-ext] debian: clean up rules file
Pierre-Yves David
pierre-yves.david at ens-lyon.org
Tue Sep 2 14:10:31 CDT 2014
On 08/17/2014 12:35 AM, Faheem Mitha wrote:
> # HG changeset patch
> # User Faheem Mitha <faheem at faheem.info>
> # Date 1408227240 -19800
> # Sun Aug 17 03:44:00 2014 +0530
> # Branch stable
> # Node ID 7568048c9776085be3af4cc05668a57664c08bcd
> # Parent f3867e60d0720f3f842f631317fa1cbb2ef3b5a4
> debian: clean up rules file
Can I get this as a series with each change in its own patches?
>
> * Add DH_VERBOSE, commented out, for debugging convenience.
>
> * Remove clean target before implicit match rule. This is redundant
> because it is a match-everything rule. Possibly a typo.
>
> * Replace build line with a dh_override_auto_build line. This is more
> in line with how dh is supposed to work. In particular,
> dh_auto_build is functionally equivalent to the repeated "dh build
> --with python2 --buildsystem=python_distutils" used currently.
>
> * Similarly, replace clean with override_dh_auto_clean. The current
> version does not call the default dh_auto_build, which is a bug.
> This is required in particular for cleaning the build directories.
>
> * Remove .PHONY line completely. This does not work in the case of
> implicit pattern matching rules as used by dh. Consider this example
> from Dr. Geoffrey Thomas:
>
> faheem at orwell:/tmp/test$ 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
> faheem at orwell:/tmp/test$ cat Makefile
> %: %.c
> gcc -o $@ $<
> .PHONY: blue
>
> faheem at orwell:/tmp/test$ make red
> gcc -o red red.c
> faheem at orwell:/tmp/test$ make green
> gcc -o green green.c
> faheem at orwell:/tmp/test$ 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.
>
> diff -r f3867e60d072 -r 7568048c9776 debian/rules
> --- a/debian/rules
> +++ b/debian/rules
> @@ -1,10 +1,11 @@
> #!/usr/bin/make -f
> +#export DH_VERBOSE=1
>
> -clean %:
> +%:
> dh $@ --with python2 --buildsystem=python_distutils
>
> -build:
> - dh build --with python2 --buildsystem=python_distutils
> +override_dh_auto_build:
> + dh_auto_build
> $(MAKE) -C docs
>
> ifeq (,$(filter nocheck, $(DEB_BUILD_OPTIONS)))
> @@ -17,12 +18,11 @@
> find debian -name __init__.py -delete
> dh_python2
>
> -clean: clean-docs
> +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
> -
> -.PHONY: build clean clean-docs
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>
--
Pierre-Yves David
More information about the Mercurial-devel
mailing list