Skip to content

Instantly share code, notes, and snippets.

@nh2 nh2/Makefile
Last active Apr 26, 2019

Embed
What would you like to do?
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
You can’t perform that action at this time.