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 star status mars mona
|
---|
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 | mhist \
|
---|
46 | manalysis \
|
---|
47 | msignal \
|
---|
48 | mbadpixels \
|
---|
49 | mcalib \
|
---|
50 | mfileio \
|
---|
51 | mreflector \
|
---|
52 | mgeom \
|
---|
53 | msql \
|
---|
54 | mimage \
|
---|
55 | mmontecarlo \
|
---|
56 | mmc \
|
---|
57 | mraw \
|
---|
58 | mcamera \
|
---|
59 | mpointing \
|
---|
60 | mreport \
|
---|
61 | mgui \
|
---|
62 | mranforest \
|
---|
63 | mhistmc \
|
---|
64 | mjobs \
|
---|
65 | mtools
|
---|
66 |
|
---|
67 | # monline \
|
---|
68 |
|
---|
69 | #LIBRARIES = $(SUBDIRS:%=lib/lib%.a)
|
---|
70 | LIBRARIES = $(SUBDIRS:=.a)
|
---|
71 | MRPROPERS = $(SUBDIRS:=.mrproper)
|
---|
72 | CLEANERS = $(SUBDIRS:=.clean)
|
---|
73 | LIBS = $(SOLIB)
|
---|
74 |
|
---|
75 | #------------------------------------------------------------------------------
|
---|
76 |
|
---|
77 | .SUFFIXES: .c .cc .h .o
|
---|
78 |
|
---|
79 | SRCFILES =
|
---|
80 |
|
---|
81 | SRCS = $(SRCFILES)
|
---|
82 | HEADERS = $(SRCFILES:.cc=.h)
|
---|
83 | OBJS = $(SRCFILES:.cc=.o) MCint.o
|
---|
84 |
|
---|
85 | ############################################################
|
---|
86 | all: rmlib $(SOLIB) $(PROGRAMS)
|
---|
87 | @echo " Done. "
|
---|
88 | @echo " "
|
---|
89 |
|
---|
90 | static: LIBS=$(SUBDIRS:=/*.o) $(OBJS)
|
---|
91 | static: rmlib $(LIBRARIES) $(PROGRAMS)
|
---|
92 | @echo " Done. "
|
---|
93 | @echo " "
|
---|
94 |
|
---|
95 | include Makefile.rules
|
---|
96 |
|
---|
97 | #
|
---|
98 | # Use $(CXX) -v ... for a more verbose output
|
---|
99 | #
|
---|
100 | # ROOTGLIBS must be there - why? How can I link the libraries?
|
---|
101 | $(SOLIB): $(LIBRARIES) $(OBJS) $(HEADERS)
|
---|
102 | @echo " Linking $(SOLIB) ..."
|
---|
103 | $(CXX) $(CXXFLAGS) $(DYNLIB) $(OBJS) $(SUBDIRS:=/*.o) $(ROOTGLIBS) -o $@
|
---|
104 | # $(CXX) $(CXXFLAGS) $(DYNLIB) $(OBJS) -Wl,--export-dynamic -Llib $(LIBRARIES:%.a=-l%) -o $@
|
---|
105 |
|
---|
106 | $(PROGRAMS): $(LIBS) $(PROGRAMS:=.o)
|
---|
107 | @echo " Linking $@ ..."
|
---|
108 | $(CXX) $(CXXFLAGS) $(ROOTGLIBS) $(LIBS) $@.o $(MARS_LIB) -o $@
|
---|
109 |
|
---|
110 | # FOR CONVINIENCE CREATE Dep-file first!
|
---|
111 | $(LIBRARIES):
|
---|
112 | @echo " Creating lib$@:"
|
---|
113 | (cd $*; $(MAKE) -f Makefile; cd ..; mv $*/$@ lib/lib$@)
|
---|
114 |
|
---|
115 | $(MRPROPERS):
|
---|
116 | @echo " Doing Mr.Proper in $(@:.mrproper=)"
|
---|
117 | (cd $(@:.mrproper=); ($(MAKE) -f Makefile mrproper > /dev/null); cd ..;)
|
---|
118 |
|
---|
119 | $(CLEANERS):
|
---|
120 | @echo "Cleaning $(@:.clean=):"
|
---|
121 | (cd $(@:.clean=); $(MAKE) -f Makefile clean; cd ..;)
|
---|
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
|
---|