Last active
April 26, 2019 21:17
-
-
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.)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Let's assume COMPILER was for some accidental reason not set. | |
# COMPILER=gcc | |
CFLAGS = -O2 -Wall | |
all: | |
$(COMPILER) $(CFLAGS) --version |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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