version 1.5, 2004/02/26 22:05:17
|
version 1.9, 2005/03/18 15:15:03
|
|
|
| |
#set to g77 or absoft to choose a compiler under linux | #set to g77 or absoft to choose a compiler under linux |
LINUX_COMPILER=g77 | LINUX_COMPILER=g77 |
|
#LINUX_COMPILER=absoft |
| |
simcdir = . | simcdir = . |
#CERN_ROOT = /site/cernlib/pc_linux/99 | #CERN_ROOT = /site/cernlib/pc_linux/99 |
#CERN_ROOT = /cern/pro | #CERN_ROOT = /cern/pro |
export ABSOFT=/apps/absoft/PRO/usr/absoft |
#export ABSOFT=/apps/absoft/PRO/usr/absoft |
|
CERN_ROOT=/site/cernlib/i386_rhel3/2003 |
| |
RM = rm -f | RM = rm -f |
SHELL = /bin/sh | SHELL = /bin/sh |
|
|
stringlib.o ranecu.o loren.o \ | stringlib.o ranecu.o loren.o \ |
locforunt.o gauss1.o mt19937.o \ | locforunt.o gauss1.o mt19937.o \ |
trg_track.o hms_track.o \ | trg_track.o hms_track.o \ |
qfs_new11_sub.o init.o \ |
qfs_new12_sub.o init.o \ |
brem.o radc.o hcf2r.o \ | brem.o radc.o hcf2r.o \ |
hallc2h.o |
hallc2h.o enerloss_new.o engine_eloss.o |
|
|
|
my_dobjs = $(SPEC)mc_hms.do $(SPEC)mc_hms_hut.do $(SPEC)mc_hms_recon.do \ |
|
project.do rotate_haxis.do check_dipole.do \ |
|
transp.do musc.do musc_ext.do \ |
|
stringlib.do ranecu.do loren.do \ |
|
locforunt.do gauss1.do mt19937.do \ |
|
trg_track.do hms_track.do \ |
|
qfs_new12_sub.do init.do \ |
|
brem.do radc.do hcf2r.do \ |
|
hallc2h.do enerloss_new.do engine_eloss.do |
| |
MYOS := $(subst -,,$(shell uname)) | MYOS := $(subst -,,$(shell uname)) |
CERNLIBS = -lgeant$(GEANTVER) -lpawlib -lgraflib -lgrafX11 -lpacklib -lmathlib | CERNLIBS = -lgeant$(GEANTVER) -lpawlib -lgraflib -lgrafX11 -lpacklib -lmathlib |
|
|
EXTRAFLAGS=-DABSOFTFORTRAN | EXTRAFLAGS=-DABSOFTFORTRAN |
FFLAGS=-O $(INCLUDES) $(FABSFLAGS) $(EXTRAFLAGS) | FFLAGS=-O $(INCLUDES) $(FABSFLAGS) $(EXTRAFLAGS) |
FFLAG1=$(FFLAGS) -c | FFLAG1=$(FFLAGS) -c |
OTHERLIBS = -L$(CERN_ROOT)/lib $(CERNLIBS) -lV77 -lU77 -lg2c -lc -lm |
OTHERLIBS = -L$(CERN_ROOT)/lib $(CERNLIBS) -lV77 -lU77 -lg2c -lc -lm -lnsl |
FC := $(ABSOFT)/bin/f77 | FC := $(ABSOFT)/bin/f77 |
F77 := $(ABSOFT)/bin/f77 | F77 := $(ABSOFT)/bin/f77 |
endif | endif |
ifeq ($(LINUX_COMPILER),g77) | ifeq ($(LINUX_COMPILER),g77) |
FC=g77 | FC=g77 |
F77=g77 | F77=g77 |
FFLAGS=-O6 -I. -ffixed-line-length-none |
OTHERLIBS=-L$(CERN_ROOT)/lib -lpacklib -lmathlib -lnss_nis -lnsl |
OTHERLIBS=-L$(CERN_ROOT)/lib -lpacklib -lmathlib -lnss_nis |
FFLAGSO=-O1 -malign-double -fno-automatic -I. -ffixed-line-length-none -fno-second-underscore |
|
FFLAGSD=-g -malign-double -fno-automatic -I. -ffixed-line-length-none -fno-second-underscore |
endif | endif |
endif | endif |
| |
%.o: %.f | %.o: %.f |
$(F77) $(FFLAGS) -c $< -o $@ |
$(F77) $(FFLAGSO) -c $< -o $@ |
|
%.do: %.f |
|
$(F77) $(FFLAGSD) -c $< -o $*.do |
| |
mc_hms_single: $(my_objs) Makefile mc_hms_single.o | mc_hms_single: $(my_objs) Makefile mc_hms_single.o |
$(F77) -o $@ $(FFLAGS) mc_hms_single.o $(my_objs) $(OTHERLIBS) |
$(F77) -o $@ $(FFLAGSO) mc_hms_single.o $(my_objs) $(OTHERLIBS) |
| |
debug: $(my_objs) Makefile mc_hms_single.o |
debug: $(my_dobjs) Makefile mc_hms_single.do |
$(F77) -g -o mc_hms_single $(FFLAGS) mc_hms_single.o $(my_objs) $(OTHERLIBS) |
$(F77) -o mc_hms_single_dbg $(FFLAGSD) mc_hms_single.do $(my_dobjs) $(OTHERLIBS) |
| |
clean: | clean: |
find . -name '*.o' -exec rm {} \; | find . -name '*.o' -exec rm {} \; |
find . -name '*.d' -exec rm {} \; |
find . -name '*.do' -exec rm {} \; |
rm -f mc_hms_single debug |
rm -f mc_hms_single mc_hms_single_dbg |
| |
#the rule below updates a file, Makefile.dep, that lists which include files | #the rule below updates a file, Makefile.dep, that lists which include files |
#each fortran file uses. If an include file is changed, all the fortran files | #each fortran file uses. If an include file is changed, all the fortran files |
|
|
inc_files=`cat $$file.f | sed -n 's/^[[:blank:]]*[Ii][Nn][Cc][Ll][Uu][Dd][Ee][ ]*['\''"]\(.*\)['\''"]/\1/p' | sort | uniq | xargs echo -n` ;\ | inc_files=`cat $$file.f | sed -n 's/^[[:blank:]]*[Ii][Nn][Cc][Ll][Uu][Dd][Ee][ ]*['\''"]\(.*\)['\''"]/\1/p' | sort | uniq | xargs echo -n` ;\ |
if [ -n "$$inc_files" ]; then \ | if [ -n "$$inc_files" ]; then \ |
echo "$$file.o : $$file.f $$inc_files" >> Makefile.dep;\ | echo "$$file.o : $$file.f $$inc_files" >> Makefile.dep;\ |
|
echo "$$file.do : $$file.f $$inc_files" >> Makefile.dep;\ |
fi;\ | fi;\ |
done | done |
| |