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