1 | ##################################################################
|
---|
2 | #
|
---|
3 | # makefile
|
---|
4 | #
|
---|
5 | # for the MARS software
|
---|
6 | #
|
---|
7 | ##################################################################
|
---|
8 | # @maintitle
|
---|
9 |
|
---|
10 | # @code
|
---|
11 |
|
---|
12 | #
|
---|
13 | # please change all system depend values in the
|
---|
14 | # config.mk.${OSTYPE} file
|
---|
15 | #
|
---|
16 | #
|
---|
17 |
|
---|
18 | include Makefile.conf.general
|
---|
19 | include Makefile.conf.$(OSTYPE)
|
---|
20 |
|
---|
21 | #
|
---|
22 | #PROGRAMS = readraw merpp mars test mona status
|
---|
23 | PROGRAMS := readdaq readraw readcorsika ceres merpp callisto star ganymed sponde showlog showplot mars mars-config
|
---|
24 | SOLIB := libmars.so
|
---|
25 |
|
---|
26 | CINT = M
|
---|
27 |
|
---|
28 | #
|
---|
29 | # connect the include files defined in the config.mk file
|
---|
30 | #
|
---|
31 | # WARNING: the result (whether the linkage works or not) depends on the
|
---|
32 | # order of the libraries. It seems, that the most base library
|
---|
33 | # must be the last one
|
---|
34 | #
|
---|
35 |
|
---|
36 | #
|
---|
37 | # ----->>> mars libraries
|
---|
38 | #
|
---|
39 | SUBDIRS := mbase \
|
---|
40 | mastro \
|
---|
41 | mmain \
|
---|
42 | mcorsika \
|
---|
43 | mdrs \
|
---|
44 | mfbase \
|
---|
45 | mfilter \
|
---|
46 | mdata \
|
---|
47 | mhbase \
|
---|
48 | mhvstime \
|
---|
49 | mhist \
|
---|
50 | manalysis \
|
---|
51 | mextralgo \
|
---|
52 | msignal \
|
---|
53 | mbadpixels \
|
---|
54 | mhcalib \
|
---|
55 | mhflux \
|
---|
56 | mcalib \
|
---|
57 | mpedestal \
|
---|
58 | mfileio \
|
---|
59 | mgeom \
|
---|
60 | melectronics \
|
---|
61 | msim \
|
---|
62 | msimreflector \
|
---|
63 | msimcamera \
|
---|
64 | msql \
|
---|
65 | mimage \
|
---|
66 | mhft \
|
---|
67 | mmc \
|
---|
68 | mraw \
|
---|
69 | mcamera \
|
---|
70 | mtrigger \
|
---|
71 | mpointing \
|
---|
72 | mreport \
|
---|
73 | mgui \
|
---|
74 | mranforest \
|
---|
75 | mjobs \
|
---|
76 | mjoptim \
|
---|
77 | mjtrain \
|
---|
78 | mmovie \
|
---|
79 | mtools \
|
---|
80 | mmuon \
|
---|
81 | mdebug
|
---|
82 |
|
---|
83 | LIBNOVA_PATH := `which libnovaconfig`
|
---|
84 |
|
---|
85 | ifeq ($(shell basename "$(LIBNOVA_PATH)X"), libnovaconfigX)
|
---|
86 | #SUBDIRS += libnova
|
---|
87 | LIBNOVA = -lnova
|
---|
88 | endif
|
---|
89 |
|
---|
90 | # Insert here "-I" and the path to your libnova installation,
|
---|
91 | # e.g. -ImyFolder/libnova/include.
|
---|
92 | # Leave it empty, if libnova is installed
|
---|
93 | # to the default location (i.e. /usr/include/libnova).
|
---|
94 | LIBNOVA_INCLUDE_PATH :=
|
---|
95 |
|
---|
96 | #LIBRARIES = $(SUBDIRS:%=lib/lib%.a)
|
---|
97 | LIBRARIES := $(SUBDIRS:=.a)
|
---|
98 | CONDOR := $(SUBDIRS:=.condor)
|
---|
99 | SGE := $(SUBDIRS:=.sge)
|
---|
100 | MRPROPERS := $(SUBDIRS:=.mrproper)
|
---|
101 | CLEANERS := $(SUBDIRS:=.clean)
|
---|
102 | LIBS := $(SOLIB)
|
---|
103 |
|
---|
104 | #------------------------------------------------------------------------------
|
---|
105 | .SUFFIXES: .c .cc .h .o .cxx .hxx .gch
|
---|
106 |
|
---|
107 | SRCFILES = \
|
---|
108 | mcore/factofits.h \
|
---|
109 | mcore/factfits.h \
|
---|
110 | mcore/DrsCalib.h \
|
---|
111 | mcore/PixelMap.h \
|
---|
112 | mcore/Interpolator2D.h \
|
---|
113 | mcore/nova.h \
|
---|
114 | mcore/Prediction.h
|
---|
115 |
|
---|
116 | ############################################################
|
---|
117 | RNDMNAME:=$(shell mktemp)
|
---|
118 |
|
---|
119 | all: $(SOLIB) $(PROGRAMS)
|
---|
120 | @echo " Done. "
|
---|
121 | @echo " "
|
---|
122 |
|
---|
123 | static: LIBS=$(SUBDIRS:=/*.o) $(OBJS)
|
---|
124 | #static: rmlib $(LIBRARIES) $(PROGRAMS)
|
---|
125 | static: $(LIBRARIES) $(PROGRAMS)
|
---|
126 | @echo " Done. "
|
---|
127 | @echo " "
|
---|
128 |
|
---|
129 | include Makefile.rules
|
---|
130 |
|
---|
131 | #
|
---|
132 | # Use $(CXX) -v ... for a more verbose output
|
---|
133 | #
|
---|
134 | # ROOTGLIBS must be there - why? How can I link the libraries?
|
---|
135 | $(SOLIB): $(LIBRARIES) $(OBJS) $(HEADERS)
|
---|
136 | @echo " Linking shared object $@ ..."
|
---|
137 | $(LINKER) $(CXXFLAGS) $(SOFLAG) $(OBJS) $(SUBDIRS:=/*.o) $(ROOTGLIBS) $(LIBNOVA) -o ${RNDMNAME}
|
---|
138 | mv ${RNDMNAME} $@
|
---|
139 | chmod go+r $@
|
---|
140 |
|
---|
141 | # This is a special workaround to create the shared object (bundle, plugin)
|
---|
142 | # for root and the dynlib (to be linked with the executable) on Mac OSX
|
---|
143 | ifneq ($(OSTYPE),darwin)
|
---|
144 | $(PROGRAMS): $(PROGRAMS:=.o) $(SOLIB)
|
---|
145 | @echo " Linking $@ ..."
|
---|
146 | $(LINKER) $(CXXFLAGS) $@.o $(MARS_LIB) $(SOLIB) $(ROOTGLIBS) -o $@
|
---|
147 |
|
---|
148 | # Use this to link the programs statically - for gprof
|
---|
149 | #$(PROGRAMS): $(OBJS) $(HEADERS) $(PROGRAMS:=.o)
|
---|
150 | # @echo " Linking $@ ..."
|
---|
151 | # $(CXX) $(CXXFLAGS) $(ROOTGLIBS) $(OBJS) $(SUBDIRS:=/*.o) $@.o $(MARS_LIB) -o $@
|
---|
152 | else
|
---|
153 | $(DYLIB): $(LIBRARIES) $(OBJS) $(HEADERS)
|
---|
154 | @echo " Linking dylib $(DYLIB) ..."
|
---|
155 | $(LINKER) $(CXXFLAGS) $(DYFLAG) $(OBJS) $(SUBDIRS:=/*.o) $(ROOTGLIBS) -o $@
|
---|
156 |
|
---|
157 | $(PROGRAMS): $(PROGRAMS:=.o) $(DYLIB)
|
---|
158 | @echo " Linking mac executable $@ ..."
|
---|
159 | $(LINKER) $(CXXFLAGS) $(ROOTGLIBS) $(DYLIB) $@.o $(MARS_LIB) -o $@
|
---|
160 | endif
|
---|
161 |
|
---|
162 | rmcondor:
|
---|
163 | rm -f .makecondor.log
|
---|
164 |
|
---|
165 | condor: rmcondor $(CONDOR)
|
---|
166 | echo Waiting for jobs to finish...
|
---|
167 | condor_wait .makecondor.log
|
---|
168 | rm .makecondor.log
|
---|
169 | make -j2 $(PROGRAMS)
|
---|
170 | # find -name "*/.makecondor.*"
|
---|
171 | # find -maxdepth 2 -name ".makecondor.*" -exec echo {}\\\; cat {}\\\; echo {}\\\; \;
|
---|
172 |
|
---|
173 | sge: $(SGE)
|
---|
174 | make -j16 $(PROGRAMS)
|
---|
175 |
|
---|
176 | dox: $(SOLIB)
|
---|
177 | @echo
|
---|
178 | @echo " Creating html documentation and logfile dohtml.log..."
|
---|
179 | rm -f dohtml.log
|
---|
180 | root -b -q dohtml.C 2>&1 >> dohtml.log | tee -a dohtml.log
|
---|
181 | @echo " done."
|
---|
182 | @echo
|
---|
183 |
|
---|
184 | #clean: rmcint rmobjs rmdep rmcore rmlib
|
---|
185 |
|
---|
186 | mrproper: $(MRPROPERS) rmbin rmbak rmbakmac rmhtml clean
|
---|
187 | @echo " Done."
|
---|
188 | @echo " "
|
---|
189 |
|
---|
190 | tar: mrproper
|
---|
191 | @echo "Making tar-file"
|
---|
192 | root -b -q -l -n tar.C
|
---|
193 | # @tar cvf ../mars.tar --exclude=Root .rootrc *
|
---|
194 | # @gzip -9 ../mars.tar
|
---|
195 |
|
---|
196 | #Makefile.depend:
|
---|
197 | # (! find ./ Makefile.depend -maxdepth 1 -empty 2> /dev/null && \
|
---|
198 | # echo " Generating dependancies into Makefile.depend" && \
|
---|
199 | # makedepend -- $(INCLUDES) -- $(PROGRAMS:=.cc) $(SRCS) $(SUBDIRS:=/*.cc) -w1024 -f- 2> /dev/null | grep -v Cint | grep -v "/usr/" > Makefile.depend && \
|
---|
200 | # echo " ") || find -maxdepth 0 -true > /dev/null
|
---|
201 | #
|
---|
202 | #depend: Makefile.depend
|
---|
203 |
|
---|
204 | # @endcode
|
---|