Last active
January 23, 2017 02:29
-
-
Save wulfgarpro/218b12c88af975067078348dfaf2775a to your computer and use it in GitHub Desktop.
makefile header dependency target
This file contains 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
SRCS = a.c | |
depend: .depend | |
.depend: $(SRCS) | |
rm -f ./.depend | |
$(CC) $(CFLAGS) -MM $^ -MF ./.depend; | |
include .depend | |
# -MM outputs source file header dependecies, excluding system headers; | |
# the output syntax is the preprocessor syntax that make can use to define | |
# all source file dependencies, and that is why it's included at the end | |
# -MF specifies the file to output to when used with -MM |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment