source: trunk/Mars/Makefile@ 17200

Last change on this file since 17200 was 17127, checked in by tbretz, 11 years ago
Moved the mcode stuff from mbase to Mars root directory
File size: 4.7 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
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)
85SUBDIRS += libnova
86LIBNOVA = -lnova
87endif
88
89#LIBRARIES = $(SUBDIRS:%=lib/lib%.a)
90LIBRARIES := $(SUBDIRS:=.a)
91CONDOR := $(SUBDIRS:=.condor)
92MRPROPERS := $(SUBDIRS:=.mrproper)
93CLEANERS := $(SUBDIRS:=.clean)
94LIBS := $(SOLIB)
95
96#------------------------------------------------------------------------------
97.SUFFIXES: .c .cc .h .o .cxx .hxx .gch
98
99SRCFILES = \
100 mcore/izstream.h \
101 mcore/ofits.h \
102 mcore/factfits.h \
103 mcore/DrsCalib.h \
104 mcore/PixelMap.h \
105 mcore/Interpolator2D.h
106
107############################################################
108RNDMNAME:=$(shell mktemp)
109
110all: $(SOLIB) $(PROGRAMS)
111 @echo " Done. "
112 @echo " "
113
114static: LIBS=$(SUBDIRS:=/*.o) $(OBJS)
115#static: rmlib $(LIBRARIES) $(PROGRAMS)
116static: $(LIBRARIES) $(PROGRAMS)
117 @echo " Done. "
118 @echo " "
119
120include Makefile.rules
121
122#
123# Use $(CXX) -v ... for a more verbose output
124#
125# ROOTGLIBS must be there - why? How can I link the libraries?
126$(SOLIB): $(LIBRARIES) $(OBJS) $(HEADERS)
127 @echo " Linking shared object $@ ..."
128 $(CXX) $(CXXFLAGS) $(SOFLAG) $(OBJS) $(SUBDIRS:=/*.o) $(ROOTGLIBS) $(LIBNOVA) -o ${RNDMNAME}
129 mv ${RNDMNAME} $@
130 chmod go+r $@
131
132# This is a special workaround to create the shared object (bundle, plugin)
133# for root and the dynlib (to be linked with the executable) on Mac OSX
134ifneq ($(OSTYPE),darwin)
135$(PROGRAMS): $(PROGRAMS:=.o) $(SOLIB)
136 @echo " Linking $@ ..."
137 $(CXX) $(CXXFLAGS) $@.o $(MARS_LIB) $(SOLIB) $(ROOTGLIBS) -o $@
138
139# Use this to link the programs statically - for gprof
140#$(PROGRAMS): $(OBJS) $(HEADERS) $(PROGRAMS:=.o)
141# @echo " Linking $@ ..."
142# $(CXX) $(CXXFLAGS) $(ROOTGLIBS) $(OBJS) $(SUBDIRS:=/*.o) $@.o $(MARS_LIB) -o $@
143else
144$(DYLIB): $(LIBRARIES) $(OBJS) $(HEADERS)
145 @echo " Linking dylib $(DYLIB) ..."
146 $(CXX) $(CXXFLAGS) $(DYFLAG) $(OBJS) $(SUBDIRS:=/*.o) $(ROOTGLIBS) -o $@
147
148$(PROGRAMS): $(PROGRAMS:=.o) $(DYLIB)
149 @echo " Linking mac executable $@ ..."
150 $(CXX) $(CXXFLAGS) $(ROOTGLIBS) $(DYLIB) $@.o $(MARS_LIB) -o $@
151endif
152
153rmcondor:
154 rm -f .makecondor.log
155
156condor: rmcondor $(CONDOR)
157 echo Waiting for jobs to finish...
158 condor_wait .makecondor.log
159 rm .makecondor.log
160 make -j2 $(PROGRAMS)
161# find -name "*/.makecondor.*"
162# find -maxdepth 2 -name ".makecondor.*" -exec echo {}\\\; cat {}\\\; echo {}\\\; \;
163
164dox: $(SOLIB)
165 @echo
166 @echo " Creating html documentation and logfile dohtml.log..."
167 rm -f dohtml.log
168 root -b -q dohtml.C 2>&1 >> dohtml.log | tee -a dohtml.log
169 @echo " done."
170 @echo
171
172#clean: rmcint rmobjs rmdep rmcore rmlib
173
174mrproper: $(MRPROPERS) rmbin rmbak rmbakmac rmhtml clean
175 @echo " Done."
176 @echo " "
177
178tar: mrproper
179 @echo "Making tar-file"
180 root -b -q -l -n tar.C
181# @tar cvf ../mars.tar --exclude=Root .rootrc *
182# @gzip -9 ../mars.tar
183
184#Makefile.depend:
185# (! find ./ Makefile.depend -maxdepth 1 -empty 2> /dev/null && \
186# echo " Generating dependancies into Makefile.depend" && \
187# makedepend -- $(INCLUDES) -- $(PROGRAMS:=.cc) $(SRCS) $(SUBDIRS:=/*.cc) -w1024 -f- 2> /dev/null | grep -v Cint | grep -v "/usr/" > Makefile.depend && \
188# echo " ") || find -maxdepth 0 -true > /dev/null
189#
190#depend: Makefile.depend
191
192# @endcode
Note: See TracBrowser for help on using the repository browser.