Skip to content

Instantly share code, notes, and snippets.

@nh2
Last active April 26, 2019 21:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nh2/792afdf2a12f35d013a1a03157d13516 to your computer and use it in GitHub Desktop.
Save nh2/792afdf2a12f35d013a1a03157d13516 to your computer and use it in GitHub Desktop.
Another make horror example. Guess what this does. (Don't use Make, unless you really know how it works, by which time you probably decide against it.)
# Let's assume COMPILER was for some accidental reason not set.
# COMPILER=gcc
CFLAGS = -O2 -Wall
all:
$(COMPILER) $(CFLAGS) --version
# Despite utter failure, this make invocation exits with code 0 (success)!
$ make
O2 -Wall --version
make: O2: Command not found
Makefile:5: recipe for target 'all' failed
make: [all] Error 127 (ignored)
$ echo $?
0
# This makes sense if you have read the Make manual, and justifies Make as the Top 1
# of languages where code looks correct when it is utterly wrong.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment