[Top][All Lists]

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

Re: Regarding the JAVA primary

From: Ralf Wildenhues
Subject: Re: Regarding the JAVA primary
Date: Sun, 25 Apr 2010 20:12:17 +0200
User-agent: Mutt/1.5.20 (2009-10-28)

* NightStrike wrote on Sat, Apr 24, 2010 at 02:08:43AM CEST:
> On Mon, Apr 19, 2010 at 2:25 PM, John Calcote <address@hidden> wrote:
> > A problem I foresee is providing the globbing functionality to makefile
> > commands. We'd almost need a new auxiliary script (like install-sh) to
> > generate lists of files from such glob specs. Not sure yet from where the
> > primary functionality would come -- perhaps a java utility, so that the same
> > level of portability would be available to java builds as the source that's
> > being built. That is, if someone uses the JAVA primary, he/she can expect to
> > be required to have additional build functionality available, in the form of
> > a JVM and javac compiler. Just a thought.
> You can resolve the globbing spec at automake time instead of make
> time.  That way, still contains a static list.

Would you consider the following semantics intuitive?

  edit ...
  run automake
  add another java file
  build fails due to new java file not being considered

Remember that it would not be a good idea to rerun automake at each
instance of 'make'.

Here's another reason against wildcards in prerequisites: they are not
portable to non-GNU make.  Period.  GNU make has $(wildcard ...) which
is well-defined, and GNU make also most of the time does the right thing
when you place a shell-style wildcard in a target or prerequisite list
(but see
for pitfalls!), but non-GNU make will normally not do what you expect.

More precisely, while some non-GNU makes seem to expand wildcards in
prerequisite lists, they don't actually match the expanded words against
other targets listed in the makefile (tested with some versions of IRIX,
AIX, and Solaris make).  I found only FreeBSD make to do the matching
besides GNU make.  Tested with this script in a fresh directory:

cat >Makefile <<\EOF
all: all1 all2 all3
        echo updating $@
all1: newer*
        echo updating $@
all2: older*
        echo updating $@
all3: outdated*
        echo updating $@
new* old* outd*:
        echo updating $@
outd*: FORCE
touch older1 older2 outdated1 outdated2
sleep 1
touch all1 all2 all3
sleep 1
touch newer1 newer2

Only GNU and FreeBSD make will remake all1, outdated1, outdated2, and all2
before remaking all.  The rest will only remake all1 before all.

So, in case you have generated files, that'll just silently break your

I still need to rewrite this for an addition to the FAQ.


reply via email to

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