1 gaskelld 1.1 ## This makefile must be executed with gmake (gnu make).
2
3 ## These will have to be modified when setting up your own simc. They
4 ## point to the software necessary to run simc.
5
6 ## ARGONNE DEFAULT SETUP FLAGS:
7 #simcdir = .
8 #Csoft = /disk1/users/reinhold/Csoft/05Dec1996
9
10 ## CEBAF DEFAULT SETUP FLAGS:
11 simcdir = .
12 #Csoft = /group/hallc/Csoft/Analyzer
13 #Csoft = /group/c-gep/jones/Linux_fc8/
14
15 ## U Regina SETUP FLAGS
16 #simcdir = .
17 #Csoft = /home/huberg/r2d2/simc/
18
19 ## THE REST SHOULD BE OK WITHOUT MODIFICATION.
20
21 ## This tells make not to delete these target files on error/interrupt (see man page)
22 gaskelld 1.1 .PRECIOUS: *.o sos/*.o hms/*.o hrsl/*.o hrsr/*.o shms/*.o calo/*.o
23
24 RM = rm -f
25 SHELL = /bin/sh
26 S = $(simcdir)/sos/
27 H = $(simcdir)/hms/
28 L = $(simcdir)/hrsl/
29 R = $(simcdir)/hrsr/
30 A = $(simcdir)/shared/
31 SH = $(simcdir)/shms/
32 T = $(simcdir)/cteq5/
33 C = $(simcdir)/calo/
34
35 OBJ1 = target.o brem.o gauss1.o NtupleInit.o NtupleClose.o enerloss_new.o
36 OBJ2 = radc.o init.o dbase.o physics_kaon.o physics_pion.o physics_delta.o physics_proton.o loren.o sf_lookup.o
37 OBJ3 = semi_physics.o rho_physics.o rho_decay.o generate_rho.o trg_track.o semi_dilution.o
38 OBJ4 = results_write.o event.o mt19937.o jacobians.o
39 OBJ5 = $(A)musc.o $(A)musc_ext.o $(A)project.o $(A)transp.o
|
40 jones 1.6 OBJ6 = $(A)rotate_haxis.o $(A)rotate_vaxis.o $(A)locforunt.o
|
41 gaskelld 1.1 OBJ7 = $(H)mc_hms.o $(H)mc_hms_hut.o $(H)mc_hms_recon.o
42 OBJ8 = $(S)mc_sos.o $(S)mc_sos_hut.o $(S)mc_sos_recon.o
43 OBJ9 = $(R)mc_hrsr.o $(R)mc_hrsr_hut.o $(R)mc_hrsr_recon.o
44 OBJA = $(L)mc_hrsl.o $(L)mc_hrsl_hut.o $(L)mc_hrsl_recon.o
45 OBJB = $(SH)mc_shms.o $(SH)mc_shms_hut.o $(SH)mc_shms_recon.o
46 OBJC = $(T)Ctq5Pdf.o
47 OBJD = $(C)mc_calo.o $(C)mc_calo_recon.o
48 my_objs = $(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4) $(OBJ5) $(OBJ6) $(OBJ7) $(OBJ8) $(OBJ9) $(OBJA) $(OBJB) $(OBJC) $(OBJD)
49
50 MYOS := $(subst -,,$(shell uname))
51 CERNLIBS = -lgeant$(GEANTVER) -lpawlib -lgraflib -lgrafX11 -lpacklib -lmathlib
52
53 #For use with gfortran compiler
54 # -fno-automatic - all program storage treated as static
55 ifeq ($(MYOS),Linux)
56 LIBROOT = CTP/O.Linux/Linux/lib
|
57 gaskelld 1.4 # JLab
|
58 jones 1.5 # CERN_ROOT = /apps/cernlib/i386_fc8/2005
|
59 gaskelld 1.4 # 32 bit, standard Fedora distributuion
60 # CERN_ROOT = /usr/lib/cernlib/2006
61 # 64 bit, standard Fedora distributuion
62 # CERN_ROOT = /usr/lib64/cernlib/2006
|
63 gaskelld 1.1 FFLAGSA=-O -W -ffixed-line-length-132 -ff2c -fno-automatic -fdefault-real-8
64 INCLUDES=-I.
65 FFLAGS= $(INCLUDES) $(FFLAGSA)
66 FFLAG1=$(FFLAGS) -c
67 OTHERLIBS = -L$(LIBROOT) -lctp \
68 -L$(CERN_ROOT)/lib $(CERNLIBS) -L/usr/lib
69 FC := gfortran
70 F77 := gfortran
71 endif
72
|
73 gaskelld 1.2 # Mac OSX, Leopard (checked on version 10.5.6)
74 # Tested using patched gfortran compiler from www-jlc.kek.jp/~fujiik/macosx/10.5.X/HEPonX
75 # I had trouble compiling geant stuff using the deafult gfortran that shipped with
76 # my version of Leopard - YMMV (your mileage may vary)
77 # Only change needed was to add the -fno-range-check flag: there was some problem
78 # with the default integer size, specifically in mt19937.f.
79 # Note that the CTP libraries still end up in the O.Linux directory...
80 ifeq ($(MYOS),Darwin)
81 LIBROOT = CTP/O.Linux/Linux/lib
82 CERN_ROOT = /apps/cernlib/i386_fc8/2005
|
83 gaskelld 1.3 FFLAGSA=-O -W -ffixed-line-length-132 -ff2c -fno-automatic -fdefault-real-8
|
84 gaskelld 1.2 INCLUDES=-I.
85 FFLAGS= $(INCLUDES) $(FFLAGSA)
86 FFLAG1=$(FFLAGS) -c
87 OTHERLIBS = -L$(LIBROOT) -lctp \
88 -L$(CERN_ROOT)/lib $(CERNLIBS) -L/usr/lib
89 FC := gfortran
90 F77 := gfortran
91 endif
92
|
93 gaskelld 1.1 %.o: %.f
94 $(F77) $(FFLAGS) -c $< -o $@
95
96 $(S)/%.o: $(S)/%.f
97 $(F77) $(FFLAGS) -c $< -o $@
98
99 $(H)/%.o: $(H)/%.f
100 $(F77) $(FFLAGS) -c $< -o $@
101
102 $(L)/%.o: $(L)/%.f
103 $(F77) $(FFLAGS) -c $< -o $@
104
105 $(R)/%.o: $(R)/%.f
106 $(F77) $(FFLAGS) -c $< -o $@
107
108 $(SH)/%.o: $(SH)/%.f
109 $(F77) $(FFLAGS) -c $< -o $@
110
111 none: simc
112
113 all: simc
114 gaskelld 1.1
115 simc: simc.o $(my_objs) Makefile CTP/O.Linux/Linux/lib/libctp.a
116 $(F77) $(OSF_SHARED) -o $@ $(FFLAGS) $(my_objs) simc.o $(OTHERLIBS)
117
118 CTP/O.Linux/Linux/lib/libctp.a:
119 make -C CTP
120 # These routines have HP problems, and need to be compiled without optimization.
121
122 #simc.o: simc.f
123 # $(F77) $(FFLAG1) simc.f
124 #
125 #init.o: init.f
126 # $(F77) $(FFLAG1) init.f
127 #
128 #event.o: event.f
129 # $(F77) $(FFLAG1) event.f
130 #
131 #dbase.o: dbase.f
132 # $(F77) $(FFLAG1) dbase.f
133 #
134 #physics.o: physics.f
135 gaskelld 1.1 # $(F77) $(FFLAG1) physics.f
136 #
137 #results_write.o: results_write.f
138 # $(F77) $(FFLAG1) results_write.f
139
140
141 clean:
142 $(RM) *.o $(H)*.o $(S)*.o $(L)*.o $(R)*.o $(SH)*.o $(A)*.o $(T)*.o $(C)*.o simc
143
144 real_clean:
145 $(RM) *.o $(H)*.o $(S)*.o $(L)*.o $(R)*.o $(SH)*.o $(A)*.o $(T)*.o $(C)*.o simc
146 rm -r CTP/O.$(MYOS)
|