1 | # Makefile for simulation |
---|
2 | # $Id: GNUmakefile 2999 2011-10-27 07:13:24Z naumov $ |
---|
3 | # D. De Marco created Jan, 23 2002 |
---|
4 | # |
---|
5 | |
---|
6 | ifndef ESAFINSTALL |
---|
7 | ESAFINSTALL = ../.. |
---|
8 | endif |
---|
9 | |
---|
10 | include $(ESAFINSTALL)/packages/config.gmk |
---|
11 | include $(ESAFINSTALL)/packages/g4libs.gmk |
---|
12 | include $(ESAFINSTALL)/packages/vgmlibs.gmk |
---|
13 | |
---|
14 | |
---|
15 | SUBDIRS = tools detector generators lightsources radiativetransfer lighttoeuso externals framework ../common |
---|
16 | |
---|
17 | # this sequence does not link |
---|
18 | #libs = base lowtran atmosphere SimuEvent genbase showers lightsources tools optics radiativetransfer lighttoeuso simuframework electronics dettools cfortran |
---|
19 | |
---|
20 | # this sequence does link |
---|
21 | libs = simuframework base SimuEvent lighttoeuso showers genbase atmosphere lightsources tools cfortran lowtran radiativetransfer optics electronics dettools |
---|
22 | |
---|
23 | ifeq ($(USE_GUI),1) |
---|
24 | libs += gui |
---|
25 | CXXFLAGS += -I$(ESAFINSTALL)/packages/common/gui/include/ |
---|
26 | endif |
---|
27 | |
---|
28 | ifdef G4INSTALL |
---|
29 | libs += G4fresnellens G4Detector |
---|
30 | endif |
---|
31 | |
---|
32 | ifdef USE_SLAST77 |
---|
33 | libs += slast |
---|
34 | endif |
---|
35 | |
---|
36 | libraries = $(patsubst %,-l$(LIBPREFIX)%,$(libs)) |
---|
37 | libdep = $(patsubst %,$(LIBDIR)/lib$(LIBPREFIX)%.so,$(libs)) |
---|
38 | |
---|
39 | CXXFLAGS += -I$(ESAFINSTALL)/packages/common/base/include/ |
---|
40 | CXXFLAGS += -I$(ESAFINSTALL)/packages/common/root/include/ |
---|
41 | |
---|
42 | CXXFLAGS += -I$(ESAFINSTALL)/packages/simulation/framework/include |
---|
43 | ifdef G4INSTALL |
---|
44 | CXXFLAGS += -I$(ESAFINSTALL)/packages/simulation/detector/G4Detector/optics/include/ |
---|
45 | CXXFLAGS += -I$(ESAFINSTALL)/packages/simulation/detector/G4Detector/G4fresnellens/include/ |
---|
46 | CXXFLAGS += -I$(CLHEP_INCLUDE_DIR) |
---|
47 | endif |
---|
48 | |
---|
49 | .PHONY: all includes clean obj lib tags doc |
---|
50 | |
---|
51 | all: lib $(SIMUTARGET) |
---|
52 | |
---|
53 | $(SIMUTARGET): $(libdep) simu_main.cc |
---|
54 | $(CXX) $(CXXFLAGS) simu_main.cc -L$(LIBDIR) $(libraries) $(LDFLAGS) $(libraries) $(G4LIBS) $(VGMLIBS) -o $(SIMUTARGET) |
---|
55 | # $(CXX) $(CXXFLAGS) simu_main.cc -L$(LIBDIR) $(LDFLAGS) -Wl,--start-group $(libraries) -Wl,--end-group $(G4LIBS) $(VGMLIBS) -o $(SIMUTARGET) |
---|
56 | lib includes clean cleandict obj tags doc: |
---|
57 | @for dir in $(SUBDIRS); do (cd $$dir && $(MAKE) $@); done; |
---|