[Build-common-hackers] Bug#521711: cdbs: Clean target is misordered when using cmake class.

Raúl Sánchez Siles rasasi78 at gmail.com
Sun Mar 29 16:25:25 UTC 2009

Package: cdbs
Version: 0.4.54
Severity: normal

When calling clean target, the clean sequence looks wrong. This is an except:

fakeroot debian/rules clean
test -x debian/rules
test "`id -u`" = 0
rmdir obj-x86_64-linux-gnu
rmdir: failed to remove «obj-x86_64-linux-gnu»: No existe el fichero o el 
make: [cleanbuilddir] Error 1 (no tiene efecto)
rm -rf obj-x86_64-linux-gnu
/usr/bin/make -C obj-x86_64-linux-gnu -k clean
make: *** obj-x86_64-linux-gnu: No existe el fichero o el directorio.  Alto.
make: [makefile-clean] Error 2 (no tiene efecto)
rm -f debian/stamp-makefile-build
/usr/bin/make -f debian/rules reverse-config

  In my case the rules file states:
include /usr/share/pkg-kde-tools/makefiles/1/cdbs/kde.mk
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/rules/patchsys-quilt.mk

  Where kde.mk basically includes cmake class.

  After having examined the cdbs sources, i found clean target to be defined 
in buildcore.mk like this:

clean:: testdir testroot cleanbuilddir reverse-config

cleanbuilddir:: $(patsubst %,cleanbuilddir/%,$(DEB_ALL_PACKAGES))
	-$(if $(call cdbs_streq,$(DEB_BUILDDIR),$(DEB_SRCDIR)),,rmdir 

  Whereas in cmake.mk:
	-$(if $(call cdbs_streq,$(DEB_BUILDDIR),$(DEB_SRCDIR)),,rm -rf 

  Also cmake class include makefile class, makefile.mk which defines:

clean:: makefile-clean
$(DEB_MAKE_CLEAN_TARGET), at echo "DEB_MAKE_CLEAN_TARGET unset, not running 
	rm -f debian/stamp-makefile-build

  So what's happening is that makefile.mk makefile-clean target is being added 
to clean target
and this target is being called after cleanbuilddir, unfortunately too late. 
IMHO, makefile-clean
should be invoked before cleanbuilddir, or as the first action of 

  I'm not sure how to proceed in this case, because I don¡'t think it's 
feasible redefining clean target in buildcore.mk
A possible solution would be redifining cleanbuilddir in cmake.mk like this:

cleanbuilddir:: makefile-clean
	-$(if $(call cdbs_streq,$(DEB_BUILDDIR),$(DEB_SRCDIR)),,rm -rf 

  Not sure is this is sensible though. Hope you have better ideas.


-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (900, 'unstable'), (500, 'testing'), (100, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.29-toi3head (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=es_ES.UTF-8, LC_CTYPE=es_ES.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages cdbs depends on:
ii  debhelper                     7.2.7      helper programs for debian/rules

Versions of packages cdbs recommends:
ii  autotools-dev                 20080123.2 Update infrastructure for config.

Versions of packages cdbs suggests:
ii  devscripts                    2.10.47    scripts to make the life of a 
pn  doc-base                      <none>     (no description available)

-- no debconf information

More information about the Build-common-hackers mailing list