lua-users home
lua-l archive

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


Enrico Tassi wrote:
[...]
> Indeed I had that in mind.  Why are these not sufficient?

Make only builds each target once, regardless of whether there's a
target-specific variable attached to it. So if you have this:

OBJS = foo.o bar.o

debug: $(OBJS)
release: $(OBJS)

debug: CFLAGS += -g
release: CFLAGS += -Os

...and I do 'make debug release', then foo.o and bar.o are built using
the value of CFLAGS which got to them first --- in this case, CFLAGS=-g.
Which means that release will be linked against the debug version of the
files! I don't even want to think about what happens in parallel builds.

The only way I've found to actually achieve what the above code looks
like it does is to physically have different rules for building the
debug and release versions.

[...]
> What makes this unreadable (apart from Make syntax that is not exactly
> intuitive)?

Mainly it's just that that there's a vast amount of it, and it's not
very well documented:

https://android.googlesource.com/platform/build/+/master/core/

Next time I need to build a big project I'll probably use something
similar, but I'll most likely end up having to roll my own simply
because then I'll understand it. Which is a bit sad, really.

-- 
┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
│
│ 𝕻𝖍'𝖓𝖌𝖑𝖚𝖎 𝖒𝖌𝖑𝖜'𝖓𝖆𝖋𝖍 𝕮𝖙𝖍𝖚𝖑𝖍𝖚 𝕽'𝖑𝖞𝖊𝖍
𝖜𝖌𝖆𝖍'𝖓𝖆𝖌𝖑 𝖋𝖍𝖙𝖆𝖌𝖓.
│

Attachment: signature.asc
Description: OpenPGP digital signature