Hello Rob. On Saturday 06 August 2011, Rob Napier wrote: > I've seen the following issue on two automake-based libraries (libevent and > libidn), leading me to believe it's an issue with automake rather than the > individual libraries. > > The following always fails: > > make && make -q > > "make -q" should return 0 if the previous make completed successfully, but > it doesn't. It return 2 indicating an error. I haven't been able to figure > out what the actual error is, though: > > monoceros:bld rnapier$ make > make all-recursive > Making all in . > Making all in include > make[2]: Nothing to be done for `all'. > Making all in sample > make[2]: Nothing to be done for `all'. > Making all in test > make all-am > make[3]: Nothing to be done for `all-am'. > monoceros:bld rnapier$ make -q > make all-recursive > Making all in . > make[1]: *** [all-recursive] Error 1 > make: *** [all] Error 2 > monoceros:bld rnapier$ echo $? > 2 > monoceros:bld rnapier$
I cannot reproduce your problem with libevent (2.0.12 stable). "make && make -q" works fine for it. In the case of libidn, I can reproduce the problem, but it's not automake to be at fault therew. The problem lies in `po/Makefile' (which is not automake-generated, but rather gettext-generated); on my system I get (using GNU make 3.81): $ cd libidn $ make bootstrap && make .... $ make -q make all-recursive make[1]: Entering directory `/tmp/libidn' Making all in gl make[2]: Entering directory `/tmp/libidn/gl' make all-recursive make[3]: Entering directory `/tmp/libidn/gl' make[3]: Leaving directory `/tmp/libidn/gl' make[2]: Leaving directory `/tmp/libidn/gl' Making all in lib/gl make[2]: Entering directory `/tmp/libidn/lib/gl' make all-recursive make[3]: Entering directory `/tmp/libidn/lib/gl' make[3]: Leaving directory `/tmp/libidn/lib/gl' make[2]: Leaving directory `/tmp/libidn/lib/gl' Making all in lib make[2]: Entering directory `/tmp/libidn/lib' make all-am make[2]: Leaving directory `/tmp/libidn/lib' Making all in po make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/tmp/libidn' make: *** [all] Error 2 $ cd po $ make -q --debug=a GNU Make 3.81 ... [SNIP] Reading makefiles... Reading makefile `Makefile'... Updating makefiles.... ... [SNIP] No need to remake target `Makefile'. Updating goal targets.... Considering target file `all'. File `all' does not exist. Looking for an implicit rule for `all'. No implicit rule found for `all'. Considering target file `check-macro-version'. File `check-macro-version' does not exist. Finished prerequisites of target file `check-macro-version'. Must remake target `check-macro-version'. Target file `check-macro-version' needs remade under -q. Finished prerequisites of target file `all'. Giving up on target file `all'. So you might want to report this issue to either gettext or libidn (depending on which is responsible to the "broken" makefile behaviour). > As part of my build, I compile various libraries like libevent. If I always > call "make install" in the build, it will force my entire project to rebuild > (because this touches all the files). So I've been trying to use the > following make rule: > > all: $(BUILDDIR)/Makefile > $(MAKE) -q -s -C $(BUILDDIR) || $(MAKE) -C $(BUILDDIR) install > > Unfortunately, the -q part always returns 2 for automake-based builds. > > Is there another way to achieve the underlying goal (automatically build > third-party libraries, including correctly rebuilding them if there were > local changes, but with correct dependency checking)? > I'm not sure about this, and I'm short(ish) of time, so you might want to re-post the question on the GNU make mailing list, or on the libidn list. > This is make 3.81 on Mac, but I'm seeing the same behavior on Linux. > > I haven't been able to find an error in the "make -q -d" output. > > Thanks, > -Rob HTH, Stefano