switching to lesser Makefiles

This commit is contained in:
nemu 2009-04-14 19:32:35 +00:00
parent 39e4499b27
commit 4e2c01d8f0
6 changed files with 19 additions and 445 deletions

View File

@ -1,5 +1,5 @@
#---------------------------------------------------
# Makefile.musrfit
# Makefile
#
# Author: Andreas Suter
# e-mail: andreas.suter@psi.ch
@ -68,20 +68,20 @@ MMLIB = -L$(ROOTSYS)/lib -lMathMore
INSTALLPATH = $(HOME)/analysis/bin
EXEC = musrfit
EXEC = musrfit musrview musrparam musrt0 msr2msr
# some definitions: headers, sources, objects,...
OBJS =
OBJS += $(EXEC).o
OBJS += musrfit.o musrview.o musrparam.o musrt0.o msr2msr.o
# make the executable:
#
all: $(EXEC)
$(EXEC): $(OBJS)
@echo "---> Building $(EXEC) ..."
@echo "---> Building $@ ..."
/bin/rm -f $(SHLIB)
$(LD) $(OBJS) -o $(EXEC) $(GLIBS) $(PSILIBS) $(MNLIB) $(MMLIB)
$(LD) $< -o $@ $(GLIBS) $(PSILIBS) $(MNLIB) $(MMLIB)
@echo "done"
# clean up: remove all object file (and core files)
@ -94,9 +94,7 @@ clean:; @rm -f $(OBJS)
#
$(OBJS): %.o: %.cpp
$(CXX) $(INCLUDES) $(CXXFLAGS) -c $<
install: all
@echo "copy $(EXEC) to $(INSTALLPATH)"
cp -p $(EXEC) $(INSTALLPATH)
cp -p musrfit_startup.xml $(INSTALLPATH)

View File

@ -1,99 +0,0 @@
#---------------------------------------------------
# Makefile.msr2msr
#
# Author: Andreas Suter
# e-mail: andreas.suter@psi.ch
#
# $Id$
#---------------------------------------------------
#---------------------------------------------------
# get compilation and library flags from root-config
ROOTCFLAGS = $(shell $(ROOTSYS)/bin/root-config --cflags)
ROOTLIBS = $(shell $(ROOTSYS)/bin/root-config --libs)
ROOTGLIBS = $(shell $(ROOTSYS)/bin/root-config --glibs)
#---------------------------------------------------
# depending on the architecture, choose the compiler,
# linker, and the flags to use
#
OSTYPE = linux
ifeq ($(OSTYPE),linux)
OS = LINUX
endif
ifeq ($(OSTYPE),linux-gnu)
OS = LINUX
endif
ifeq ($(OSTYPE),darwin)
OS = DARWIN
endif
# -- Linux
ifeq ($(OS),LINUX)
CXX = g++
CXXFLAGS = -g -Wall -fPIC
PMUSRPATH = ./include
MNPATH = $(ROOTSYS)/include
INCLUDES = -I $(PMUSRPATH) -I $(MNPATH)
LD = g++
LDFLAGS = -g
endif
# -- Darwin
ifeq ($(OS),DARWIN)
CXX = g++
CXXFLAGS = -g -Wall -fPIC
INCLUDES = -I../include
LD = g++
LDFLAGS = -g
endif
# the output from the root-config script:
CXXFLAGS += $(ROOTCFLAGS)
LDFLAGS +=
# the ROOT libraries (G = graphic)
LIBS = $(ROOTLIBS) -lXMLParser
GLIBS = $(ROOTGLIBS) -lXMLParser
# PSI libs
#PSILIBS = -lTLemRunHeader -lPMusr
# Minuit2 lib
#MNLIB = -L$(ROOTSYS)/lib -lMinuit2
INSTALLPATH = $(HOME)/analysis/bin
# Executable
EXEC = msr2msr
# some definitions: headers, sources, objects,...
OBJS =
OBJS += $(EXEC).o
# make the executable:
#
all: $(EXEC)
$(EXEC): $(OBJS)
@echo "---> Building $(EXEC) ..."
/bin/rm -f $(SHLIB)
$(LD) $(OBJS) -o $(EXEC) $(GLIBS)
@echo "done"
# clean up: remove all object file (and core files)
# semicolon needed to tell make there is no source
# for this target!
#
clean:; @rm -f $(OBJS)
@echo "---> removing $(OBJS)"
#
$(OBJS): %.o: %.cpp
$(CXX) $(INCLUDES) $(CXXFLAGS) -c $<
install: all
@echo "copy $(EXEC) to $(INSTALLPATH)"
cp -p $(EXEC) $(INSTALLPATH)

View File

@ -1,94 +0,0 @@
#---------------------------------------------------
# Makefile.musrparam
#
# Author: Andreas Suter
# e-mail: andreas.suter@psi.ch
#
# $Id$
#---------------------------------------------------
#---------------------------------------------------
# get compilation and library flags from root-config
ROOTCFLAGS = $(shell $(ROOTSYS)/bin/root-config --cflags)
ROOTLIBS = $(shell $(ROOTSYS)/bin/root-config --libs)
ROOTGLIBS = $(shell $(ROOTSYS)/bin/root-config --glibs)
#---------------------------------------------------
# depending on the architecture, choose the compiler,
# linker, and the flags to use
#
OSTYPE = linux
ifeq ($(OSTYPE),linux)
OS = LINUX
endif
ifeq ($(OSTYPE),linux-gnu)
OS = LINUX
endif
ifeq ($(OSTYPE),darwin)
OS = DARWIN
endif
# -- Linux
ifeq ($(OS),LINUX)
CXX = g++
CXXFLAGS = -g -Wall -fPIC
PMUSRPATH = ./include
MNPATH = $(ROOTSYS)/include
GSLPATH = /usr/include/gsl
INCLUDES = -I $(PMUSRPATH) -I $(MNPATH) -I $(GSLPATH)
LD = g++
LDFLAGS = -g
endif
# -- Darwin
ifeq ($(OS),DARWIN)
CXX = g++
CXXFLAGS = -g -Wall -fPIC
INCLUDES = -I../include
LD = g++
LDFLAGS = -g
endif
# the output from the root-config script:
CXXFLAGS += $(ROOTCFLAGS)
LDFLAGS +=
# the ROOT libraries (G = graphic)
LIBS = $(ROOTLIBS)
GLIBS = $(ROOTGLIBS)
INSTALLPATH = $(HOME)/analysis/bin
EXEC = musrparam
# some definitions: headers, sources, objects,...
OBJS =
OBJS += $(EXEC).o
# make the executable:
#
all: $(EXEC)
$(EXEC): $(OBJS)
@echo "---> Building $(EXEC) ..."
$(LD) $(OBJS) -o $(EXEC) $(LIBS)
@echo "done"
# clean up: remove all object file (and core files)
# semicolon needed to tell make there is no source
# for this target!
#
clean:; @rm -f $(OBJS)
@echo "---> removing $(OBJS)"
#
$(OBJS): %.o: %.cpp
$(CXX) $(INCLUDES) $(CXXFLAGS) -c $<
install: all
@echo "copy $(EXEC) to $(INSTALLPATH)"
cp -p $(EXEC) $(INSTALLPATH)

View File

@ -1,102 +0,0 @@
#---------------------------------------------------
# Makefile.musrt0
#
# Author: Andreas Suter
# e-mail: andreas.suter@psi.ch
#
# $Id$
#---------------------------------------------------
#---------------------------------------------------
# get compilation and library flags from root-config
ROOTCFLAGS = $(shell $(ROOTSYS)/bin/root-config --cflags)
ROOTLIBS = $(shell $(ROOTSYS)/bin/root-config --libs)
ROOTGLIBS = $(shell $(ROOTSYS)/bin/root-config --glibs)
#---------------------------------------------------
# depending on the architecture, choose the compiler,
# linker, and the flags to use
#
OSTYPE = linux
ifeq ($(OSTYPE),linux)
OS = LINUX
endif
ifeq ($(OSTYPE),linux-gnu)
OS = LINUX
endif
ifeq ($(OSTYPE),darwin)
OS = DARWIN
endif
# -- Linux
ifeq ($(OS),LINUX)
CXX = g++
CXXFLAGS = -g -Wall -fPIC
PMUSRPATH = ./include
MNPATH = $(ROOTSYS)/include
#GSLPATH = /usr/include/gsl
INCLUDES = -I $(PMUSRPATH) -I $(MNPATH)
LD = g++
LDFLAGS = -g
endif
# -- Darwin
ifeq ($(OS),DARWIN)
CXX = g++
CXXFLAGS = -g -Wall -fPIC
INCLUDES = -I../include
LD = g++
LDFLAGS = -g
endif
# the output from the root-config script:
CXXFLAGS += $(ROOTCFLAGS)
LDFLAGS +=
# the ROOT libraries (G = graphic)
LIBS = $(ROOTLIBS) -lXMLParser
GLIBS = $(ROOTGLIBS) -lXMLParser
# PSI libs
PSILIBS = -lTLemRunHeader -lPMusr
# Minuit2 lib
MNLIB = -L$(ROOTSYS)/lib -lMinuit2
# MathMore lib
MMLIB = -L$(ROOTSYS)/lib -lMathMore
INSTALLPATH = $(HOME)/analysis/bin
EXEC = musrt0
# some definitions: headers, sources, objects,...
OBJS =
OBJS += $(EXEC).o
# make the executable:
#
all: $(EXEC)
$(EXEC): $(OBJS)
@echo "---> Building $(EXEC) ..."
/bin/rm -f $(SHLIB)
$(LD) $(OBJS) -o $(EXEC) $(GLIBS) $(PSILIBS) $(MNLIB) $(MMLIB)
@echo "done"
# clean up: remove all object file (and core files)
# semicolon needed to tell make there is no source
# for this target!
#
clean:; @rm -f $(OBJS)
@echo "---> removing $(OBJS)"
#
$(OBJS): %.o: %.cpp
$(CXX) $(INCLUDES) $(CXXFLAGS) -c $<
install: all
@echo "copy $(EXEC) to $(INSTALLPATH)"
cp -p $(EXEC) $(INSTALLPATH)

View File

@ -1,102 +0,0 @@
#---------------------------------------------------
# Makefile.musrview
#
# Author: Andreas Suter
# e-mail: andreas.suter@psi.ch
#
# $Id$
#---------------------------------------------------
#---------------------------------------------------
# get compilation and library flags from root-config
ROOTCFLAGS = $(shell $(ROOTSYS)/bin/root-config --cflags)
ROOTLIBS = $(shell $(ROOTSYS)/bin/root-config --libs)
ROOTGLIBS = $(shell $(ROOTSYS)/bin/root-config --glibs)
#---------------------------------------------------
# depending on the architecture, choose the compiler,
# linker, and the flags to use
#
OSTYPE = linux
ifeq ($(OSTYPE),linux)
OS = LINUX
endif
ifeq ($(OSTYPE),linux-gnu)
OS = LINUX
endif
ifeq ($(OSTYPE),darwin)
OS = DARWIN
endif
# -- Linux
ifeq ($(OS),LINUX)
CXX = g++
CXXFLAGS = -g -Wall -fPIC
PMUSRPATH = ./include
MNPATH = $(ROOTSYS)/include
#GSLPATH = /usr/include/gsl
INCLUDES = -I $(PMUSRPATH) -I $(MNPATH)
LD = g++
LDFLAGS = -g
endif
# -- Darwin
ifeq ($(OS),DARWIN)
CXX = g++
CXXFLAGS = -g -Wall -fPIC
INCLUDES = -I../include
LD = g++
LDFLAGS = -g
endif
# the output from the root-config script:
CXXFLAGS += $(ROOTCFLAGS)
LDFLAGS +=
# the ROOT libraries (G = graphic)
LIBS = $(ROOTLIBS) -lXMLParser
GLIBS = $(ROOTGLIBS) -lXMLParser
# PSI libs
PSILIBS = -lTLemRunHeader -lPMusr
# Minuit2 lib
MNLIB = -L$(ROOTSYS)/lib -lMinuit2
# MathMore lib
MMLIB = -L$(ROOTSYS)/lib -lMathMore
INSTALLPATH = $(HOME)/analysis/bin
EXEC = musrview
# some definitions: headers, sources, objects,...
OBJS =
OBJS += $(EXEC).o
# make the executable:
#
all: $(EXEC)
$(EXEC): $(OBJS)
@echo "---> Building $(EXEC) ..."
/bin/rm -f $(SHLIB)
$(LD) $(OBJS) -o $(EXEC) $(GLIBS) $(PSILIBS) $(MNLIB) $(MMLIB)
@echo "done"
# clean up: remove all object file (and core files)
# semicolon needed to tell make there is no source
# for this target!
#
clean:; @rm -f $(OBJS)
@echo "---> removing $(OBJS)"
#
$(OBJS): %.o: %.cpp
$(CXX) $(INCLUDES) $(CXXFLAGS) -c $<
install: all
@echo "copy $(EXEC) to $(INSTALLPATH)"
cp -p $(EXEC) $(INSTALLPATH)

View File

@ -4,48 +4,21 @@
# $Id$
#---------------------------------------------------------------------
The following programs are available:
To get it all build:
1) msr2msr
2) musrfit
1) go to the subdiretory 'classes' and execute
which will be described below (including build instructions).
*************
1) msr2msr
*************
The original msr-files used in WKM (wkmfit, wkmview, ...) do have some shortcomings, hence it was necessary to slightly change the file format of these msr-files and hence sacrify the backwards compatibility. In order to be able to use old wkm-files, msr2msr was written. This program takes an old msr-file and converts it to a new one. If a new msr-file is fed to msr2msr, the output will be just a mere copy of the file, and hence it doesn't harm. This means, whenever you are not sure if the given msr-file is a new or and old one, just execute msr2msr.
usage: msr2msr <msr-file-in> <msr-file-out> | [--help]
<msr-file-in> : input msr-file
<msr-file-out>: converted msr-output-file
Build Instructions:
-------------------
make -f Makefile.msr2msr
make -f Makefile.msr2msr install
*************
1) musrfit
*************
musrfit is the first program in a series to be written which will be a full replacement for the corresponding WKM programs, e.g. wkmfit -> musrfit, etc.
Build Instructions:
-------------------
In order to get musrfit compiled, you need first to build the shared library libPMusr.so. In order to do so, please follow the instruction given in the file classes/BUILD.
make -f Makefile.musrfit
make -f Makefile.musrfit install
If it doesn't work for linux, try to set first
export OSTYPE=linux
for some shells this is needed but I have no clue why it is NOT recognised automatically ...
make -f Makefile.PMusr
make -f Makefile.PMusr install (as root)
2) if the privous step worked execute in the current directory (in which
you found this README)
make clean
make
make install
In the optimal case, everything is setup ;-)
#---------------------------------------------------------------------
# this is the end ...