Add MODULE_BUILD_DATE to static.h when building.

Contains %Y-%m-%d %H-%M-%S timestamp of when the module was built.
This commit is contained in:
Joris Vink 2013-07-06 18:07:06 +02:00
parent 1c8cfff1a9
commit bbc98cf2a7
1 changed files with 5 additions and 0 deletions

View File

@ -25,6 +25,7 @@ CFLAGS="-I. -I${KORE_DIR}/includes -Wall -Wstrict-prototypes \
-Wmissing-prototypes -Wmissing-declarations -Wshadow \
-Wpointer-arith -Wcast-qual -Wsign-compare -g"
LDFLAGS=-shared
MODULE_BUILD_DATE=`date +"%Y-%m-%d %H:%M:%S"`
# Functions used in the build process.
function create_and_empty_dir {
@ -44,6 +45,8 @@ ${CC} ${CFLAGS} tools/inject.c -o tools/inject
create_and_empty_dir ${SOURCE_DIR}/${MEDIA_DIR}
create_and_empty_dir .objs
rm -f static.h
for file in `find ${MEDIA_DIR} -type f \( ! -name \*.swp \)`; do
echo "Injecting $file";
base=`basename $file`;
@ -54,6 +57,8 @@ for file in `find ${MEDIA_DIR} -type f \( ! -name \*.swp \)`; do
fi
done
echo "#define MODULE_BUILD_DATE \"${MODULE_BUILD_DATE}\"" >> static.h
for src in `find ${SOURCE_DIR} -type f -name \*.c`; do
base=`basename $src`;
${CC} ${CFLAGS} -fPIC -c $src -o .objs/${base}.o