Package: hello-traditional
Version: 2.10-3
Severity: wishlist
Tags: patch

Hi!

Here's a patch that tries to improve the rules targets. Here's the
rationale:

* Change each binary specific target to depend on its matching build
  target, so that there is no wasted work when doing an arch-indep or
  arch-dep build.
* Make build a PHONY target, and stop using a stamp file. Those are
  an antifeature any time that make can already track if it needs to
  rebuild files. They also disallow modifying a file and trying to
  rebuild the package w/o first cleaning it like with:
    «dpkg-buildpackage -us -uc -nc»
* Split the configure step into its own target and use config.status
  as its stamp file, because configure will run every time otherwise,
  and its an artifact created by configure.

Thanks,
Guillem
diff --git a/debian/rules b/debian/rules
index 8142477..d42f23b 100755
--- a/debian/rules
+++ b/debian/rules
@@ -36,23 +36,27 @@ ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
   STRIP = $(stripcmd) --remove-section=.comment --remove-section=.note
 endif
 
-build:
+config.status: configure
 	./configure CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" \
 		LDFLAGS="$(LDFLAGS)" $(confflags) --prefix=/usr
+
+build-arch: config.status
 	$(MAKE)
-	touch build
+
+build-indep:
+
+build: build-arch build-indep
 
 clean:
-	rm -f build
 	[ ! -f Makefile ] || $(MAKE) distclean
 	rm -rf *~ debian/tmp debian/*~ debian/files* debian/substvars
 
-binary-indep: build
+binary-indep: build-indep
 # There are no architecture-independent files to be uploaded
 # generated by this package.  If there were any they would be
 # made here.
 
-binary-arch: build
+binary-arch: build-arch
 	rm -rf debian/tmp
 	install -d debian/tmp/DEBIAN $(docdir)
 	$(MAKE) prefix="$$(pwd)/debian/tmp/usr" install
@@ -76,8 +80,4 @@ binary-arch: build
 
 binary: binary-indep binary-arch
 
-build-arch: build
-
-build-indep: build
-
-.PHONY: binary binary-arch binary-indep build-arch build-indep clean
+.PHONY: binary binary-arch binary-indep build build-arch build-indep clean

Reply via email to