[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Please review: Brain surgery on the build system, first stage
From: |
Jan Nieuwenhuizen |
Subject: |
Re: Please review: Brain surgery on the build system, first stage |
Date: |
Mon, 06 Aug 2012 16:49:01 +0200 |
User-agent: |
Gnus/5.110018 (No Gnus v0.18) Emacs/23.3 (gnu/linux) |
John Mandereau writes:
> That said, there is a design I don't like, which BTW is not specific at
> all to StepMake: tying build order and make recursion with directory
> layout causes trouble in rules with prerequisites that are built in
> other directories. IMHO it would be much better to use make recursion
> for building stages (all, test, doc-1, doc-2...) instead of directories,
> with a toplevel GNUmakefile including submakefiles from subdirectories.
> I don't think it would be very easy to do this with GNU Make
I agree, and such scoping happens to be supported by GNU Make, although
I have rarely seen it being used. Consider attached example and see
node Pattern-specific and node Target-specific in the doc.
Jan
16:45:54 address@hidden:~/vc/nrm
$ make
gcc -c -o dir2/main.o dir2/main.c
gcc -c -DCOMPILING_BAR=1 -o dir1/bar.o dir1/bar.c
gcc -c -DCOMPILING_FOO=1 -o dir1/foo.o dir1/foo.c
ar r dir1/libdir1.a dir1/bar.o dir1/foo.o
ar: creating dir1/libdir1.a
gcc -o dir2/dir2 dir2/main.o dir1/libdir1.a
nrm.tar.gz
Description: Binary data
--
Jan Nieuwenhuizen <address@hidden> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | AvatarĀ® http://AvatarAcademy.nl