source: trunk/MagicSoft/Mars/Makefile@ 9497

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