]> git.donarmstrong.com Git - bamtools.git/commitdiff
Updated BamTools version information.
authorderek <derekwbarnett@gmail.com>
Mon, 25 Oct 2010 18:10:42 +0000 (14:10 -0400)
committerderek <derekwbarnett@gmail.com>
Mon, 25 Oct 2010 18:10:42 +0000 (14:10 -0400)
 * Also automated version information propagation forfuture updates.
   Only need to set version in top-level Makefile.

Makefile
src/toolkit/bamtools.cpp

index 1dc3f7b1b1ed51862f08967e947e2bfc38eededf..f282c204d9081563820daccd0d112a57cf15454b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -5,19 +5,22 @@
 # top-level
 # ==========================
 
+# define current BamTools version
+BT_MAJOR_VER = 0
+BT_MINOR_VER = 8
+BT_BUILD_VER = 1025
+export BT_VERSION = $(BT_MAJOR_VER).$(BT_MINOR_VER).$(BT_BUILD_VER)
+
 # define main directories
 export OBJ_DIR  = obj
 export BIN_DIR  = bin
 export SRC_DIR  = src
 
 # define compile/link flags
-export CXX      = g++\r
-export CXXFLAGS = -Wall -O3 -D_FILE_OFFSET_BITS=64
+export CXX      = g++
+export CXXFLAGS = -Wall -O3 -D_FILE_OFFSET_BITS=64 -DBT_VERSION=$(BT_VERSION)
 export LIBS     = -lz
 
-# define current BamTools version
-export BAMTOOLS_VERSION = 0.7.0812
-
 # define source subdirectories
 SUBDIRS = $(SRC_DIR)/api \
           $(SRC_DIR)/utils \
@@ -26,7 +29,7 @@ SUBDIRS = $(SRC_DIR)/api \
 
 all:
        @echo "Building BamTools:"
-       @echo "Version: $$BAMTOOLS_VERSION"
+       @echo "Version: $$BT_VERSION"
        @echo "========================================================="
        @echo ""
        @echo "- Creating target directories"
index 160ff9ac7e46c7ee5e5c91f4155ce68b2515390b..6c5c1f60337848a3929daba0d4c1d61258dda218 100644 (file)
@@ -3,12 +3,20 @@
 // Marth Lab, Department of Biology, Boston College
 // All rights reserved.
 // ---------------------------------------------------------------------------
-// Last modified: 12 October 2010
+// Last modified: 25 October 2010
 // ---------------------------------------------------------------------------
 // Integrates a number of BamTools functionalities into a single executable.
 // ***************************************************************************
 
+// stringify version information
+#define BAMTOOLS_VER1_(x) #x
+#define BAMTOOLS_VER_(x)  BAMTOOLS_VER1_(x)
+#define BAMTOOLS_VERSION  BAMTOOLS_VER_(BT_VERSION)
+
+// includes
+#include <cstdio>
 #include <iostream>
+#include <string>
 #include "bamtools_convert.h"
 #include "bamtools_count.h"
 #include "bamtools_coverage.h"
@@ -23,9 +31,7 @@
 using namespace std;
 using namespace BamTools;
 
-// ------------------------------------------
 // bamtools subtool names
-
 static const string CONVERT  = "convert";
 static const string COUNT    = "count";
 static const string COVERAGE = "coverage";
@@ -38,31 +44,29 @@ static const string SORT     = "sort";
 static const string SPLIT    = "split";
 static const string STATS    = "stats";
 
-// ------------------------------------------
-// bamtools help/version names
-
-static const string HELP       = "help";
-static const string LONG_HELP  = "--help";
-static const string SHORT_HELP = "-h";
-
+// bamtools help/version constants
+static const string HELP          = "help";
+static const string LONG_HELP     = "--help";
+static const string SHORT_HELP    = "-h";
 static const string VERSION       = "version";
 static const string LONG_VERSION  = "--version";
 static const string SHORT_VERSION = "-v";
 
+// determine if string is a help constant
 static bool IsHelp(char* str) {
     return ( str == HELP ||
              str == LONG_HELP ||
              str == SHORT_HELP );
 }
 
+// determine if string is a version constant
 static bool IsVersion(char* str) {
     return ( str == VERSION ||
              str == LONG_VERSION ||
              str == SHORT_VERSION );
 }
 
-// ------------------------------------------
-// Subtool factory method
+// subtool factory method
 AbstractTool* CreateTool(const string& arg) {
   
     // determine tool type based on arg
@@ -82,8 +86,7 @@ AbstractTool* CreateTool(const string& arg) {
     return 0;
 }
 
-// ------------------------------------------
-// Print help info
+// print help info
 int Help(int argc, char* argv[]) {
   
     // check for 'bamtools help COMMAND' to print tool-specific help message
@@ -118,11 +121,10 @@ int Help(int argc, char* argv[]) {
     return 0;
 }
 
-// ------------------------------------------
-// Print version info
+// print version info
 int Version(void) {
     cout << endl;
-    cout << "bamtools v0.8.xx" << endl;
+    cout << "bamtools " << BAMTOOLS_VERSION << endl;
     cout << "Part of BamTools API and toolkit" << endl;
     cout << "Primary authors: Derek Barnett, Erik Garrison, Michael Stromberg" << endl;
     cout << "(c) 2009-2010 Marth Lab, Biology Dept., Boston College" << endl;
@@ -130,7 +132,6 @@ int Version(void) {
     return 0;
 }
 
-// ------------------------------------------
 // toolkit entry point
 int main(int argc, char* argv[]) {