[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Makefiles
- To: linuxgames@sunsite.dk
- Subject: Makefiles
- From: Francesco Orsenigo <xarvh@lombardiacom.it>
- Date: Sun, 20 Jul 2003 18:33:54 +0200
- Delivered-to: archiver@seul.org
- Delivered-to: mailing list linuxgames@sunsite.dk
- Delivery-date: Sun, 20 Jul 2003 12:24:58 -0400
- In-reply-to: <3E8B3097.5060603@airmail.net>
- Mailing-list: contact linuxgames-help@sunsite.dk; run by ezmlm
- References: <20030402115912.72A99E476@whouse.4orsi.it> <20030402173602.358A6E476@whouse.4orsi.it> <3E8B3097.5060603@airmail.net>
- Reply-to: linuxgames@sunsite.dk
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.
1)
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
-include $(DEPS)
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:
DEPS/%.d: %.c
@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!
Any hint?
Thanx,
Francesco Orsenigo