source: ZHANGProjects/ICOSIM/CPP/trunk/source/makefile @ 17

Last change on this file since 17 was 15, checked in by zhangj, 10 years ago

(1) Modify the bug to connect to the Fortran files. (2) Fix the bug of the definition type of the random functions used in Fortran file crystal_dan_FINAL....f.

File size: 4.0 KB
Line 
1CC = g++ -O3 -funroll-loops -g
2#CC = g++ -g
3F77 = gfortran -g
4
5
6OBJS_A = Particle.o testParticle.o
7OBJS_B = lattice.o testLattice.o Particle.o Element.o Collimator.o StandardCollimator.o FlukaCollimator.o MagneticCollimator.o CrystalCollimator.o crystal.o partcrys.o simcrys.o
8OBJS_C = Element.o testElement.o
9OBJS_D = testCollimator.o StandardCollimator.o Collimator.o Element.o Particle.o FlukaCollimator.o MagneticCollimator.o CrystalCollimator.o crystal.o partcrys.o simcrys.o
10OBJS_E = simulation.o icosim++.o Particle.o lattice.o Element.o Collimator.o StandardCollimator.o FlukaCollimator.o MagneticCollimator.o CrystalCollimator.o crystal.o partcrys.o simcrys.o crystal_dan_FINAL_VERSION_CHvsVR.o crystalprotonfuns.o
11
12OBJS_F = debug.o Element.o Particle.o Collimator.o MagneticCollimator.o
13DEBUG = -g
14# Feel free to fix the errors that appear enabling the Wall flag
15#CFLAGS = -c -Wall
16CFLAGS = -c
17#FFLAGS=-c  -ffixed-line-length-none
18 FFLAGS=-c 
19
20LIB = -lm -lgfortran
21LIB_A =
22ifeq ($(FLUKA),yes)
23        FLUKAIOlib =
24        LIB += $(FLUKAIOlib)/lib/libFlukaIO.a
25        LIB_A += -lFlukaIO
26        LFLAGS = -L$(FLUKAIOlib)/lib
27        INCLUDE = -I $(FLUKAIOlib)/include
28        CFLAGS += -DFLUKA
29endif
30
31#all: testParticle testLattice icosim++ testElement testCollimator debug twiss_optics
32
33all:  icosim++
34
35partial: icosim++ twiss_optics
36
37testParticle: $(OBJS_A)
38        $(CC) $(OBJS_A) -o testParticle
39testLattice: $(OBJS_B)
40        $(CC) $(OBJS_B) $(LIB) -o testLattice $(INCLUDE)
41testElement: $(OBJS_C)
42        $(CC) $(OBJS_C) -o testElement
43testCollimator: $(OBJS_D)
44        $(CC) $(LFLAGS) $(OBJS_D) -o testCollimator $(INCLUDE) $(LIB)
45
46#icosim++: $(OBJS_E) crystalproton.h crystalprotonfuns.h
47
48icosim++: $(OBJS_E) 
49        $(CC) $(LFLAGS) $(OBJS_E) -o icosim++ $(INCLUDE) $(LIB) 
50debug: $(OBJS_F)
51        $(CC) $(OBJS_F) -o debug
52twiss_optics: twiss_optics.cc
53        $(CC) twiss_optics.cc -o twiss_optics
54
55
56testParticle.o: testParticle.cc Particle.h
57        $(CC) $(CFLAGS) testParticle.cc
58testLattice.o: testLattice.cc lattice.h
59        $(CC) $(INCLUDE) $(CFLAGS) testLattice.cc
60testElement.o: testElement.cc Element.h
61        $(CC) $(CFLAGS) testElement.cc
62testCollimator.o: testCollimator.cc StandardCollimator.h FlukaCollimator.h MagneticCollimator.h Particle.h
63        $(CC) $(INCLUDE) $(CFLAGS) testCollimator.cc
64Particle.o: Particle.cc Particle.h
65        $(CC) $(CFLAGS) Particle.cc
66Element.o: Element.cc Element.h
67        $(CC) $(CFLAGS) Element.cc
68Collimator.o: Collimator.cc Collimator.h Element.h
69        $(CC) $(INCLUDE) $(CFLAGS) Collimator.cc
70StandardCollimator.o: StandardCollimator.h StandardCollimator.cc Collimator.h
71        $(CC) $(INCLUDE) $(CFLAGS) StandardCollimator.cc
72FlukaCollimator.o: FlukaCollimator.h FlukaCollimator.cc Collimator.h
73        $(CC) $(INCLUDE) $(CFLAGS) FlukaCollimator.cc
74MagneticCollimator.o: MagneticCollimator.h MagneticCollimator.cc Collimator.h
75        $(CC) $(INCLUDE) $(CFLAGS) MagneticCollimator.cc
76crystal.o: crystal.cc crystal.h
77        $(CC) $(CFLAGS) crystal.cc
78partcrys.o: partcrys.cc partcrys.h crystal.h
79        $(CC) $(CFLAGS) partcrys.cc
80
81crystalprotonfuns.o: crystalprotonfuns.f
82        $(F77) $(FFLAGS) crystalprotonfuns.f
83
84crystal_dan_FINAL_VERSION_CHvsVR.o: crystal_dan_FINAL_VERSION_CHvsVR.f
85        $(F77) $(FFLAGS) crystal_dan_FINAL_VERSION_CHvsVR.f
86
87simcrys.o: simcrys.cc simcrys.h partcrys.h crystal_dan_FINAL_VERSION_CHvsVR.o crystalprotonfuns.o
88        $(CC) $(CFLAGS) simcrys.cc
89CrystalCollimator.o: CrystalCollimator.h CrystalCollimator.cc Collimator.h simcrys.h
90        $(CC) $(INCLUDE) $(CFLAGS) CrystalCollimator.cc
91simulation.o: simulation.cc simulation.h lattice.h
92        $(CC) $(INCLUDE) $(CFLAGS) simulation.cc
93
94lattice.o: lattice.cc lattice.h
95        $(CC) $(INCLUDE) $(CFLAGS) lattice.cc
96icosim++.o: simulation.h
97        $(CC) $(INCLUDE) $(CFLAGS) icosim++.cc
98debug.o: Collimator.h debug.cc
99        $(CC) $(INCLUDE) $(CFLAGS) debug.cc
100
101simulation.h: lattice.h
102lattice.h: StandardCollimator.h FlukaCollimator.h MagneticCollimator.h
103StandardCollimator.h: Collimator.h
104FlukaCollimator.h: Collimator.h
105MagneticCollimator.h: Collimator.h
106CrystalCollimator.h: Collimator.h
107Collimator.h: Element.h Particle.h
108
109
110clean:
111        rm -rf *.o testParticle testLattice icosim++ testElement testCollimator debug twiss_optics
112
Note: See TracBrowser for help on using the repository browser.