From 46f101f4dd07051b9af686f7a8213be75371084d Mon Sep 17 00:00:00 2001 From: Manoel Trapier Date: Wed, 20 Mar 2013 20:35:46 +0100 Subject: [PATCH] Update makeheader.sh --- makeheader.sh | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/makeheader.sh b/makeheader.sh index edc7828f2..54b5c6216 100755 --- a/makeheader.sh +++ b/makeheader.sh @@ -11,25 +11,32 @@ for fil in /tmp/ack-temp/pmcache/*; do fi done +POSTFIX=".h" +if [ -f ${file}.str ]; then + POSTFIX="_loc.h" +fi -if [ ! -f ${file}.h ]; then +if [ ! -f ${file}${POSTFIX} ]; then echo "No header, building it" - touch ${file}.h - cat > ${file}.h < ${file}${POSTFIX} <> ${file}.h - echo "#define ${HEADERMAGIC}" >> ${file}.h - echo "" >> ${file}.h - cproto -U__BLOCKS__ ${INCPATH[*]} ${file}.c >> ${file}.h - echo "" >> ${file}.h - echo "#endif /* ${HEADERMAGIC} */" >> ${file}.h - echo "" >> ${file}.h + echo "#ifndef ${HEADERMAGIC}" >> ${file}${POSTFIX} + echo "#define ${HEADERMAGIC}" >> ${file}${POSTFIX} + echo "" >> ${file}${POSTFIX} + cproto -U__BLOCKS__ ${INCPATH[*]} ${file}.c >> ${file}${POSTFIX} + echo "" >> ${file}${POSTFIX} + echo "#endif /* ${HEADERMAGIC} */" >> ${file}${POSTFIX} + echo "" >> ${file}${POSTFIX} else echo "Header existing... try to update.. (manual check should be done)" cp ${file}.h ${file}.h.old @@ -45,5 +52,6 @@ else echo "" >> ${file}.h.new cp ${file}.h.new ${file}.h + rm ${file}.h.new # fi \ No newline at end of file -- 2.34.1