Added a top level Makefile to encapsulate the ./bootsrap/ccb.py call.
This commit is contained in:
parent
a2d4f01ca3
commit
1b79ef75c9
|
@ -0,0 +1,81 @@
|
||||||
|
|
||||||
|
UNAME_S = $(shell uname -s)
|
||||||
|
UNAME_R = $(shell uname -r)
|
||||||
|
|
||||||
|
# We must use devtoolset-2 only under RHEL6 & clones.
|
||||||
|
DEVTOOLSET_OPTION =
|
||||||
|
ifeq ($(UNAME_S),Linux)
|
||||||
|
ifneq ($(findstring .el6.,$(UNAME_R)),)
|
||||||
|
DEVTOOLSET_OPTION = --devtoolset-2
|
||||||
|
endif
|
||||||
|
ifneq ($(findstring .slsoc6.,$(UNAME_R)),)
|
||||||
|
DEVTOOLSET_OPTION = --devtoolset-2
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
SMP_FLAGS =
|
||||||
|
ifneq ($(shell which nproc 2> /dev/null),)
|
||||||
|
SMP_FLAGS = -j$(shell nproc)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ISYS_ROOT = $(shell ./bootstrap/coriolisEnv.py --query-isys-root)
|
||||||
|
INST_ROOT = $(shell ./bootstrap/coriolisEnv.py --query-inst-root)
|
||||||
|
|
||||||
|
|
||||||
|
help:
|
||||||
|
@echo "============================================================================"; \
|
||||||
|
echo "Coriolis build & install top Makefile"; \
|
||||||
|
echo ""; \
|
||||||
|
echo "This Makefile is only a wrapper around the Coriolis & Chams Builder tool"; \
|
||||||
|
echo "(./boostrap/ccb.py)"; \
|
||||||
|
echo ""; \
|
||||||
|
echo "To build it, simply type (in coriolis/, at the shell prompt):"; \
|
||||||
|
echo " ego@home:coriolis> make install"; \
|
||||||
|
echo "To remove the build directory (and keep the software installed):"; \
|
||||||
|
echo " ego@home:coriolis> make clean_build"; \
|
||||||
|
echo "To fully remove build & install:"; \
|
||||||
|
echo " ego@home:coriolis> make uninstall"; \
|
||||||
|
echo "============================================================================"; \
|
||||||
|
echo "SMP_FLAGS = $(SMP_FLAGS)" ; \
|
||||||
|
echo "ISYS_ROOT = $(ISYS_ROOT)" ; \
|
||||||
|
echo "INST_ROOT = $(INST_ROOT)" ; \
|
||||||
|
echo "============================================================================";
|
||||||
|
|
||||||
|
|
||||||
|
check_dir:
|
||||||
|
@if [ "`pwd`" != "${HOME}/coriolis-2.x/src/coriolis" ]; then \
|
||||||
|
echo "Coriolis uses a fixed directory from the user's root."; \
|
||||||
|
echo "You must put in:"; \
|
||||||
|
echo " <${HOME}/coriolis-2.x/src/coriolis>"; \
|
||||||
|
echo "Instead of:"; \
|
||||||
|
echo " <`pwd`>"; \
|
||||||
|
echo "Stopping build."; \
|
||||||
|
exit 1; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
install: check_dir
|
||||||
|
@./bootstrap/ccb.py $(DEVTOOLSET_OPTION) --project=coriolis --make="$(SMP_FLAGS) install"
|
||||||
|
@./bootstrap/ccb.py $(DEVTOOLSET_OPTION) --project=coriolis --make="-j1 install" --doc
|
||||||
|
@echo ""; \
|
||||||
|
echo "============================================================================"; \
|
||||||
|
echo "Coriolis has been successfully built"; \
|
||||||
|
echo "============================================================================"; \
|
||||||
|
echo "It has been installed under the directory:"; \
|
||||||
|
echo " $(INST_ROOT)/{bin,lib,lib64,include,share,...}"; \
|
||||||
|
echo ""; \
|
||||||
|
echo "You can start the tool by running:"; \
|
||||||
|
echo " ego@home:~> $(INST_ROOT)/bin/coriolis"; \
|
||||||
|
echo "============================================================================";
|
||||||
|
|
||||||
|
|
||||||
|
clean_build: check_dir
|
||||||
|
@echo "Removing the build tree only."; \
|
||||||
|
echo " $(INST_ROOT)/../build"; \
|
||||||
|
rm -rf $(INST_ROOT)/../build
|
||||||
|
|
||||||
|
|
||||||
|
uninstall: check_dir
|
||||||
|
@echo "Removing the whole build & install tree..."; \
|
||||||
|
echo " $(ISYS_ROOT)"; \
|
||||||
|
rm -rf $(ISYS_ROOT)
|
15
README.rst
15
README.rst
|
@ -62,9 +62,9 @@ If you want to use the *devel* branch: ::
|
||||||
|
|
||||||
ego@home:coriolis$ git checkout devel
|
ego@home:coriolis$ git checkout devel
|
||||||
|
|
||||||
Then, build the tool, where ``N`` is your number of threads: ::
|
Then, build the tool: ::
|
||||||
|
|
||||||
ego@home:coriolis$ ./bootstrap/ccb.py --project=coriolis --make="-jN install"
|
ego@home:coriolis$ make install
|
||||||
|
|
||||||
Coriolis gets installed at the root of the following tree: ::
|
Coriolis gets installed at the root of the following tree: ::
|
||||||
|
|
||||||
|
@ -77,7 +77,16 @@ distribution.
|
||||||
Using Coriolis
|
Using Coriolis
|
||||||
==============
|
==============
|
||||||
|
|
||||||
A helper is provided to setup the environment ``coriolisEnv.py``: ::
|
The Coriolis main interface can be launched with the command: ::
|
||||||
|
|
||||||
|
ego@home:~: ~/coriolis-2.x/<OS>.<DISTRIB>/Release.Shared/install/bin/coriolis
|
||||||
|
|
||||||
|
The ``coriolis`` script is tasked to guess it's location and setup appropriatly
|
||||||
|
the UNIX environment, then lauch ``cgt`` (or *any* command, with the
|
||||||
|
``--run=<COMMAND>`` option).
|
||||||
|
|
||||||
|
Conversely, you can setup the current shell environement for Coriolis by
|
||||||
|
using the helper ``coriolisEnv.py``, then run any Coriolis tool: ::
|
||||||
|
|
||||||
ego@home:~$ eval `~/coriolis-2.x/src/coriolis/bootstrap/coriolisEnv.py`
|
ego@home:~$ eval `~/coriolis-2.x/src/coriolis/bootstrap/coriolisEnv.py`
|
||||||
ego@home:~$ cgt -V
|
ego@home:~$ cgt -V
|
||||||
|
|
|
@ -134,6 +134,8 @@ if __name__ == "__main__":
|
||||||
|
|
||||||
parser = optparse.OptionParser ()
|
parser = optparse.OptionParser ()
|
||||||
# Build relateds.
|
# Build relateds.
|
||||||
|
parser.add_option ( "--query-inst-root", action="store_true" , dest="queryInstRoot" )
|
||||||
|
parser.add_option ( "--query-isys-root", action="store_true" , dest="queryISysRoot" )
|
||||||
parser.add_option ( "--csh" , action="store_true" , dest="csh" )
|
parser.add_option ( "--csh" , action="store_true" , dest="csh" )
|
||||||
parser.add_option ( "--release" , action="store_true" , dest="release" )
|
parser.add_option ( "--release" , action="store_true" , dest="release" )
|
||||||
parser.add_option ( "--debug" , action="store_true" , dest="debug" )
|
parser.add_option ( "--debug" , action="store_true" , dest="debug" )
|
||||||
|
@ -253,4 +255,12 @@ if __name__ == "__main__":
|
||||||
if useDevtoolset2:
|
if useDevtoolset2:
|
||||||
evalScript = '%s scl enable devtoolset-2 ${SHELL}' % evalScript
|
evalScript = '%s scl enable devtoolset-2 ${SHELL}' % evalScript
|
||||||
|
|
||||||
|
if options.queryISysRoot:
|
||||||
|
print '%s/%s' % (rootDir,osType)
|
||||||
|
sys.exit( 0 )
|
||||||
|
|
||||||
|
if options.queryInstRoot:
|
||||||
|
print coriolisTop
|
||||||
|
sys.exit( 0 )
|
||||||
|
|
||||||
print evalScript
|
print evalScript
|
||||||
|
|
Loading…
Reference in New Issue