diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5e008214509f478a7d676f05a2928baa882387d5..933dc818d6da462d0acf519b7274b6242eac4c76 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -19,6 +19,7 @@ option(BORNAGAIN_MAN "Build a user manual" OFF)
 option(BUILD_DEBIAN "Build a debian package" OFF)
 option(ROOT_SUPPORT "Build with dependencies from ROOT" ON)
 option(BORNAGAIN_OPENMPI "Build with OpenMPI support" OFF)
+option(BORNAGAIN_RELEASE "Special option for making release" OFF)
 
 
 # --- Path for additional cmake modules ---
diff --git a/cmake/modules/BornAgainConfiguration.cmake b/cmake/modules/BornAgainConfiguration.cmake
index c43049cef6df03a8d9c55f1a96ce99c76e1bad8c..b913f04d86b6c4ebebbb9ac229996abb9a247fb4 100644
--- a/cmake/modules/BornAgainConfiguration.cmake
+++ b/cmake/modules/BornAgainConfiguration.cmake
@@ -40,18 +40,20 @@ configure_file(
   "${CMAKE_SOURCE_DIR}/Core/Samples/inc/BAVersion.h"
 )
 
-# --- configure deployment script for release
-configure_file("${CMAKE_SOURCE_DIR}/cmake/scripts/release.sh.in" "${CMAKE_BINARY_DIR}/bin/release.sh")
-
 # --- configure user setup script
 configure_file("${CMAKE_SOURCE_DIR}/cmake/scripts/thisbornagain.sh.in" "${CMAKE_BINARY_DIR}/bin/thisbornagain.sh" @ONLY)
 configure_file("${CMAKE_SOURCE_DIR}/cmake/scripts/thisbornagain.csh.in" "${CMAKE_BINARY_DIR}/bin/thisbornagain.csh" @ONLY)
 
-# --- configure project paths
-configure_file("${CMAKE_SOURCE_DIR}/cmake/scripts/BAConfigure.h.in" "${CMAKE_SOURCE_DIR}/Core/Tools/inc/BAConfigure.h" @ONLY)
+if(BORNAGAIN_RELEASE)
+    # --- configure deployment script for release
+    configure_file("${CMAKE_SOURCE_DIR}/cmake/scripts/release.sh.in" "${CMAKE_BINARY_DIR}/bin/release.sh")
+
+    # --- configure project paths
+    configure_file("${CMAKE_SOURCE_DIR}/cmake/scripts/BAConfigure.h.in" "${CMAKE_SOURCE_DIR}/Core/Tools/inc/BAConfigure.h" @ONLY)
 
-# --- configure Doxyfile
-configure_file("${CMAKE_SOURCE_DIR}/Doc/Doxygen/Doxyfile.in" "${CMAKE_SOURCE_DIR}/Doc/Doxygen/Doxyfile" @ONLY)
+    # --- configure Doxyfile
+    configure_file("${CMAKE_SOURCE_DIR}/Doc/Doxygen/Doxyfile.in" "${CMAKE_SOURCE_DIR}/Doc/Doxygen/Doxyfile" @ONLY)
+endif()
 
 # --- installation
 if(NOT WIN32)
diff --git a/dev-tools/git-utils/lines_of_code.png b/dev-tools/git-utils/lines_of_code.png
index ad533579d0fc32b7e1e47de00d5bcd13e4a162bc..cf5f7540478ab6840d8bc14feae481a8e6664ca5 100644
Binary files a/dev-tools/git-utils/lines_of_code.png and b/dev-tools/git-utils/lines_of_code.png differ
diff --git a/dev-tools/git-utils/lines_of_code.py b/dev-tools/git-utils/lines_of_code.py
deleted file mode 100644
index 0be19b7ee8290565af2e7bfc2bc5eaf658927968..0000000000000000000000000000000000000000
--- a/dev-tools/git-utils/lines_of_code.py
+++ /dev/null
@@ -1,303 +0,0 @@
-#!/usr/bin/env python
-
-# calculate number of lines of code in BornAgain project as a function of time
-#
-# should be executed either from parent directory
-# "python Macros/GitUtils/git_loc_history.py"
-# or from local one
-# "python git_loc_history ../.."
-#
-# based on 'git-loc' from from https://github.com/ITikhonov/git-loc
-#
-# ROOT graphics added
-# see http://root.cern.ch/drupal/content/how-use-use-python-pyroot-interpreter
-
-import re
-from email.utils import parsedate
-from time import mktime
-from datetime import datetime
-from os import popen
-import os
-from sys import argv,stderr,stdout
-import getopt
-from array import array
-
-opts, args = getopt.getopt(argv[1:],None)
-extfolder = False
-if len(args) == 1:
-    extfolder = True
-    targetfolder = args[0]
-
-fc=0
-locs=0
-locs_type=[0,0,0,0,0,0,0,0,0]
-#       0      1                  2            3      4        5      6     7       8
-descr=["Core","Functional Tests","Unit Tests","*.py","macros","GUI", "PythonAPI","Third","Undef"]
-adds=None
-cmt=None
-prev_time = datetime(2000,1,1)
-
-history=[]
-
-def pop():
-    if adds is not None:
-        pstr="%s %8u %5s %5s %7s %s \t%s"%(d,locs,'+'+str(adds),'-'+str(dels),hsh,who,cmt.strip())
-        print pstr
-        atmp = []
-        for x in locs_type:
-            atmp.append(x)
-        history.append((d,locs,atmp,adds,dels,hsh,who,cmt))
-
-def filePython(x):
-    if ".py" in x and not ".pypp." in x: return True
-    return False
-
-def fileCpp(x):
-    if ".h" in x or ".cpp" in x: return True
-    return False
-
-def dirCore(x):
-    if "/Core/Algorithms" in x: return True
-    if "/Core/FormFactors" in x: return True
-    if "/Core/Samples" in x: return True
-    if "/Core/Tools" in x: return True
-    if "/Core/Fitting" in x: return True
-    if "/Core/inc" in x: return True
-    if "/Core/src" in x: return True
-    if "/Fit/Factory" in x: return True
-    if "/Core/Geometry" in x: return True
-    return False
-
-def dirPyAPI(x):
-    if "/Core/PythonAPI" in x: return True
-    if "/Fit/PythonAPI" in x: return True
-    return False
-
-def dirFuncTest(x):
-    if "/App/" in x: return True
-    if "/Tests/FunctionalTests/TestCore" in x: return True
-    if "/Tests/FunctionalTests/TestFit" in x: return True
-    if "/Tests/FunctionalTests/TestPyCore" in x: return True
-    if "/Tests/FunctionalTests/TestPyFit" in x: return True
-    return False
-
-def dirGUI(x):
-    if "/GUI/coregui" in x  and not "widgetbox" in x and not "qttools" in x: return True
-    if "/AppGUI/coregui" in x: return True
-    if "/BASuite" in x: return True
-    return False
-
-def dirThirdParty(x):
-    if "/ThirdParty" in x: return True
-    return False
-
-def dirSkip(x):
-    if "/pub/core" in x: return True
-    return False
-
-def dirUnitTests(x):
-    if "/UnitTests/" in x: return True
-    if "/Tests/UnitTests/TestCore/" in x: return True
-    return False
-
-
-# ------------------------------------------------------------------------------
-def filetype(x):
-    file_type=8
-
-    if dirSkip(x): return file_type
-
-    if fileCpp(x) and dirCore(x):
-        file_type = 0
-    elif (fileCpp(x) or filePython(x)) and dirFuncTest(x):
-        file_type = 1
-
-    elif dirUnitTests(x):
-        file_type = 2
-
-    elif dirGUI(x):
-        file_type = 5
-
-    elif dirPyAPI(x):
-        file_type = 6
-
-    elif dirThirdParty(x):
-        file_type = 7
-    return file_type
-
-
-# ------------------------------------------------------------------------------
-prevfolder = os.getcwd()
-if extfolder: os.chdir(targetfolder)
-
-# parsing output of git log 
-file_type_ppp = 8
-file_type_mmm = 8
-for x in popen('git log develop --reverse -p'):
-    if x.startswith('commit'):
-        pop()
-        hsh=x[7:14];
-    if x.startswith('Author'):
-        who=x.replace("Author: ",'').replace('\n','');
-        who=re.sub(">.*","",who);
-        who=re.sub(".*<","",who);
-    if x.startswith('Date'):
-        fc=1
-        d=datetime(*parsedate(x[5:])[:7])
-        t=mktime(parsedate(x[5:]))
-        adds=0
-        dels=0
-        print x
-    if fc==2:
-        cmt=x[:-1]
-        fc=0
-    if fc==1:
-        if len(x)==1: fc=2
-    if x.startswith('+++'):
-        file_type_ppp = filetype(x)
-
-    if x.startswith('---'):
-        file_type_mmm = filetype(x)
-
-    if x.startswith('+') and not x.startswith('+++'):
-        locs_type[file_type_ppp] += 1
-        if file_type_ppp <6:
-            adds+=1
-            locs+=1
-    if x.startswith('-') and not x.startswith('---'):
-        locs_type[file_type_mmm] -= 1
-        if file_type_mmm <6:
-            dels+=1
-            locs-=1
-
-pop()
-os.chdir(prevfolder)
-
-
-# --------------------------------------------------------
-# making ROOT plot - number of lines of code .vs. time
-# --------------------------------------------------------
-from ROOT import *
-
-# beginning of coding (first commit) to set beginning of time x-scale
-c=history[0]
-td_first=TDatime(c[0].year, c[0].month, c[0].day, c[0].hour, c[0].minute, c[0].second)
-c=history[-1]
-td_last=TDatime(c[0].year, c[0].month, c[0].day, c[0].hour, c[0].minute, c[0].second)
-time_offset = int(td_first.Convert()) - 7*24.*3600 # one week before first commit
-
-ntimebins = 4*int((td_last.Convert() - time_offset)/3600./24)
-
-
-#print "ntimebins", ntimebins
-hist_ncommits = TH1D("ncommits", "ncommits", ntimebins, td_first.Convert() - time_offset, td_last.Convert() - time_offset)
-
-
-# ---------------------------------
-# creating histograms
-# ---------------------------------
-selected_hist = [0,1,2,5,6]
-
-a_histograms = []
-hstack = THStack("hstack","Number of Lines of Code")
-hstack.SetTitle("");
-
-a_colors=[kAzure+1, kOrange, kRed, kGreen, kYellow-7, kAzure, kGray+1]
-legend = TLegend(0.15,0.65,0.49,0.84)
-legend.SetBorderSize(1);
-#legend.SetFillStyle(1);
-for i in range(0, len(selected_hist) ):
-    i_hist = selected_hist[i]
-    #hist = TH1D(descr[i_hist],descr[i_hist],len(xtmp)-1,xtmp)
-    hist = TH1D(descr[i_hist],descr[i_hist], ntimebins, td_first.Convert() - time_offset, td_last.Convert() - time_offset )
-    
-    hist.GetXaxis().SetTimeDisplay(1)
-    hist.GetXaxis().SetTimeFormat("%d/%m")
-    hist.GetYaxis().SetLabelSize(0.030)
-    hist.GetXaxis().SetLabelSize(0.035)
-    hist.GetXaxis().SetNdivisions(512)
-    hist.GetXaxis().SetTimeOffset(time_offset)
-    hist.SetLineColor(a_colors[i_hist])
-    hist.SetFillColor(a_colors[i_hist])
-    a_histograms.append(hist)
-
-
-# adding histograms to legend in right order
-for i_hist in range(len(a_histograms)-1,-1,-1):
-    legend.AddEntry(a_histograms[i_hist],a_histograms[i_hist].GetTitle(),"f")
-
-# filling histograms
-for c in history:
-    td=TDatime(c[0].year, c[0].month, c[0].day, c[0].hour, c[0].minute, c[0].second)
-    xx = td.Convert() - time_offset
-    hist_ncommits.Fill(xx)
-    for i in range(0, len(selected_hist) ):
-        i_hist = selected_hist[i]
-        yy = c[2][i_hist]
-        a_histograms[i].Fill(xx,yy)
-
-# normalizing bin content on number of entries per bin
-for i_bin in range(1,hist_ncommits.GetNbinsX()+1):
-    nentries = hist_ncommits.GetBinContent(i_bin)
-    for h in a_histograms:
-        current_bin_content = h.GetBinContent(i_bin)
-        if nentries != 0: current_bin_content /= nentries
-        h.SetBinContent(i_bin, current_bin_content)
-
-# filling empty bins with values from previous day
-for h in a_histograms:
-    prev_content = 0
-    for i_bin in range(1,h.GetNbinsX()+1):
-        if h.GetBinContent(i_bin) == 0:
-            h.SetBinContent(i_bin, prev_content)
-        prev_content = h.GetBinContent(i_bin)
-        
-    
-
-
-
-
-
-
-
-#preparing canvas
-c1 = TCanvas( 'gisasfw_loc', 'Number of lines of code in BornAgain project', 800, 800)
-c1.cd()
-gPad.SetGrid()
-gPad.SetBottomMargin(0.10)
-gPad.SetLeftMargin(0.10)
-gPad.SetTopMargin(0.10)
-gPad.SetRightMargin(0.10)
-
-# drawing
-for h in a_histograms:
-    hstack.Add(h,"][")
-hstack.Draw()
-hstack.GetXaxis().SetTimeDisplay(1)
-#hstack.GetXaxis().SetTimeFormat("%d/%m")
-hstack.GetXaxis().SetTimeFormat("#splitline{%d/%m}{%Y}")
-hstack.GetXaxis().SetLabelSize(0.03)
-hstack.GetYaxis().SetLabelSize(0.035)
-hstack.GetXaxis().SetLabelOffset(0.02)
-hstack.GetXaxis().SetNdivisions(512)
-hstack.GetXaxis().SetTimeOffset(time_offset)
-
-legend.Draw()
-c1.Modified()
-c1.Modified()
-c1.Update()
-gPad.RedrawAxis()
-gPad.RedrawAxis("G")
-
-c1.Print("lines_of_code.png")
-
-
-
-# wait for input to keep the GUI (which lives on a ROOT event dispatcher) alive
-if __name__ == '__main__':
-   rep = ''
-   while not rep in [ 'q', 'Q' ]:
-      rep = raw_input( 'enter "q" to quit: ' )
-      if 1 < len(rep):
-         rep = rep[0]
-
diff --git a/dev-tools/release/make_release.py b/dev-tools/release/make_release.py
new file mode 100644
index 0000000000000000000000000000000000000000..c325f8e0b16f3ea7ae6ff6958c595def3bbbdf5d
--- /dev/null
+++ b/dev-tools/release/make_release.py
@@ -0,0 +1,67 @@
+#!/usr/bin/env python
+
+import sys
+import os
+import subprocess
+
+
+def run_process(command, working_directory):
+    p = subprocess.Popen(command, cwd=working_directory, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+    p.wait()
+    if p.returncode:
+        for line in iter(p.stderr.readline, b''):
+            print line
+        exit("Error while running the command '"+" ".join(command)+"'")
+    return not p.returncode
+
+
+def git_clone(branch_name, working_directory):
+    print "Cloning BornAgain repository ... ",
+    cmd = ['git', 'clone', 'git@apps.jcns.fz-juelich.de:BornAgain.git']
+    run_process(cmd, working_directory)
+    print " OK."
+    cmd = ['git', 'checkout', branch_name]
+    print "XXX", cmd, working_directory
+    run_process(cmd, working_directory)
+
+
+def parse_release_name(release_branch_name):
+    name, version = release_branch_name.split("-")
+    version_major, version_minor, version_patch = version.split(".")
+    print version_major, version_minor, version_patch
+    return version_major, version_minor, version_patch
+
+
+def prepare_release(release_branch_name, release_working_directory):
+    print "Preparing release working directory '%s'." % release_working_directory
+    # making directories
+    os.makedirs(release_working_directory)
+    os.makedirs(release_working_directory+"/build")
+    os.makedirs(release_working_directory+"/upload")
+
+    # cloning git
+    #git_clone(release_branch_name, release_working_directory)
+    git_clone("develop", release_working_directory)
+
+
+
+def main():
+    if len(sys.argv) != 2:
+        print "Please specify the name of the release branch."
+        print "Usage: python make_release.py release-0.9.3"
+        exit()
+
+    release_branch_name = sys.argv[1]
+
+    release_working_directory = os.getcwd() + "/" + release_branch_name
+
+    if os.path.exists(release_working_directory):
+        print "Directory %s exists, continuing release process." % release_working_directory
+    else:
+        prepare_release(release_branch_name, release_working_directory)
+
+
+
+
+if __name__ == '__main__':
+    main()
diff --git a/dev-tools/release/make_release.sh b/dev-tools/release/make_release.sh
index 2e548998e62f4f98c3ce9c58cdbf0fe88893fa94..8b8a79b30c884231453ff1cb59290c7f024cef9a 100755
--- a/dev-tools/release/make_release.sh
+++ b/dev-tools/release/make_release.sh
@@ -3,23 +3,28 @@
 
 set -e
 
-mkdir BornAgain-release
-cd BornAgain-release
 
-git clone git@apps.jcns.fz-juelich.de:BornAgain.git
-cd BornAgain
-git checkout PreRelease
 
-cd ..
-mkdir build
-cd build
 
-cmake ../BornAgain
-
-./bin/release.sh
-
-echo " "
-echo "1) Modify BornAgain-release/build/RELEASE/CHANGELOG"
-echo "2) Copy new Windows build into BornAgain-release/build/RELEASE"
-echo "3) Run BornAgain-release/build/bin/release.sh with menu option #2 (upload on apps)"
-echo "4) Run BornAgain-release/build/bin/release.sh with menu option #3 (finalize git)"
+# set -e
+# 
+# mkdir BornAgain-release
+# cd BornAgain-release
+# 
+# git clone git@apps.jcns.fz-juelich.de:BornAgain.git
+# cd BornAgain
+# git checkout PreRelease
+# 
+# cd ..
+# mkdir build
+# cd build
+# 
+# cmake ../BornAgain
+# 
+# ./bin/release.sh
+# 
+# echo " "
+# echo "1) Modify BornAgain-release/build/RELEASE/CHANGELOG"
+# echo "2) Copy new Windows build into BornAgain-release/build/RELEASE"
+# echo "3) Run BornAgain-release/build/bin/release.sh with menu option #2 (upload on apps)"
+# echo "4) Run BornAgain-release/build/bin/release.sh with menu option #3 (finalize git)"