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 | mfilter \
|
---|
47 | mraw
|
---|
48 |
|
---|
49 | LIBRARIES = $(SUBDIRS:=.a)
|
---|
50 | MRPROPERS = $(SUBDIRS:=.mrproper)
|
---|
51 | CLEANERS = $(SUBDIRS:=.clean)
|
---|
52 |
|
---|
53 | #------------------------------------------------------------------------------
|
---|
54 |
|
---|
55 | .SUFFIXES: .c .cc .h .o
|
---|
56 |
|
---|
57 | SRCFILES =
|
---|
58 |
|
---|
59 | SRCS = $(SRCFILES)
|
---|
60 | HEADERS = $(SRCFILES:.cc=.h)
|
---|
61 | OBJS = $(SRCFILES:.cc=.o)
|
---|
62 |
|
---|
63 | ############################################################
|
---|
64 |
|
---|
65 | all: rmlib $(PROGRAMS) $(SOLIB)
|
---|
66 | @echo " Done. "
|
---|
67 | @echo " "
|
---|
68 |
|
---|
69 | # Use $(CXX) -v ... for a more verbose output
|
---|
70 | #
|
---|
71 | # We could link mars.so instead of all libraries. This would need
|
---|
72 | # some MBs less space on the HD. But this means, that the Shared
|
---|
73 | # Library Path in your system must be set properly to be able to start
|
---|
74 | # 'mars'
|
---|
75 | #
|
---|
76 | $(PROGRAMS): $(LIBRARIES) $(OBJS) $(HEADERS) MCint.o $(PROGRAMS:=.o)
|
---|
77 | @echo " Linking $@ ..."
|
---|
78 | $(CXX) $(CXXFLAGS) $@.o $(OBJS) $(MARS_LIB) MCint.o $(ROOTGLIBS) -o $@
|
---|
79 |
|
---|
80 | $(SOLIB): $(LIBRARIES) $(OBJS) $(HEADERS) MCint.o
|
---|
81 | @echo " Linking $(SOLIB) ..."
|
---|
82 | $(CXX) -shared $(CXXFLAGS) $(SUBDIRS:=/*.o) $(ROOTGLIBS) -o $@
|
---|
83 | mv mars.so lib
|
---|
84 |
|
---|
85 | $(LIBRARIES):
|
---|
86 | @echo " Creating lib$@:"
|
---|
87 | (cd $*; make; cd ..; mv $*/$@ lib/lib$@)
|
---|
88 |
|
---|
89 | $(MRPROPERS):
|
---|
90 | @echo " Doing Mr.Proper in $(@:.mrproper=)"
|
---|
91 | (cd $(@:.mrproper=); (make mrproper > /dev/null); cd ..;)
|
---|
92 |
|
---|
93 | $(CLEANERS):
|
---|
94 | @echo "Cleaning $(@:.clean=):"
|
---|
95 | (cd $(@:.clean=); make clean; cd ..;)
|
---|
96 |
|
---|
97 | dox:
|
---|
98 | @echo " Creating html documentation:"
|
---|
99 | root -b -q dohtml.C
|
---|
100 |
|
---|
101 | include Makefile.rules
|
---|
102 |
|
---|
103 | clean: rmcint rmobjs rmcore rmlib
|
---|
104 |
|
---|
105 | mrproper: $(MRPROPERS) rmbin rmbak rmbakmac rmhtml clean
|
---|
106 | @echo " Done."
|
---|
107 |
|
---|
108 | tar: mrproper
|
---|
109 | @echo "Making tar-file"
|
---|
110 | @tar cvf ../mars.tar --exclude=Root .rootrc *
|
---|
111 | @gzip -9 ../mars.tar
|
---|
112 |
|
---|
113 | # @endcode
|
---|