[m-rev.] for review: simplify the use of mdbrc by test cases

Julien Fischer jfischer at opturion.com
Tue Oct 26 20:00:26 AEDT 2021


On Tue, 26 Oct 2021, Peter Wang wrote:

> On Tue, 26 Oct 2021 14:46:29 +1100 "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
>> 
>> 
>> On Tue, 26 Oct 2021 14:42:03 +1100, Peter Wang <novalazy at gmail.com> wrote:
>> 
>> > On Sun, 04 Oct 2020 03:23:37 +1100 "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
>> > > diff --git a/Mmakefile b/Mmakefile
>> > > index a66838b..0dcfa8b 100644
>> > > --- a/Mmakefile
>> > > +++ b/Mmakefile
>> > > @@ -929,7 +929,7 @@ bindist: WORK_IN_PROGRESS TODO
>> > > 
>> > >  #-----------------------------------------------------------------------------#
>> > > 
>> > > -clean: clean_tests clean_subdirs
>> > > +clean: clean_tests clean_subdirs clean_extras
>> > > 
>> > >  .PHONY: clean_subdirs
>> > >  clean_subdirs:
>> > > @@ -941,14 +941,20 @@ clean_subdirs:
>> > >  .PHONY: clean_tests
>> > >  clean_tests:
>> > >  	+if test -d tests; then \
>> > > -		(cd tests; $(SUBDIR_MMAKE) clean) \
>> > > +		(cd tests; $(MMAKE) $(MMAKEFLAGS) clean) \
>> > >  	fi
>> > 
>> > Do you remember if you deliberately changed $(SUBDIR_MMAKE) to $(MMAKE)
>> > for some reason? (here and elsewhere)
>> 
>> No, I don't.
>> 
>> > The top-level Makefile defines MMAKE as
>> > 
>> >     MMAKE=          MMAKE_DIR=`pwd`/scripts scripts/mmake
>> > 
>> > so "make realclean" is broken, but "mmake realclean" works.
>> 
>> Do we even have a list of targets that *should* work with plain make,
>> as opposed to mmake?
>
> I don't think there is such a list, but the targets listed in the
> top-level Makefile ought to work, or should be deleted:
>
>    % grep '^[a-z].*:' Makefile
>    all:
>    install:
>    clean:
>    distclean: clean
>    maintainer-clean:
>    realclean:
>    uninstall:

The idea at one point was that the standard GNU make targets should
be supported.  It's questionable how useful that is since Mercury's
behaviour varies from the "standard" behaviour anyway (e.g. make install
for Mercury builds a load of stuff as well as installing it).

It's possible that packaging scripts may rely on the presence of some
of the above targets, so I wouldn't remove them.

> Maybe we should delete the .DEFAULT target in the Makefile.

It does seem a bit pointless given that just invoking "make"
without the default target will invoke the "all" target anyway.

Julien.


More information about the reviews mailing list