Created
July 8, 2011 12:49
-
-
Save pyrtsa/1071745 to your computer and use it in GitHub Desktop.
A redo file I've been using for my pet project
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
redo-ifchange env.sh && source env.sh | |
SRC=${1#"$BUILDDIR/"} | |
redo-ifchange "$SRC" # <- Mark the source (.cpp) dependency to Redo's database | |
$COMPILE -c "$SRC" -o "$3" $CXXFLAGS $INCLUDES -MMD -MF "$1.o.dep" | |
DEPS="" | |
while read -r line; do # Loop over all the header dependencies, and collect | |
line=${line#*:} # them as a list to $DEPS. There's no need (nor any | |
DEPS=$DEPS${line#%\\} # .do rule) to compile the headers, but redo-ifchange | |
done < "$1.o.dep" # records the dependency relation to Redo's database. | |
echo "${DEPS#*:}" | xargs redo-ifchange # Mark the header dependencies at once! |
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
BUILDDIR="build" | |
# list of directories prefixed like "-Idir1 -Idir2" | |
INCLUDES="-Iinclude" | |
COMPILE="c++-4.6" | |
CXXFLAGS="-std=c++0x" | |
LINK=$COMPILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment