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

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

Initial import.

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