source: tags/Mars-V2.1.1/Makefile@ 10077

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