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 | include Makefile.conf.$(OSTYPE)
|
---|
18 | include Makefile.conf.general
|
---|
19 |
|
---|
20 | #
|
---|
21 |
|
---|
22 | #PROGRAMS = readraw merpp mars test mona status
|
---|
23 | PROGRAMS = readdaq readraw merpp mars mona showlog callisto showplot star
|
---|
24 | SOLIB = libmars.so
|
---|
25 | CINT = 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 | #
|
---|
38 | SUBDIRS = mbase \
|
---|
39 | mastro \
|
---|
40 | mmain \
|
---|
41 | mfbase \
|
---|
42 | mfilter \
|
---|
43 | mdata \
|
---|
44 | mhbase \
|
---|
45 | mhvstime \
|
---|
46 | mhist \
|
---|
47 | manalysis \
|
---|
48 | msignal \
|
---|
49 | mbadpixels \
|
---|
50 | mcalib \
|
---|
51 | mpedestal \
|
---|
52 | mfileio \
|
---|
53 | mreflector \
|
---|
54 | mgeom \
|
---|
55 | msql \
|
---|
56 | mimage \
|
---|
57 | mmontecarlo \
|
---|
58 | mmc \
|
---|
59 | mraw \
|
---|
60 | mcamera \
|
---|
61 | mpointing \
|
---|
62 | mreport \
|
---|
63 | mgui \
|
---|
64 | mranforest \
|
---|
65 | mhistmc \
|
---|
66 | mjobs \
|
---|
67 | mtools \
|
---|
68 | mstarcam
|
---|
69 |
|
---|
70 | #LIBRARIES = $(SUBDIRS:%=lib/lib%.a)
|
---|
71 | LIBRARIES = $(SUBDIRS:=.a)
|
---|
72 | MRPROPERS = $(SUBDIRS:=.mrproper)
|
---|
73 | CLEANERS = $(SUBDIRS:=.clean)
|
---|
74 | LIBS = $(SOLIB)
|
---|
75 |
|
---|
76 | #------------------------------------------------------------------------------
|
---|
77 | .SUFFIXES: .c .cc .h .o
|
---|
78 |
|
---|
79 | SRCFILES =
|
---|
80 |
|
---|
81 | ############################################################
|
---|
82 | all: $(SOLIB) $(PROGRAMS)
|
---|
83 | @echo " Done. "
|
---|
84 | @echo " "
|
---|
85 |
|
---|
86 | static: LIBS=$(SUBDIRS:=/*.o) $(OBJS)
|
---|
87 | #static: rmlib $(LIBRARIES) $(PROGRAMS)
|
---|
88 | static: $(LIBRARIES) $(PROGRAMS)
|
---|
89 | @echo " Done. "
|
---|
90 | @echo " "
|
---|
91 |
|
---|
92 | include Makefile.rules
|
---|
93 |
|
---|
94 | #
|
---|
95 | # Use $(CXX) -v ... for a more verbose output
|
---|
96 | #
|
---|
97 | # ROOTGLIBS must be there - why? How can I link the libraries?
|
---|
98 | $(SOLIB): $(LIBRARIES) $(OBJS) $(HEADERS)
|
---|
99 | @echo " Linking shared object $(SOLIB) ..."
|
---|
100 | $(CXX) $(CXXFLAGS) $(SOFLAG) $(OBJS) $(SUBDIRS:=/*.o) $(ROOTGLIBS) -o $@
|
---|
101 |
|
---|
102 | # This is a special workaround to create the shared object (bundle, plugin)
|
---|
103 | # for root and the dynlib (to be linked with the executable) on Mac OSX
|
---|
104 | ifneq ($(OSTYPE),darwin)
|
---|
105 | $(PROGRAMS): $(SOLIB) $(PROGRAMS:=.o)
|
---|
106 | @echo " Linking $@ ..."
|
---|
107 | $(CXX) $(CXXFLAGS) $(ROOTGLIBS) $(SOLIB) $@.o $(MARS_LIB) -o $@
|
---|
108 |
|
---|
109 | # Use this to link the programs statically - for gprof
|
---|
110 | #$(PROGRAMS): $(OBJS) $(HEADERS) $(PROGRAMS:=.o)
|
---|
111 | # @echo " Linking $@ ..."
|
---|
112 | # $(CXX) $(CXXFLAGS) $(ROOTGLIBS) $(OBJS) $(SUBDIRS:=/*.o) $@.o $(MARS_LIB) -o $@
|
---|
113 | else
|
---|
114 | $(DYLIB): $(LIBRARIES) $(OBJS) $(HEADERS)
|
---|
115 | @echo " Linking dylib $(DYLIB) ..."
|
---|
116 | $(CXX) $(CXXFLAGS) $(DYFLAG) $(OBJS) $(SUBDIRS:=/*.o) $(ROOTGLIBS) -o $@
|
---|
117 |
|
---|
118 | $(PROGRAMS): $(DYLIB) $(PROGRAMS:=.o)
|
---|
119 | @echo " Linking mac executable $@ ..."
|
---|
120 | $(CXX) $(CXXFLAGS) $(ROOTGLIBS) $(DYLIB) $@.o $(MARS_LIB) -o $@
|
---|
121 | endif
|
---|
122 |
|
---|
123 | dox: $(SOLIB)
|
---|
124 | @echo
|
---|
125 | @echo " Creating html documentation and logfile dohtml.log..."
|
---|
126 | rm -f dohtml.log
|
---|
127 | root -b -q dohtml.C 2>&1 >> dohtml.log | tee -a dohtml.log
|
---|
128 | @echo " done."
|
---|
129 | @echo
|
---|
130 |
|
---|
131 | #clean: rmcint rmobjs rmdep rmcore rmlib
|
---|
132 |
|
---|
133 | mrproper: $(MRPROPERS) rmbin rmbak rmbakmac rmhtml clean
|
---|
134 | @echo " Done."
|
---|
135 | @echo " "
|
---|
136 |
|
---|
137 | tar: mrproper
|
---|
138 | @echo "Making tar-file"
|
---|
139 | root -b -q -l -n tar.C
|
---|
140 | # @tar cvf ../mars.tar --exclude=Root .rootrc *
|
---|
141 | # @gzip -9 ../mars.tar
|
---|
142 |
|
---|
143 | #Makefile.depend:
|
---|
144 | # (! find ./ Makefile.depend -maxdepth 1 -empty 2> /dev/null && \
|
---|
145 | # echo " Generating dependancies into Makefile.depend" && \
|
---|
146 | # makedepend -- $(INCLUDES) -- $(PROGRAMS:=.cc) $(SRCS) $(SUBDIRS:=/*.cc) -w1024 -f- 2> /dev/null | grep -v Cint | grep -v "/usr/" > Makefile.depend && \
|
---|
147 | # echo " ") || find -maxdepth 0 -true > /dev/null
|
---|
148 | #
|
---|
149 | #depend: Makefile.depend
|
---|
150 |
|
---|
151 | # @endcode
|
---|