Practical Makefiles, by example
nuclear.mutantstargoat.com
Practical Makefiles, by example
1–10 of 29 posts
Re: Practical Makefiles, by example
#2This works because if you add a new dependency to a file, that information will only be needed for the next build - the current file will already be considered out of date seeing as it was edited to add the #include.
gcc -MD -MP foo.c -o foo.o
Will compile foo.c into foo.o, and also generate foo.d (-MD).
Foo.d will contains make style dependencies, and also a phony target for every dependency (-MP). This allows you to delete dependant files, as make considers the target of a rule that has no perquisites or commands to be up to date if said target does not exist.Re: Practical Makefiles, by example
#3Re: Practical Makefiles, by example
#4CMake is now all the rage. Like krapht said, just learn CMake and be done with it.
Re: Practical Makefiles, by example
#5 DEPS = Makefile
%.o: %.c $(DEPS)
$(CC) $(CCFLAGS) -o $@ -c $Re: Practical Makefiles, by example
#6Great idea. But awful theme. And no longer really relevant. CMake is now all the rage. Like krapht said, just learn CMake and be done with it.
I prefer to just use plain Makefiles, they're easier to fix and "make correct" than anything else. For me, I guess. make is weird, but more minimal than cmake. (cmake is HUGE. autotools are a lot weirder than make. considering the alternatives, I actually like make...)
Re: Practical Makefiles, by example
#7Great idea. But awful theme. And no longer really relevant. CMake is now all the rage. Like krapht said, just learn CMake and be done with it.
Re: Practical Makefiles, by example
#8Re: Practical Makefiles, by example
#9Great idea. But awful theme. And no longer really relevant. CMake is now all the rage. Like krapht said, just learn CMake and be done with it.
ugh. CMake is atrocious. It covers maybe .1% of the cases that autotools handles while having some of the worst documentation known to man. Not to mention yet another language to learn. It's not more "modern" than autotools and it's in no way shape or form "newer" than autotools, seeing that automake/autoconf have been in active development since inception.
This should not be interpreted as an endorsement of CMakes miserable, quarter-assed BASIC-in-almost-s-exprs language.