[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how to prevent: rules/clean only operates warning-free only after rules/build?



On Thu, Aug 31, 2000 at 04:21:40PM -0800, Britton wrote:
> I notice that some packages (including one I have recently become the
> maintainer of) have in rules clean a command '-$(MAKE) -i clean' to invoke
> upstream's cleanup, then later dh_clean Makefile.  This is fine, except
> packages that use things like imake to generate the upstream Makefile in
> the first place then generate a warning message stating that the makefile
> was not found if rules clean is invoked twice without a build in between.  
> Packages like hello-debhelper which use autoconf have the same sort of
> trouble except in this case the -$(MAKE) distclean causes the problems for
> its own future invocations by removing the Makefile itself. Packages which
> do a lot of cleaning before building generate this sort of error any time
> they are built after a manual clean.
> 
> I guess this is acceptable behavior since hello does it but I don't like
> it.  Is there any clean way to prevent this without explicitly testing for
> the existence of the Makefile in question (awkward)?

You can do something like this:

clean:
        dh_testdir
        dh_testroot
        [ -f lib/Makefile ] || xmkmf -a
        $(MAKE) clean
        dh_clean build-stamp `find . -name Makefile`

-- 
Digital Electronic Being Intended for Assassination and Nullification



Reply to: