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 | mmain \
|
---|
40 | mfilter \
|
---|
41 | mdata \
|
---|
42 | mhbase \
|
---|
43 | mhist \
|
---|
44 | manalysis \
|
---|
45 | mcalib \
|
---|
46 | mfileio \
|
---|
47 | mreflector \
|
---|
48 | mgeom \
|
---|
49 | mimage \
|
---|
50 | mmontecarlo \
|
---|
51 | mmc \
|
---|
52 | mraw \
|
---|
53 | mcamera \
|
---|
54 | mpointing \
|
---|
55 | mreport \
|
---|
56 | mgui \
|
---|
57 | mranforest \
|
---|
58 | mhistmc \
|
---|
59 | mtools
|
---|
60 |
|
---|
61 | # monline \
|
---|
62 |
|
---|
63 | #LIBRARIES = $(SUBDIRS:%=lib/lib%.a)
|
---|
64 | LIBRARIES = $(SUBDIRS:=.a)
|
---|
65 | MRPROPERS = $(SUBDIRS:=.mrproper)
|
---|
66 | CLEANERS = $(SUBDIRS:=.clean)
|
---|
67 | LIBS = $(SOLIB)
|
---|
68 |
|
---|
69 | #------------------------------------------------------------------------------
|
---|
70 |
|
---|
71 | .SUFFIXES: .c .cc .h .o
|
---|
72 |
|
---|
73 | SRCFILES =
|
---|
74 |
|
---|
75 | SRCS = $(SRCFILES)
|
---|
76 | HEADERS = $(SRCFILES:.cc=.h)
|
---|
77 | OBJS = $(SRCFILES:.cc=.o) MCint.o
|
---|
78 |
|
---|
79 | ############################################################
|
---|
80 | all: rmlib $(SOLIB) $(PROGRAMS)
|
---|
81 | @echo " Done. "
|
---|
82 | @echo " "
|
---|
83 |
|
---|
84 | static: LIBS=$(SUBDIRS:=/*.o) $(OBJS)
|
---|
85 | static: rmlib $(LIBRARIES) $(PROGRAMS)
|
---|
86 | @echo " Done. "
|
---|
87 | @echo " "
|
---|
88 |
|
---|
89 | include Makefile.rules
|
---|
90 |
|
---|
91 | #
|
---|
92 | # Use $(CXX) -v ... for a more verbose output
|
---|
93 | #
|
---|
94 | # ROOTGLIBS must be there - why? How can I link the libraries?
|
---|
95 | $(SOLIB): $(LIBRARIES) $(OBJS) $(HEADERS)
|
---|
96 | @echo " Linking $(SOLIB) ..."
|
---|
97 | $(CXX) $(CXXFLAGS) $(DYNLIB) $(OBJS) $(SUBDIRS:=/*.o) $(ROOTGLIBS) -o $@
|
---|
98 | # $(CXX) $(CXXFLAGS) $(DYNLIB) $(OBJS) -Wl,--export-dynamic -Llib $(LIBRARIES:%.a=-l%) -o $@
|
---|
99 |
|
---|
100 | $(PROGRAMS): $(LIBS) $(PROGRAMS:=.o)
|
---|
101 | @echo " Linking $@ ..."
|
---|
102 | $(CXX) $(CXXFLAGS) $(ROOTGLIBS) $(LIBS) $@.o $(MARS_LIB) -o $@
|
---|
103 |
|
---|
104 | # FOR CONVINIENCE CREATE Dep-file first!
|
---|
105 | $(LIBRARIES):
|
---|
106 | @echo " Creating lib$@:"
|
---|
107 | (cd $*; make; cd ..; mv $*/$@ lib/lib$@)
|
---|
108 |
|
---|
109 | $(MRPROPERS):
|
---|
110 | @echo " Doing Mr.Proper in $(@:.mrproper=)"
|
---|
111 | (cd $(@:.mrproper=); (make mrproper > /dev/null); cd ..;)
|
---|
112 |
|
---|
113 | $(CLEANERS):
|
---|
114 | @echo "Cleaning $(@:.clean=):"
|
---|
115 | (cd $(@:.clean=); make clean; cd ..;)
|
---|
116 |
|
---|
117 | dox: $(SOLIB)
|
---|
118 | @echo
|
---|
119 | @echo " Creating html documentation and logfile dohtml.log..."
|
---|
120 | rm -f dohtml.log
|
---|
121 | root -b -q dohtml.C 2>&1 >> dohtml.log | tee -a dohtml.log
|
---|
122 | @echo " done."
|
---|
123 | @echo
|
---|
124 |
|
---|
125 | #clean: rmcint rmobjs rmdep rmcore rmlib
|
---|
126 |
|
---|
127 | mrproper: $(MRPROPERS) rmbin rmbak rmbakmac rmhtml clean
|
---|
128 | @echo " Done."
|
---|
129 | @echo " "
|
---|
130 |
|
---|
131 | tar: mrproper
|
---|
132 | @echo "Making tar-file"
|
---|
133 | root -b -q -l -n tar.C
|
---|
134 | # @tar cvf ../mars.tar --exclude=Root .rootrc *
|
---|
135 | # @gzip -9 ../mars.tar
|
---|
136 |
|
---|
137 | #Makefile.depend:
|
---|
138 | # (! find ./ Makefile.depend -maxdepth 1 -empty 2> /dev/null && \
|
---|
139 | # echo " Generating dependancies into Makefile.depend" && \
|
---|
140 | # makedepend -- $(INCLUDES) -- $(PROGRAMS:=.cc) $(SRCS) $(SUBDIRS:=/*.cc) -w1024 -f- 2> /dev/null | grep -v Cint | grep -v "/usr/" > Makefile.depend && \
|
---|
141 | # echo " ") || find -maxdepth 0 -true > /dev/null
|
---|
142 | #
|
---|
143 | #depend: Makefile.depend
|
---|
144 |
|
---|
145 | # @endcode
|
---|