source: tags/Mars-V2.4/Makefile@ 10107

Last change on this file since 10107 was 9520, checked in by tbretz, 15 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#
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 mfbase \
44 mfilter \
45 mdata \
46 mhbase \
47 mhvstime \
48 mhist \
49 manalysis \
50 mextralgo \
51 msignal \
52 mbadpixels \
53 mhcalib \
54 mhflux \
55 mcalib \
56 mpedestal \
57 mfileio \
58 mgeom \
59 melectronics \
60 msim \
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.