Commit 0d1ede8a by beoran

Only generate prototypes when out of date.

parent fc03683e
......@@ -19,16 +19,26 @@ do
then
mkdir -p "$hdir"
temp=$(mktemp)
if [ -e "$hfile" ]
then
if [ "$each" -ot "$hfile" ]
then
printf "Skipping file: $hfile: up to date.\n"
continue
fi
else
# create file if it doesn't exist to avoid chicken and egg problems.
touch "$hfile"
fi
printf "Generating $hfile from $each. ${CPROTO_PATH} \n"
# create file if it doesn't exist to avoid chicken and egg problems.
touch "$hfile"
printf "/* This file was generated by runcprotoall */\n" > "$temp"
printf "\n#ifndef CPROTO /* Needed to protect cproto from itself. */\n#ifndef ${guard}\n" >> "$temp"
if cproto $CPROTO_FLAGS -I"$hdir" "$each" >> "$temp"
then
printf "\n#endif /* ${guard} */ \n#endif /* CPROTO */" >> "$temp"
mv -f "$temp" "$hfile"
mv -f "$temp" "$hfile"
git add "$hfile"
else
printf "cproto failed\n"
exit 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment