|
@@ -19,16 +19,26 @@ do
|
|
then
|
|
then
|
|
mkdir -p "$hdir"
|
|
mkdir -p "$hdir"
|
|
temp=$(mktemp)
|
|
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"
|
|
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 "/* This file was generated by runcprotoall */\n" > "$temp"
|
|
printf "\n#ifndef CPROTO /* Needed to protect cproto from itself. */\n#ifndef ${guard}\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"
|
|
if cproto $CPROTO_FLAGS -I"$hdir" "$each" >> "$temp"
|
|
then
|
|
then
|
|
printf "\n#endif /* ${guard} */ \n#endif /* CPROTO */" >> "$temp"
|
|
printf "\n#endif /* ${guard} */ \n#endif /* CPROTO */" >> "$temp"
|
|
- mv -f "$temp" "$hfile"
|
|
|
|
|
|
+ mv -f "$temp" "$hfile"
|
|
|
|
+ git add "$hfile"
|
|
else
|
|
else
|
|
printf "cproto failed\n"
|
|
printf "cproto failed\n"
|
|
exit 1
|
|
exit 1
|