4 ms·
You don't need to enter in dependencies with 'make' either (suffix rules or makedepend). Don't get me wrong, fabricate looks great, but let's not misrepresent
by tsally 17y ago
You don't need to enter in dependencies with 'make' either (suffix rules or makedepend). Don't get me wrong, fabricate looks great, but let's not misrepresent the power of make in the right hands. From the docs:
files.o : files.c defs.h buffer.h command.h
cc -c files.c
I don't know a programmer beyond the introductory level that still writes this in their make file. :-p
- silentbicycle 17y agoRight. Make already knows how to convert .c to .o, all you need to say is files.c: defs.h buffer.h command.h and there are tools such as makedepend (for C and OCaml, off the top of my head) that generate those listings automatically, so you just add this to the Makefile: include (autogenerated dependency listing file) While the mandatory tab in Make syntax is a genuine wart, make has been around long enough that there are several other tools that know how to work with it. (Now, having the scan for access time changes added as a warning to Make might not be a bad idea. "WARNING: You forgot this dependency")
- garnet7 17y ago> make has been around long enough that there are several other tools that know how to work with it. I'd prefer an improved from-scratch 2nd-generation tool instead of using one that simply wraps around a complicated 1st-gen one that I'd rather not touch. Make has more warts than just the tab characters. Lots of obscurely-named variables, for starters.
- Bluem00 17y agoYou might want to check out tup. It uses the dependency tree in a fundamentally different way from make, in order to improve build times. http://gittup.org/tup/ http://gittup.org/tup/
- silentbicycle 17y ago> [complicated tool ...] Lots of obscurely-named variables, for starters. Are you talking about make or just GNU make? The $< $* $$@ stuff comes from gmake. Make itself is pretty simple. Here's a good tutorial: http://www.freebsd.org/doc/en/books/pmake/ http://www.freebsd.org/doc/en/books/pmake/
- benhoyt 17y agoTrue, one normally doesn't -- and shouldn't. But I saw a surprising number of Makefiles on Google Code Search done this way.