(file) Return to Makefile CVS log (file) (dir) Up to [HallC] / pol_hms_single

  1 jones 1.1 ## This makefile must be executed with gmake (gnu make).
  2           
  3 jones 1.2 #set to g77 or absoft to choose a compiler under linux
  4           LINUX_COMPILER=g77
  5 jones 1.6 #LINUX_COMPILER=absoft
  6 jones 1.2 
  7 jones 1.1 simcdir = .
  8 jones 1.4 #CERN_ROOT = /site/cernlib/pc_linux/99
  9 jones 1.2 #CERN_ROOT = /cern/pro
 10 jones 1.6 #export ABSOFT=/apps/absoft/PRO/usr/absoft
 11           CERN_ROOT=/site/cernlib/i386_rhel3/2003
 12 jones 1.1 
 13           RM        = rm -f 
 14           SHELL     = /bin/sh
 15           
 16           SPEC      = ./hms/
 17           
 18           SHARE	  = ./shared/
 19           
 20 jones 1.4 my_objs = $(SPEC)mc_hms.o     $(SPEC)mc_hms_hut.o  $(SPEC)mc_hms_recon.o \
 21 jones 1.2 	   project.o           rotate_haxis.o      check_dipole.o        \
 22           	   transp.o            musc.o              musc_ext.o            \
 23           	   stringlib.o         ranecu.o            loren.o               \
 24           	   locforunt.o         gauss1.o            mt19937.o             \
 25 jones 1.5 	   trg_track.o         hms_track.o           \
 26 jones 1.7 	   qfs_new12_sub.o      init.o                \
 27 jones 1.3 	   brem.o              radc.o              hcf2r.o	\
 28 jones 1.9            hallc2h.o enerloss_new.o engine_eloss.o
 29 jones 1.1 
 30 jones 1.8 my_dobjs = $(SPEC)mc_hms.do     $(SPEC)mc_hms_hut.do  $(SPEC)mc_hms_recon.do \
 31           	   project.do           rotate_haxis.do      check_dipole.do        \
 32           	   transp.do            musc.do              musc_ext.do            \
 33           	   stringlib.do         ranecu.do            loren.do               \
 34           	   locforunt.do         gauss1.do            mt19937.do             \
 35           	   trg_track.do         hms_track.do           \
 36           	   qfs_new12_sub.do      init.do                \
 37           	   brem.do              radc.do              hcf2r.do	\
 38 jones 1.9            hallc2h.do enerloss_new.do engine_eloss.do
 39 jones 1.8 
 40 jones 1.1 MYOS := $(subst -,,$(shell uname))
 41           CERNLIBS = -lgeant$(GEANTVER) -lpawlib -lgraflib -lgrafX11 -lpacklib -lmathlib
 42           
 43           ifeq ($(MYOS),HPUX)
 44             ifneq (,$(findstring 09,$(shell uname -r)))
 45               HPUXVERSION := 09
 46             else
 47               HPUXVERSION := 10
 48             endif
 49             LIBROOT = $(Csoft)/../$(MYOS)$(HPUXVERSION)/lib
 50           else
 51             LIBROOT = $(Csoft)/../$(MYOS)/lib
 52           endif
 53           
 54           ifeq ($(MYOS),HPUX)
 55             CERN_ROOT = /site/cernlib/hp700_ux90/96a
 56             FFLAGS=+U77 +ppu -C +e +es +FPVZOU -O +Onolimit -R8
 57             LDFLAGS=-Wl,-a archive
 58             OTHERLIBS = \
 59           	-Wl,-L$(CERN_ROOT)/lib -lpacklib $(CERNLIBS) \
 60           	-Wl,-L/usr/lib/X11R5 -lX11 -lm
 61 jones 1.1 endif
 62           
 63           
 64           ifeq ($(MYOS),ULTRIX)
 65             FFLAGS=-check_bounds
 66             LDFLAGS=
 67             OTHERLIBS = -L$(CERN_ROOT)/lib -lpacklib $(CERNLIBS)
 68           endif
 69           
 70           ifeq ($(MYOS),SunOS)
 71             CERN_ROOT = /site/cernlib/sun4_solaris2/97a
 72             FFLAGS=-g -e  -I$(Csoft)/SRC/INCLUDE 
 73             ifeq ($(OSTYPE),SunOS4)
 74               OTHERLIBS = -L$(CERN_ROOT)/lib $(CERNLIBS) -lnsl -lX11
 75             else
 76               OTHERLIBS = -L$(CERN_ROOT)/lib $(CERNLIBS) -lnsl -lsocket -lX11
 77             endif
 78           endif
 79           
 80           ifeq ($(MYOS),AIX)
 81             F77=f77
 82 jones 1.1   FFLAGS=-g -qfixed=132 -qextname -O -I$(Csoft)/SRC/INCLUDE
 83             OTHERLIBS = -L$(CERN_ROOT)/lib -lpacklib $(CERNLIBS) -lX11
 84           endif
 85           
 86           ifeq ($(MYOS),OSF1)
 87             F77=f77
 88             CERN_ROOT = /disk1/lib/cern/new
 89             LIBROOT = $(Csoft)/OSF1/lib
 90             FFLAGS= -r8 -extend_source -Wl,-taso -I -warn argument_checking \
 91                   -warn declarations -warn truncated_source -warn unused
 92             LDFLAGS= 
 93             OTHERLIBS = -Wl,-L$(CERN_ROOT)/lib \
 94                   -lpacklib $(CERNLIBS) -Wl,-L/usr/lib/X11R5 -lX11 -lm 
 95           endif
 96           
 97 jones 1.2 ifeq ($(MYOS),Linux)
 98             ifeq ($(LINUX_COMPILER),absoft)
 99               FABSFLAGS=-V -W -f -s -N1 -B108 -B100 -N90 -N22 -N2 -N113
100               INCLUDES=-I$(Csoft)/SRC/INCLUDE
101               EXTRAFLAGS=-DABSOFTFORTRAN
102               FFLAGS=-O $(INCLUDES) $(FABSFLAGS) $(EXTRAFLAGS)
103               FFLAG1=$(FFLAGS) -c
104 jones 1.6     OTHERLIBS = -L$(CERN_ROOT)/lib $(CERNLIBS) -lV77 -lU77 -lg2c -lc -lm -lnsl
105 jones 1.2     FC  := $(ABSOFT)/bin/f77
106               F77 := $(ABSOFT)/bin/f77
107             endif
108             ifeq ($(LINUX_COMPILER),g77)
109               FC=g77
110               F77=g77
111 jones 1.6     OTHERLIBS=-L$(CERN_ROOT)/lib -lpacklib -lmathlib -lnss_nis -lnsl
112 jones 1.8     FFLAGSO=-O1 -malign-double -fno-automatic -I. -ffixed-line-length-none -fno-second-underscore
113               FFLAGSD=-g -malign-double -fno-automatic -I. -ffixed-line-length-none -fno-second-underscore
114 jones 1.2   endif
115           endif
116           
117 jones 1.1 %.o: %.f
118 jones 1.8 	$(F77) $(FFLAGSO) -c $< -o $@
119           %.do: %.f
120           	$(F77) $(FFLAGSD) -c $< -o $*.do
121 jones 1.1 
122           mc_hms_single: $(my_objs) Makefile mc_hms_single.o
123 jones 1.8 	$(F77) -o $@ $(FFLAGSO) mc_hms_single.o $(my_objs) $(OTHERLIBS)
124 jones 1.1 
125 jones 1.8 debug: $(my_dobjs) Makefile mc_hms_single.do
126           	$(F77) -o mc_hms_single_dbg $(FFLAGSD) mc_hms_single.do $(my_dobjs) $(OTHERLIBS)
127 jones 1.2 
128 jones 1.1 clean:
129 jones 1.2 	find . -name '*.o' -exec rm {} \;
130 jones 1.8 	find . -name '*.do' -exec rm {} \;
131           	rm -f mc_hms_single mc_hms_single_dbg
132 jones 1.2 
133           #the rule below updates a file, Makefile.dep, that lists which include files
134           #each fortran file uses.  If an include file is changed, all the fortran files
135           #that use it will automatically be recompiled.   p.mckee dec03
136           Makefile.dep : *.inc gen_constants.par
137           	@ echo "Updating dependencies on include files"
138           	@ echo -e "#specify include files used by each .f file\n" > Makefile.dep
139           	@ for file in `ls *.f | sed 's/\.f//'` ; do\
140                       inc_files=`cat $$file.f | sed -n 's/^[[:blank:]]*[Ii][Nn][Cc][Ll][Uu][Dd][Ee][ ]*['\''"]\(.*\)['\''"]/\1/p' | sort | uniq | xargs echo -n` ;\
141                       if [ -n "$$inc_files" ]; then \
142                         echo "$$file.o : $$file.f $$inc_files" >> Makefile.dep;\
143 jones 1.8               echo "$$file.do : $$file.f $$inc_files" >> Makefile.dep;\
144 jones 1.2             fi;\
145                     done
146           
147           include Makefile.dep

Analyzer/Replay: Mark Jones, Documents: Stephen Wood
Powered by
ViewCVS 0.9.2-cvsgraph-1.4.0