A Simple Makefile Tutorial (2008)

19 points by kenballus


FRIGN

Again a missed opportunity to teach POSIX make, which undergoes constant and consistent expansion. This tutorial uses GNUisms left and right, making the resulting makefile unportable.

kenballus

In college, I mostly copied and pasted Makefiles from class until finding this. There are some bugs in the writing, but on the whole I think it does a great job introducing the concepts to newcomers.

Anyway, here's what I think doesn't work about this post:

  1. This sentence is a lie:

Makefiles are a simple way to organize code compilation.

  1. Missing $(CFLAGS) in Makefile 2. (EDIT: This is not true. See below.)

  2. -I. is generally worse than just using double-quoted includes, imo.