source: trunk/MagicSoft/Mars/Makefile@ 9518

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