AUTOMAKE_OPTIONS = gnu
EXTRA_DIST = debian autogen.sh ceph.spec.in
SUBDIRS = src
+
+dist-hook:
+ src/make_version
noinst_LIBRARIES = \
libcommon.a libcrush.a \
libmon.a libmds.a libosdc.a libosd.a libclient.a \
- libos.a libebofs.a
+ libos.a libebofs.a
noinst_LIBRARIES += libcrush_so.a #libcephclient_so.a
$(install_sh_SCRIPT) -m 0600 sample.ceph.conf $(DESTDIR)$(sysconfdir)/ceph/sample.ceph.conf
$(install_sh_SCRIPT) -m 0600 sample.cluster.conf $(DESTDIR)$(sysconfdir)/ceph/sample.cluster.conf
+ceph_ver.h : $(all_sources)
+# ./make_version
+
+ceph_ver.c : ceph_ver.h
+
# cleaning
clean-local:
-rm *.so
# libs
libcommon_a_SOURCES = \
+ ceph_ver.c \
+ $(libcommon_files)
+
+# this list ommits the ceph_ver.c file
+libcommon_files = \
common/LogClient.cc \
msg/Message.cc \
common/Logger.cc \
osdc/Objecter.h\
sample.ceph.conf\
sample.cluster.conf
+
+all_sources = $(cmon_SOURCES) $(ceph_SOURCES) $(mkmonfs_SOURCES) $(monmaptool_SOURCES) \
+ $(crushtool_SOURCES) $(osdmaptool_SOURCES) $(cconf_SOURCES) $(mount_ceph_SOURCES) $(cmds_SOURCES) \
+ $(dumpjournal_SOURCES) $(cosd_SOURCES) $(dupstore_SOURCES) $(streamtest_SOURCES) $(csyn_SOURCES) \
+ $(testmsgr_SOURCES) $(cfuse_SOURCES) $(fakefuse_SOURCES) $(psim_SOURCES) \
+ $(libcrush_so_a_SOURCES) $(libcommon_files) $(libcrush_a_SOURCES) \
+ $(libmon_a_SOURCES) $(libmds_a_SOURCES) $(libebofs_a_SOURCES) $(libos_a_SOURCES) $(libosd_a_SOURCES) \
+ $(libosdc_a_SOURCES) $(libclient_a_SOURCES)
--- /dev/null
+
+#include "acconfig.h"
+#include "ceph_ver.h"
+
+#define CONCAT_VER_SYMBOL(x) ceph_ver__##x
+
+#define DEFINE_VER_SYMBOL(x) int CONCAT_VER_SYMBOL(x)
+
+DEFINE_VER_SYMBOL(CEPH_GIT_VER);
+
+#define CEPH_VER VERSION "-" #CEPH_GIT_VER
+
#include "config.h"
#include "tls.h"
+#include "ceph_ver.h"
+
+#define _STR(x) #x
+#define STRINGIFY(x) _STR(x)
+
void common_init(std::vector<const char*>& args, bool open)
{
tls_init();
// open log file?
if (open)
_dout_open_log();
+
+ generic_dout(0) << "ceph version " << VERSION << " (" << STRINGIFY(CEPH_GIT_VER) << ")" << dendl;
}
--- /dev/null
+#!/bin/bash
+
+
+dname=`dirname $0`
+
+git_ver=`git-rev-parse HEAD 2>/dev/null`
+
+[ -e $dname/.make_last_ver ] && \
+ [ -e $dname/ceph_ver.h ] && \
+ [ "$git_ver" == "`cat $dname/.make_last_ver`" ] && exit
+
+
+print_all() {
+echo "#ifndef __CEPH_VERSION_H"
+echo "#define __CEPH_VERSION_H"
+echo
+echo "#define CEPH_GIT_VER `git-rev-parse HEAD 2>/dev/null`"
+echo
+echo "#endif"
+
+}
+
+print_all > $dname/ceph_ver.h
+
+echo $git_ver > $dname/.make_last_ver
+