source: branches/Corsika7500Compatibility/Makefile@ 19923

Last change on this file since 19923 was 18526, checked in by dbaack, 8 years ago
Bugfixes and gcc-5 compability changes
File size: 5.0 KB
Line 
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
18include Makefile.conf.general
19include Makefile.conf.$(OSTYPE)
20
21#
22#PROGRAMS = readraw merpp mars test mona status
23PROGRAMS := readdaq readraw readcorsika ceres merpp callisto star ganymed sponde showlog showplot mars mars-config mirrorSimulation
24SOLIB := libmars.so
25
26CINT = 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#
39SUBDIRS := 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
82LIBNOVA_PATH := `which libnovaconfig`
83
84ifeq ($(shell basename "$(LIBNOVA_PATH)X"), libnovaconfigX)
85#SUBDIRS += libnova
86LIBNOVA = -lnova
87endif
88
89# Insert here "-I" and the path to your libnova installation,
90# e.g. -ImyFolder/libnova/include.
91# Leave it empty, if libnova is installed
92# to the default location (i.e. /usr/include/libnova).
93LIBNOVA_INCLUDE_PATH :=
94
95#LIBRARIES = $(SUBDIRS:%=lib/lib%.a)
96LIBRARIES := $(SUBDIRS:=.a)
97CONDOR := $(SUBDIRS:=.condor)
98SGE := $(SUBDIRS:=.sge)
99MRPROPERS := $(SUBDIRS:=.mrproper)
100CLEANERS := $(SUBDIRS:=.clean)
101LIBS := $(SOLIB)
102
103#------------------------------------------------------------------------------
104.SUFFIXES: .c .cc .h .o .cxx .hxx .gch
105
106SRCFILES = \
107 mcore/factofits.h \
108 mcore/factfits.h \
109 mcore/DrsCalib.h \
110 mcore/PixelMap.h \
111 mcore/Interpolator2D.h \
112 mcore/nova.h \
113 mcore/Prediction.h
114
115############################################################
116RNDMNAME:=$(shell mktemp)
117
118all: gcc $(SOLIB) $(PROGRAMS)
119 @echo " Done. "
120 @echo " "
121
122gcc:
123 @echo "gcc -v"
124 $(CC) -v
125
126static: LIBS=$(SUBDIRS:=/*.o) $(OBJS)
127#static: rmlib $(LIBRARIES) $(PROGRAMS)
128static: $(LIBRARIES) $(PROGRAMS)
129 @echo " Done. "
130 @echo " "
131
132include Makefile.rules
133
134#
135# Use $(CXX) -v ... for a more verbose output
136#
137# ROOTGLIBS must be there - why? How can I link the libraries?
138$(SOLIB): $(LIBRARIES) $(OBJS) $(HEADERS)
139 @echo " Linking shared object $@ ..."
140 $(LINKER) $(CXXFLAGS) $(SOFLAG) $(OBJS) $(SUBDIRS:=/*.o) $(ROOTGLIBS) $(LIBNOVA) -o ${RNDMNAME}
141 mv ${RNDMNAME} $@
142 chmod go+r $@
143
144# This is a special workaround to create the shared object (bundle, plugin)
145# for root and the dynlib (to be linked with the executable) on Mac OSX
146ifneq ($(OSTYPE),darwin)
147$(PROGRAMS): $(PROGRAMS:=.o) $(SOLIB)
148 @echo " Linking $@ ..."
149 $(LINKER) $(CXXFLAGS) $@.o $(MARS_LIB) $(SOLIB) $(ROOTGLIBS) -o $@
150
151# Use this to link the programs statically - for gprof
152#$(PROGRAMS): $(OBJS) $(HEADERS) $(PROGRAMS:=.o)
153# @echo " Linking $@ ..."
154# $(CXX) $(CXXFLAGS) $(ROOTGLIBS) $(OBJS) $(SUBDIRS:=/*.o) $@.o $(MARS_LIB) -o $@
155else
156$(DYLIB): $(LIBRARIES) $(OBJS) $(HEADERS)
157 @echo " Linking dylib $(DYLIB) ..."
158 $(LINKER) $(CXXFLAGS) $(DYFLAG) $(OBJS) $(SUBDIRS:=/*.o) $(ROOTGLIBS) -o $@
159
160$(PROGRAMS): $(PROGRAMS:=.o) $(DYLIB)
161 @echo " Linking mac executable $@ ..."
162 $(LINKER) $(CXXFLAGS) $(ROOTGLIBS) $(DYLIB) $@.o $(MARS_LIB) -o $@
163endif
164
165rmcondor:
166 rm -f .makecondor.log
167
168condor: rmcondor $(CONDOR)
169 echo Waiting for jobs to finish...
170 condor_wait .makecondor.log
171 rm .makecondor.log
172 make -j2 $(PROGRAMS)
173# find -name "*/.makecondor.*"
174# find -maxdepth 2 -name ".makecondor.*" -exec echo {}\\\; cat {}\\\; echo {}\\\; \;
175
176sge: $(SGE)
177 make -j16 $(PROGRAMS)
178
179dox: $(SOLIB)
180 @echo
181 @echo " Creating html documentation and logfile dohtml.log..."
182 rm -f dohtml.log
183 root -b -q dohtml.C 2>&1 >> dohtml.log | tee -a dohtml.log
184 @echo " done."
185 @echo
186
187#clean: rmcint rmobjs rmdep rmcore rmlib
188
189mrproper: $(MRPROPERS) rmbin rmbak rmbakmac rmhtml clean
190 @echo " Done."
191 @echo " "
192
193tar: mrproper
194 @echo "Making tar-file"
195 root -b -q -l -n tar.C
196# @tar cvf ../mars.tar --exclude=Root .rootrc *
197# @gzip -9 ../mars.tar
198
199#Makefile.depend:
200# (! find ./ Makefile.depend -maxdepth 1 -empty 2> /dev/null && \
201# echo " Generating dependancies into Makefile.depend" && \
202# makedepend -- $(INCLUDES) -- $(PROGRAMS:=.cc) $(SRCS) $(SUBDIRS:=/*.cc) -w1024 -f- 2> /dev/null | grep -v Cint | grep -v "/usr/" > Makefile.depend && \
203# echo " ") || find -maxdepth 0 -true > /dev/null
204#
205#depend: Makefile.depend
206
207# @endcode
Note: See TracBrowser for help on using the repository browser.