Created
February 22, 2011 21:58
-
-
Save rcfox/839506 to your computer and use it in GitHub Desktop.
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
# default.o.do | |
# apenwarr's version doesn't escape the slashes in the file name, so it doesn't work on subdirectories. | |
redo-ifchange $1.c | |
CFLAGS="..." | |
INCLUDE="..." | |
g++ $CFLAGS $INCLUDE -MD -MF $3.deps.tmp -c -o $3 $1.c | |
# Checks implicit dependencies | |
ESCAPED_FILE=$(echo "$3" | sed -e 's/\//\\\//g') | |
DEPS=$(sed -e "s/^$ESCAPED_FILE://" -e 's/\\//g' <$3.deps.tmp) | |
rm -f $3.deps.tmp | |
redo-ifchange $DEPS | |
#----- | |
# project.do | |
# Compiles all .c files into .o files, over all subdirectories except ./lib | |
# apenwarr would have you list all of the .o files manually | |
for file in `find . -name lib -prune -o -name '*.c' -print`; do | |
DEPS="$DEPS ${file%.c}.o "; | |
done | |
redo-ifchange $DEPS | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment