(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                      hallc2h.o
 29 jones 1.1 
 30           MYOS := $(subst -,,$(shell uname))
 31           CERNLIBS = -lgeant$(GEANTVER) -lpawlib -lgraflib -lgrafX11 -lpacklib -lmathlib
 32           
 33           ifeq ($(MYOS),HPUX)
 34             ifneq (,$(findstring 09,$(shell uname -r)))
 35               HPUXVERSION := 09
 36             else
 37               HPUXVERSION := 10
 38             endif
 39             LIBROOT = $(Csoft)/../$(MYOS)$(HPUXVERSION)/lib
 40           else
 41             LIBROOT = $(Csoft)/../$(MYOS)/lib
 42           endif
 43           
 44           ifeq ($(MYOS),HPUX)
 45             CERN_ROOT = /site/cernlib/hp700_ux90/96a
 46             FFLAGS=+U77 +ppu -C +e +es +FPVZOU -O +Onolimit -R8
 47             LDFLAGS=-Wl,-a archive
 48             OTHERLIBS = \
 49           	-Wl,-L$(CERN_ROOT)/lib -lpacklib $(CERNLIBS) \
 50 jones 1.1 	-Wl,-L/usr/lib/X11R5 -lX11 -lm
 51           endif
 52           
 53           
 54           ifeq ($(MYOS),ULTRIX)
 55             FFLAGS=-check_bounds
 56             LDFLAGS=
 57             OTHERLIBS = -L$(CERN_ROOT)/lib -lpacklib $(CERNLIBS)
 58           endif
 59           
 60           ifeq ($(MYOS),SunOS)
 61             CERN_ROOT = /site/cernlib/sun4_solaris2/97a
 62             FFLAGS=-g -e  -I$(Csoft)/SRC/INCLUDE 
 63             ifeq ($(OSTYPE),SunOS4)
 64               OTHERLIBS = -L$(CERN_ROOT)/lib $(CERNLIBS) -lnsl -lX11
 65             else
 66               OTHERLIBS = -L$(CERN_ROOT)/lib $(CERNLIBS) -lnsl -lsocket -lX11
 67             endif
 68           endif
 69           
 70           ifeq ($(MYOS),AIX)
 71 jones 1.1   F77=f77
 72             FFLAGS=-g -qfixed=132 -qextname -O -I$(Csoft)/SRC/INCLUDE
 73             OTHERLIBS = -L$(CERN_ROOT)/lib -lpacklib $(CERNLIBS) -lX11
 74           endif
 75           
 76           ifeq ($(MYOS),OSF1)
 77             F77=f77
 78             CERN_ROOT = /disk1/lib/cern/new
 79             LIBROOT = $(Csoft)/OSF1/lib
 80             FFLAGS= -r8 -extend_source -Wl,-taso -I -warn argument_checking \
 81                   -warn declarations -warn truncated_source -warn unused
 82             LDFLAGS= 
 83             OTHERLIBS = -Wl,-L$(CERN_ROOT)/lib \
 84                   -lpacklib $(CERNLIBS) -Wl,-L/usr/lib/X11R5 -lX11 -lm 
 85           endif
 86           
 87 jones 1.2 ifeq ($(MYOS),Linux)
 88             ifeq ($(LINUX_COMPILER),absoft)
 89               FABSFLAGS=-V -W -f -s -N1 -B108 -B100 -N90 -N22 -N2 -N113
 90               INCLUDES=-I$(Csoft)/SRC/INCLUDE
 91               EXTRAFLAGS=-DABSOFTFORTRAN
 92               FFLAGS=-O $(INCLUDES) $(FABSFLAGS) $(EXTRAFLAGS)
 93               FFLAG1=$(FFLAGS) -c
 94 jones 1.6     OTHERLIBS = -L$(CERN_ROOT)/lib $(CERNLIBS) -lV77 -lU77 -lg2c -lc -lm -lnsl
 95 jones 1.2     FC  := $(ABSOFT)/bin/f77
 96               F77 := $(ABSOFT)/bin/f77
 97             endif
 98             ifeq ($(LINUX_COMPILER),g77)
 99               FC=g77
100               F77=g77
101 jones 1.6     FFLAGS=-O6 -malign-double -fno-automatic -I. -ffixed-line-length-none -fno-second-underscore
102               OTHERLIBS=-L$(CERN_ROOT)/lib -lpacklib -lmathlib -lnss_nis -lnsl
103 jones 1.2   endif
104           endif
105           
106 jones 1.1 %.o: %.f
107           	$(F77) $(FFLAGS) -c $< -o $@
108           
109           mc_hms_single: $(my_objs) Makefile mc_hms_single.o
110           	$(F77) -o $@ $(FFLAGS) mc_hms_single.o $(my_objs) $(OTHERLIBS)
111           
112 jones 1.2 debug: $(my_objs) Makefile mc_hms_single.o
113           	$(F77) -g -o mc_hms_single $(FFLAGS) mc_hms_single.o $(my_objs) $(OTHERLIBS)
114           
115 jones 1.1 clean:
116 jones 1.2 	find . -name '*.o' -exec rm {} \;
117           	find . -name '*.d' -exec rm {} \;
118           	rm -f mc_hms_single debug
119           
120           #the rule below updates a file, Makefile.dep, that lists which include files
121           #each fortran file uses.  If an include file is changed, all the fortran files
122           #that use it will automatically be recompiled.   p.mckee dec03
123           Makefile.dep : *.inc gen_constants.par
124           	@ echo "Updating dependencies on include files"
125           	@ echo -e "#specify include files used by each .f file\n" > Makefile.dep
126           	@ for file in `ls *.f | sed 's/\.f//'` ; do\
127                       inc_files=`cat $$file.f | sed -n 's/^[[:blank:]]*[Ii][Nn][Cc][Ll][Uu][Dd][Ee][ ]*['\''"]\(.*\)['\''"]/\1/p' | sort | uniq | xargs echo -n` ;\
128                       if [ -n "$$inc_files" ]; then \
129                         echo "$$file.o : $$file.f $$inc_files" >> Makefile.dep;\
130                       fi;\
131                     done
132           
133           include Makefile.dep

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