Summary: As Aaron suggested, there are quite some problems with our Makefile and scripts. So in this diff I did some cleanup for them and revise some part of the scripts/makefile to help people better understand some mysterious parts. Test Plan: Ran make in several modes; Ran the updated scripts. Reviewers: dhruba, emayanke, akushner Differential Revision: https://reviews.facebook.net/D12285main
parent
85d83a150b
commit
457dcc605a
@ -1,4 +0,0 @@ |
|||||||
This directory stores the tests that failed valgrind and the times associated |
|
||||||
with the failed runs. |
|
||||||
"make valgrind_check" can be invoked to call valgrind on the rocksdb tests and |
|
||||||
generate files in this directory |
|
@ -1,30 +0,0 @@ |
|||||||
#!/bin/sh |
|
||||||
# |
|
||||||
# Record the version of the source that we are compiling. |
|
||||||
# We keep a record of the git revision in util/version.cc. This source file |
|
||||||
# is then built as a regular source file as part of the compilation process. |
|
||||||
# One can run "strings executable_filename | grep _build_" to find the version of |
|
||||||
# the source that we used to build the executable file. |
|
||||||
# |
|
||||||
|
|
||||||
# create git version file |
|
||||||
VFILE=$(mktemp) |
|
||||||
trap "rm $VFILE" EXIT |
|
||||||
|
|
||||||
# check to see if git is in the path |
|
||||||
which git > /dev/null |
|
||||||
|
|
||||||
if [ "$?" = 0 ]; then |
|
||||||
env -i git rev-parse HEAD | awk ' BEGIN {print "#include \"build_version.h\""} {print "const char * leveldb_build_git_sha = \"leveldb_build_git_sha:" $0"\";"} END {}' > ${VFILE} |
|
||||||
else |
|
||||||
echo "git not found"| awk ' BEGIN {print "#include \"build_version.h\""} {print "const char * leveldb_build_git_sha = \"leveldb_build_git_sha:git not found\";"} END {}' > ${VFILE} |
|
||||||
fi |
|
||||||
|
|
||||||
date | awk 'BEGIN {} {print "const char * leveldb_build_git_datetime = \"leveldb_build_git_datetime:"$0"\";"} END {} ' >> ${VFILE} |
|
||||||
echo "const char * leveldb_build_compile_date = __DATE__;" >> ${VFILE} |
|
||||||
echo "const char * leveldb_build_compile_time = __TIME__;" >> ${VFILE} |
|
||||||
|
|
||||||
OUTFILE=util/build_version.cc |
|
||||||
if [ ! -e $OUTFILE ] || ! cmp -s $VFILE $OUTFILE; then |
|
||||||
cp $VFILE $OUTFILE |
|
||||||
fi |
|
@ -0,0 +1,42 @@ |
|||||||
|
#!/bin/sh |
||||||
|
# |
||||||
|
# Record the version of the source that we are compiling. |
||||||
|
# We keep a record of the git revision in util/version.cc. This source file |
||||||
|
# is then built as a regular source file as part of the compilation process. |
||||||
|
# One can run "strings executable_filename | grep _build_" to find the version of |
||||||
|
# the source that we used to build the executable file. |
||||||
|
# |
||||||
|
|
||||||
|
# create git version file |
||||||
|
VFILE=$ROCKSDB_ROOT/util/build_version.cc.tmp |
||||||
|
trap "rm $VFILE" EXIT |
||||||
|
|
||||||
|
# check to see if git is in the path |
||||||
|
which git > /dev/null |
||||||
|
|
||||||
|
if [ "$?" = 0 ]; then |
||||||
|
env -i git rev-parse HEAD | |
||||||
|
awk ' |
||||||
|
BEGIN { |
||||||
|
print "#include \"build_version.h\"\n" |
||||||
|
} |
||||||
|
{ print "const char* leveldb_build_git_sha = \"leveldb_build_git_sha:" $0"\";" } |
||||||
|
' > ${VFILE} |
||||||
|
else |
||||||
|
echo "git not found" | |
||||||
|
awk ' |
||||||
|
BEGIN { |
||||||
|
print "#include \"build_version.h\"" |
||||||
|
} |
||||||
|
{ print "const char* leveldb_build_git_sha = \"leveldb_build_git_sha:git not found\";" } |
||||||
|
' > ${VFILE} |
||||||
|
fi |
||||||
|
|
||||||
|
echo "const char* leveldb_build_git_datetime = \"leveldb_build_git_datetime:$(date)\";" >> ${VFILE} |
||||||
|
echo "const char* leveldb_build_compile_date = __DATE__;" >> ${VFILE} |
||||||
|
echo "const char* leveldb_build_compile_time = __TIME__;" >> ${VFILE} |
||||||
|
|
||||||
|
OUTFILE=$ROCKSDB_ROOT/util/build_version.cc |
||||||
|
if [ ! -e $OUTFILE ] || ! cmp -s $VFILE $OUTFILE; then |
||||||
|
cp $VFILE $OUTFILE |
||||||
|
fi |
Loading…
Reference in new issue