automake-patches
[Top][All Lists]
Advanced

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

Re: [PATCH] {yacc-work} coverage: test mixed C/C++ yacc-generated parser


From: Ralf Wildenhues
Subject: Re: [PATCH] {yacc-work} coverage: test mixed C/C++ yacc-generated parsers in the same dir
Date: Sun, 10 Apr 2011 15:01:11 +0200
User-agent: Mutt/1.5.20 (2010-08-04)

* Stefano Lattarini wrote on Sun, Apr 10, 2011 at 02:50:28PM CEST:
> On Sunday 10 April 2011, Ralf Wildenhues wrote:
> > I think it would make sense to also do parallel build tests here
> >
> Agreed (and BTW this uncovered a bug in the testcase: I had forgotten
> to add `p.h' and `parse.hh' to BUILT_SOURCES in the Makefile.am; it's
> fixed now).

Hehe.

> Here is what we could do IMHO: first try a VPATH serial build, then
> an in-tree parallel build.  See the attached squash-in.
> 
> Tested with GNU make (3.80, 3.81, 3.82), FreeBSD and NetBSD make
> (Debian ports), Heirloom make, Solaris XPG4 and CCS make, and
> Solaris dmake.  OK?

OK.

> > (only if make is GNU make, of course)
> >
> Why?  I've never found a make implementation rejecting the `-j' option.

HP-UX make has -P but not -j.  The semantics of -P are sufficiently
different so that it is not worth trying to support that, however.

$ make -j; echo $?
Make: Unknown flag argument j.  Stop.
1

Several other makes accept -j only when given a number, not without,
e.g., OpenBSD make:

$ make  -j
make: option requires an argument -- j
usage: make [-BeiknPqrSst] [-D variable] [-d flags] [-f makefile]
            [-I directory] [-j max_jobs] [-m directory] [-V variable]
            [NAME=value] [target ...]


And I think for portability to all GNU make versions, the number should
follow immediately, i.e., without intervening space, but I'm going from
memory here.

It's fine to try out first if make groks -j, and use that, that gives
more coverage then.  But you should try it out in a way to not expose
the issues you just spotted.  For example, you could use
  make -j2 clean || Exit 77

(or Exit 0, if you don't consider that part of the test important
enough).

> +# Try a VPATH and by default serial build first, and then an in-tree
> +# and by default parallel build.
> +
> +for try in 0 1; do
> +
> +  if test $try -eq 0; then
> +    mkdir build
> +    cd build
> +    srcdir=..
> +    debug_info="ls -l . $srcdir"
> +    run_make=$MAKE
> +  elif test $try -eq 1; then
> +    srcdir=.
> +    debug_info="ls -l"
> +    case $MAKE in
> +      *\ -j*) run_make=$MAKE;;
> +      *) run_make="$MAKE -j 3";;

See above for spacing.  Also, note that $MAKE might already include -jN.

Thanks,
Ralf



reply via email to

[Prev in Thread] Current Thread [Next in Thread]