[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
- To: firstname.lastname@example.org
- Subject: Makefiles
- From: Francesco Orsenigo <email@example.com>
- Date: Sun, 20 Jul 2003 18:33:54 +0200
- Delivered-to: firstname.lastname@example.org
- Delivered-to: mailing list email@example.com
- Delivery-date: Sun, 20 Jul 2003 12:24:58 -0400
- In-reply-to: <3E8B3097.firstname.lastname@example.org>
- Mailing-list: contact email@example.com; run by ezmlm
- References: <20030402115912.72A99E476@whouse.4orsi.it> <20030402173602.358A6E476@whouse.4orsi.it> <3E8B3097.firstname.lastname@example.org>
- Reply-to: email@example.com
Ok, i finally entered the wonderful world of Makefiles.
I cut my compile times from 2 minutes to an average of 5 secs and that's fine.
But there are thing left obscure to me.
I build dependencies and put them in a directory, DEPS/
How can i tell make to create DEPS/ if it not exists, _BEFORE_ that it starts generating dependencies
(with an obvious chain of errors, since gcc can't create DEPS/[module].d)
The problem seems that Makefile contains
and so make tries to generate all dependencies before anything else is done.
The only workaround i found is to change the %.d rule to:
@mkdir -p DEPS/
$(CC) -MM -MF $@ -MT $(patsubst %.d, %.o, $@) $<
Which is not very elegant, since the mkdir command is continously issued.
This gives me problems also when i try to define a 'clean:' target, wich cannot work unless all .d
files are propely generated, wich is a nonsense since 'clean:' should delete them all!