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
|
---|
23 | SOLIB = mars.so
|
---|
24 | CINT = M
|
---|
25 |
|
---|
26 | #
|
---|
27 | # connect the include files defined in the config.mk file
|
---|
28 | #
|
---|
29 | # WARNING: the result (whether the linkage works or not) depends on the
|
---|
30 | # order of the libraries. It seems, that the most base library
|
---|
31 | # must be the last one
|
---|
32 | #
|
---|
33 |
|
---|
34 | #
|
---|
35 | # ----->>> mars libraries
|
---|
36 | #
|
---|
37 | SUBDIRS = mmain \
|
---|
38 | mmc \
|
---|
39 | mgui \
|
---|
40 | manalysis \
|
---|
41 | mbase \
|
---|
42 | meventdisp \
|
---|
43 | mdatacheck \
|
---|
44 | mmontecarlo \
|
---|
45 | mhist \
|
---|
46 | mdata \
|
---|
47 | mfilter \
|
---|
48 | mraw
|
---|
49 |
|
---|
50 | LIBRARIES = $(SUBDIRS:=.a)
|
---|
51 | MRPROPERS = $(SUBDIRS:=.mrproper)
|
---|
52 | CLEANERS = $(SUBDIRS:=.clean)
|
---|
53 |
|
---|
54 | #------------------------------------------------------------------------------
|
---|
55 |
|
---|
56 | .SUFFIXES: .c .cc .h .o
|
---|
57 |
|
---|
58 | SRCFILES =
|
---|
59 |
|
---|
60 | SRCS = $(SRCFILES)
|
---|
61 | HEADERS = $(SRCFILES:.cc=.h)
|
---|
62 | OBJS = $(SRCFILES:.cc=.o)
|
---|
63 |
|
---|
64 | ############################################################
|
---|
65 |
|
---|
66 | all: rmlib $(PROGRAMS) $(SOLIB)
|
---|
67 | @echo " Done. "
|
---|
68 | @echo " "
|
---|
69 |
|
---|
70 | # Use $(CXX) -v ... for a more verbose output
|
---|
71 | #
|
---|
72 | #
|
---|
73 | #$(MARS_LIB)
|
---|
74 | $(SOLIB): $(LIBRARIES) $(OBJS) $(HEADERS) MCint.o
|
---|
75 | @echo " Linking $(SOLIB) ..."
|
---|
76 | $(CXX) -shared $(CXXFLAGS) $(SUBDIRS:=/*.o) $(ROOTGLIBS) -o $@
|
---|
77 | mv mars.so lib
|
---|
78 |
|
---|
79 | $(PROGRAMS): $(LIBRARIES) $(OBJS) $(HEADERS) MCint.o $(PROGRAMS:=.o)
|
---|
80 | @echo " Linking $@ ..."
|
---|
81 | $(CXX) $(CXXFLAGS) $@.o $(OBJS) $(MARS_LIB) MCint.o $(ROOTGLIBS) -o $@
|
---|
82 |
|
---|
83 | #
|
---|
84 | # We could link mars.so instead of all libraries. This would need
|
---|
85 | # some MBs less space on the HD. But this means, that the Shared
|
---|
86 | # Library Path in your system must be set properly to be able to start
|
---|
87 | # 'mars'
|
---|
88 | #
|
---|
89 | #$(PROGRAMS): $(LIBRARIES) $(OBJS) $(HEADERS) $(SOLIB) MCint.o $(PROGRAMS:=.o)
|
---|
90 | # @echo " Linking $@ ..."
|
---|
91 | # $(CXX) $(CXXFLAGS) $@.o $(OBJS) lib/$(SOLIB) MCint.o $(ROOTGLIBS) -o $@
|
---|
92 |
|
---|
93 | $(LIBRARIES):
|
---|
94 | @echo " Creating lib$@:"
|
---|
95 | (cd $*; make; cd ..; mv $*/$@ lib/lib$@)
|
---|
96 |
|
---|
97 | $(MRPROPERS):
|
---|
98 | @echo " Doing Mr.Proper in $(@:.mrproper=)"
|
---|
99 | (cd $(@:.mrproper=); (make mrproper > /dev/null); cd ..;)
|
---|
100 |
|
---|
101 | $(CLEANERS):
|
---|
102 | @echo "Cleaning $(@:.clean=):"
|
---|
103 | (cd $(@:.clean=); make clean; cd ..;)
|
---|
104 |
|
---|
105 | dox: $(SOLIB)
|
---|
106 | @echo " Creating html documentation:"
|
---|
107 | root -b -q dohtml.C
|
---|
108 |
|
---|
109 | include Makefile.rules
|
---|
110 |
|
---|
111 | clean: rmcint rmobjs rmcore rmlib
|
---|
112 |
|
---|
113 | mrproper: $(MRPROPERS) rmbin rmbak rmbakmac rmhtml clean
|
---|
114 | @echo " Done."
|
---|
115 | @echo " "
|
---|
116 |
|
---|
117 | tar: mrproper
|
---|
118 | @echo "Making tar-file"
|
---|
119 | @tar cvf ../mars.tar --exclude=Root .rootrc *
|
---|
120 | @gzip -9 ../mars.tar
|
---|
121 |
|
---|
122 | # @endcode
|
---|