Skip to content

Commit

Permalink
Record the version of the source repository that was used to build th…
Browse files Browse the repository at this point in the history
…e leveldb library.

Summary: 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.

Test Plan: none

Differential Revision: https://reviews.facebook.net/D4785
  • Loading branch information
Dhruba Borthakur authored and heyongqiang committed Aug 24, 2012
1 parent d41316b commit 5d96f29
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ $(SHARED1): $(SHARED3)
ln -fs $(SHARED3) $(SHARED1)
endif


all: $(VERSIONFILE) $(SHARED) $(LIBRARY) $(THRIFTSERVER) $(TOOLS)

check: all $(PROGRAMS) $(TESTS) $(TOOLS)
Expand Down Expand Up @@ -200,6 +199,9 @@ $(VERSIONFILE): build_detect_version
filelock_test: util/filelock_test.o $(LIBOBJECTS) $(TESTHARNESS)
$(CXX) util/filelock_test.o $(LIBOBJECTS) $(TESTHARNESS) -o $@ $(LDFLAGS)

# recreate the version file with the latest git revision
$(VERSIONFILE): build_detect_version
$(shell ./build_detect_platform build_config.mk)

ifeq ($(PLATFORM), IOS)
# For iOS, create universal object files to be used on both the simulator and
Expand Down
1 change: 0 additions & 1 deletion build_detect_version
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@ 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}

0 comments on commit 5d96f29

Please sign in to comment.