source: tags/Mars-V2.3/Makefile@ 19603

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