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 star 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 = mbase \
|
---|
38 | mmain \
|
---|
39 | mfileio \
|
---|
40 | mreflector \
|
---|
41 | mhist \
|
---|
42 | mdatacheck \
|
---|
43 | mgeom \
|
---|
44 | mimage \
|
---|
45 | manalysis \
|
---|
46 | mmontecarlo \
|
---|
47 | mmc \
|
---|
48 | mraw \
|
---|
49 | mgui \
|
---|
50 | mranforest \
|
---|
51 | mdata \
|
---|
52 | mhistmc \
|
---|
53 | mfilter \
|
---|
54 | mtools
|
---|
55 |
|
---|
56 | LIBRARIES = $(SUBDIRS:=.a)
|
---|
57 | MRPROPERS = $(SUBDIRS:=.mrproper)
|
---|
58 | CLEANERS = $(SUBDIRS:=.clean)
|
---|
59 |
|
---|
60 | #------------------------------------------------------------------------------
|
---|
61 |
|
---|
62 | .SUFFIXES: .c .cc .h .o
|
---|
63 |
|
---|
64 | SRCFILES =
|
---|
65 |
|
---|
66 | SRCS = $(SRCFILES)
|
---|
67 | HEADERS = $(SRCFILES:.cc=.h)
|
---|
68 | OBJS = $(SRCFILES:.cc=.o)
|
---|
69 |
|
---|
70 | ############################################################
|
---|
71 |
|
---|
72 | all: rmlib $(PROGRAMS) $(SOLIB)
|
---|
73 | @echo " Done. "
|
---|
74 | @echo " "
|
---|
75 |
|
---|
76 | # Use $(CXX) -v ... for a more verbose output
|
---|
77 | #
|
---|
78 | #
|
---|
79 | #$(MARS_LIB)
|
---|
80 | $(SOLIB): $(LIBRARIES) $(OBJS) $(HEADERS) MCint.o
|
---|
81 | @echo " Linking $(SOLIB) ..."
|
---|
82 | $(CXX) $(DYNLIB) $(CXXFLAGS) $(SUBDIRS:=/*.o) $(ROOTGLIBS) -o $@
|
---|
83 | mv mars.so lib
|
---|
84 |
|
---|
85 | $(PROGRAMS): $(LIBRARIES) $(OBJS) $(HEADERS) MCint.o $(PROGRAMS:=.o)
|
---|
86 | @echo " Linking $@ ..."
|
---|
87 | $(CXX) $(CXXFLAGS) $@.o $(OBJS) $(MARS_LIB) MCint.o $(ROOTGLIBS) -o $@
|
---|
88 |
|
---|
89 | #
|
---|
90 | # We could link mars.so instead of all libraries. This would need
|
---|
91 | # some MBs less space on the HD. But this means, that the Shared
|
---|
92 | # Library Path in your system must be set properly to be able to start
|
---|
93 | # 'mars'
|
---|
94 | #
|
---|
95 | #$(PROGRAMS): $(LIBRARIES) $(OBJS) $(HEADERS) $(SOLIB) MCint.o $(PROGRAMS:=.o)
|
---|
96 | # @echo " Linking $@ ..."
|
---|
97 | # $(CXX) $(CXXFLAGS) $@.o $(OBJS) lib/$(SOLIB) MCint.o $(ROOTGLIBS) -o $@
|
---|
98 |
|
---|
99 | #
|
---|
100 | # For later use
|
---|
101 | #
|
---|
102 | #$(PROGRAMS): $(LIBRARIES) $(OBJS) $(HEADERS) MCint.o $(PROGRAMS:=.o)
|
---|
103 | # @echo " Linking $@ ..."
|
---|
104 | # $(CXX) $(CXXFLAGS) $@.o $(OBJS) $(MARS_LIB) -L/usr/X11R6/lib -lX11 -lXpm MCint.o $(ROOTGLIBS) -o $@
|
---|
105 | #
|
---|
106 | #$(SOLIB): $(LIBRARIES) $(OBJS) $(HEADERS) MCint.o
|
---|
107 | # @echo " Linking $(SOLIB) ..."
|
---|
108 | # $(CXX) -shared $(CXXFLAGS) $(SUBDIRS:=/*.o) $(ROOTGLIBS) -o $@
|
---|
109 | # mv mars.so lib
|
---|
110 |
|
---|
111 | $(LIBRARIES):
|
---|
112 | @echo " Creating lib$@:"
|
---|
113 | (cd $*; make; cd ..; mv $*/$@ lib/lib$@)
|
---|
114 |
|
---|
115 | $(MRPROPERS):
|
---|
116 | @echo " Doing Mr.Proper in $(@:.mrproper=)"
|
---|
117 | (cd $(@:.mrproper=); (make mrproper > /dev/null); cd ..;)
|
---|
118 |
|
---|
119 | $(CLEANERS):
|
---|
120 | @echo "Cleaning $(@:.clean=):"
|
---|
121 | (cd $(@:.clean=); make clean; cd ..;)
|
---|
122 |
|
---|
123 | dox: $(SOLIB)
|
---|
124 | @echo " Creating html documentation:"
|
---|
125 | root -b -q dohtml.C
|
---|
126 |
|
---|
127 | include Makefile.rules
|
---|
128 |
|
---|
129 | clean: rmcint rmobjs rmcore rmlib
|
---|
130 |
|
---|
131 | mrproper: $(MRPROPERS) rmbin rmbak rmbakmac rmhtml clean
|
---|
132 | @echo " Done."
|
---|
133 | @echo " "
|
---|
134 |
|
---|
135 | tar: mrproper
|
---|
136 | @echo "Making tar-file"
|
---|
137 | @root -b -q -l -n tar.C
|
---|
138 | # @tar cvf ../mars.tar --exclude=Root .rootrc *
|
---|
139 | # @gzip -9 ../mars.tar
|
---|
140 |
|
---|
141 | # @endcode
|
---|