[mythtv] Getting 'make clean' to remove targets

Joseph A. Caputo jcaputo1 at comcast.net
Wed Jul 13 16:04:06 EDT 2005


On Wednesday 13 July 2005 15:27, mythtv-commits-request at mythtv.org 
wrote:
> ------------------------------
> 
> Message: 9
> Date: Wed, 13 Jul 2005 18:29:56 +0000 (UTC)
> From: mythtv at cvs.mythtv.org
> Subject: [mythtv-commits] mythtv commit: r6832 - in trunk/mythtv by
> 	danielk
> To: mythtv-commits at mythtv.org
> Message-ID: <20050713182956.9EE092CD914 at cvs.mythtv.org>
> Content-Type: text/plain; charset=UTF-8
> 
>       Author: danielk
>         Date: 2005-07-13 18:29:56 +0000 (Wed, 13 Jul 2005)
> New Revision: 6832
>    Changeset: http://cvs.mythtv.org/trac/changeset/6832
> 
> Added:
> 
>    trunk/mythtv/config/
>    trunk/mythtv/config/Makefile
> 
> Modified:
> 
>    trunk/mythtv/configure
> 
> Log:
> 
> Slightly better distclean fix. This doesn't require configure to be 
> rerun, 
> also deletes programs on a "make clean", and eliminates the "rm 
> */*.so" type 
> stuff in the clean rule. I'm still not entirely happy with it as it 
> means 
> any directories added to mythtv.pro must also be accounted for in the 
> config 
> makefile.
> 
> If someone knows how to force qmake generated Makefiles to delete the 
> targets on a "make clean", please forward that knowledge to me..


qmake uses an internal variable "QMAKE_CLEAN" to keep track of what 
needs to be deleted... just append to it in the .pro file, like so:

QMAKE_CLEAN	+= $(TARGET) $(QMAKE_TARGET)

(TARGET is the simple name of the target, QMAKE_TARGET is equivalent to 
$(DESTDIR)/$(TARGET), IIRC... I'm a little fuzzy on that, but you'll 
figure it out)

NB: ***Do Not*** ASSIGN to QMAKE_CLEAN, only *append* to it, otherwise 
the whole list of files to be cleaned will be cleared.

-JAC


More information about the mythtv-dev mailing list