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

Re: subread -- Request for review



Hi Nilesh,

On Thu, Mar 11, 2021 at 06:19:53PM +0530, Nilesh Patra wrote:
> > > --- a/debian/rules
> > > +++ b/debian/rules
> > > @@ -24,7 +24,7 @@ endif
> > >  	dh $@
> > >  
> > >  override_dh_clean:
> > > -	cd src; make -f Makefile.Linux clean
> > > +	cd src && rm -f core featureCounts exactSNP removeDup subread-buildindex
> > 
> > What's the purpose of this change?
> 
> wouldn't "make -f Makefile.Linux" cause problems for cross building?
> (Hardcoding on make?)

No. At this point, only dh_auto_build passes cross flags to make. All
other targets are assumed to be non-special for the makefile
buildsystem. So unless the Makefile requires working pkg-config and such
during clean (which is rare), you can just call it directly. You do
loose automatic parallelization of course, but that seems kinda
unimportant for the clean target. What also works is:

    dh_auto_clean --sourcedirectory=src --buildsystem=makefile -- -f Makefile.Linux

> I rather copied the clean instruction here -- Do I miss something?

Sounds bad. Don't repeat yourself.

> > >  override_dh_auto_build:
> > > -	cd src; make -f Makefile.Linux
> > > -	dh_auto_build -- CC=$(CC)
> > > +	dh_auto_build --sourcedirectory=src -- -f Makefile.Linux CC=$(CC)
> > 
> > When the Makefile is not detected by dh_auto_build, I recommend
> > explicitly passing --buildsystem=makefile.
> 
> I'm not sure if I understand you there. It has several Makefiles in
> "src/", by default it will take in Makefile for compiling, which we do
> not want hence forcing it to use Makefile.Linux

The --buildsystem=makefile is not about selecting a particular Makefile.
It is about selecting the right build driver. If a later upstream
release were to remove the Makefile but keep Makefile.Linux,
dh_auto_build could suddenly fail to build it, because it no longer
understands that it needs to use the makefile buildsystem.

> Do you instead mean passing in it in any case, something like?:
> 
> dh $@ --buildsystem=makefile

Moving the --buildsystem flag to the dh invocation is even better, yes.
While at it, can you also move the --sourcedirectory flag there? It
seems like the toplevel directory doesn't contain any build system at
all.

Helmut


Reply to: