source: tags/Mars-V0.8.2/Makefile@ 17850

Last change on this file since 17850 was 2505, checked in by tbretz, 21 years ago
*** empty log message ***
File size: 3.7 KB
Line 
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#
17include Makefile.conf.$(OSTYPE)
18include Makefile.conf.general
19
20#
21
22#PROGRAMS = readraw merpp mars test mona status
23PROGRAMS = readraw merpp star mars
24SOLIB = libmars.so
25CINT = 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#
38SUBDIRS = mbase \
39 mmain \
40 mfilter \
41 mdata \
42 mhist \
43 manalysis \
44 mfileio \
45 mreflector \
46 mgeom \
47 mimage \
48 mmontecarlo \
49 mmc \
50 mraw \
51 mgui \
52 mranforest \
53 mhistmc \
54 mtools
55
56# monline \
57
58#LIBRARIES = $(SUBDIRS:%=lib/lib%.a)
59LIBRARIES = $(SUBDIRS:=.a)
60MRPROPERS = $(SUBDIRS:=.mrproper)
61CLEANERS = $(SUBDIRS:=.clean)
62
63#------------------------------------------------------------------------------
64
65.SUFFIXES: .c .cc .h .o
66
67SRCFILES =
68
69SRCS = $(SRCFILES)
70HEADERS = $(SRCFILES:.cc=.h)
71OBJS = $(SRCFILES:.cc=.o)
72
73############################################################
74
75all: rmlib $(PROGRAMS) $(SOLIB)
76 @echo " Done. "
77 @echo " "
78
79include Makefile.rules
80include Makefile.depend
81
82# Use $(CXX) -v ... for a more verbose output
83#
84#
85#$(MARS_LIB)
86$(SOLIB): $(LIBRARIES) $(OBJS) $(HEADERS) MCint.o
87 @echo " Linking $(SOLIB) ..."
88 $(CXX) $(DYNLIB) $(CXXFLAGS) $(SUBDIRS:=/*.o) $(ROOTGLIBS) -o $@
89
90$(PROGRAMS): $(SOLIB) $(PROGRAMS:=.o)
91 @echo " Linking $@ ..."
92 $(CXX) $(CXXFLAGS) $(ROOTGLIBS) $(SOLIB) $@.o $(MARS_LIB) -o $@
93
94#
95# We could link mars.so instead of all libraries. This would need
96# some MBs less space on the HD. But this means, that the Shared
97# Library Path in your system must be set properly to be able to start
98# 'mars'
99#
100#$(PROGRAMS): $(LIBRARIES) $(OBJS) $(HEADERS) $(SOLIB) MCint.o $(PROGRAMS:=.o)
101# @echo " Linking $@ ..."
102# $(CXX) $(CXXFLAGS) $@.o $(OBJS) lib/$(SOLIB) MCint.o $(ROOTGLIBS) -o $@
103
104#
105# For later use
106#
107#$(PROGRAMS): $(LIBRARIES) $(OBJS) $(HEADERS) MCint.o $(PROGRAMS:=.o)
108# @echo " Linking $@ ..."
109# $(CXX) $(CXXFLAGS) $@.o $(OBJS) $(MARS_LIB) -L/usr/X11R6/lib -lX11 -lXpm MCint.o $(ROOTGLIBS) -o $@
110#
111#$(SOLIB): $(LIBRARIES) $(OBJS) $(HEADERS) MCint.o
112# @echo " Linking $(SOLIB) ..."
113# $(CXX) -shared $(CXXFLAGS) $(SUBDIRS:=/*.o) $(ROOTGLIBS) -o $@
114# mv mars.so lib
115
116$(LIBRARIES):
117 @echo " Creating lib$@:"
118 (cd $*; make; cd ..; mv $*/$@ lib/lib$@)
119# (cd $(@:lib/lib%.a=%); make; cd ..; mv $(@:lib/lib%.a=%)/$(@:lib/lib%=%) $@)
120
121$(MRPROPERS):
122 @echo " Doing Mr.Proper in $(@:.mrproper=)"
123 (cd $(@:.mrproper=); (make mrproper > /dev/null); cd ..;)
124
125$(CLEANERS):
126 @echo "Cleaning $(@:.clean=):"
127 (cd $(@:.clean=); make clean; cd ..;)
128
129dox: $(SOLIB)
130 @echo " Creating html documentation:"
131 root -b -q dohtml.C
132
133clean: rmmake rmcint rmobjs rmcore rmlib
134
135mrproper: $(MRPROPERS) rmmake rmbin rmbak rmbakmac rmhtml clean
136 @echo " Done."
137 @echo " "
138
139tar: mrproper
140 @echo "Making tar-file"
141 @root -b -q -l -n tar.C
142# @tar cvf ../mars.tar --exclude=Root .rootrc *
143# @gzip -9 ../mars.tar
144
145Makefile.depend:
146 (! find ./ Makefile.depend -maxdepth 1 -empty 2> /dev/null && \
147 echo " Generating dependancies into Makefile.depend" && \
148 makedepend -- $(INCLUDES) -- $(PROGRAMS:=.cc) $(SRCS) $(SUBDIRS:=/*.cc) -w1024 -f- 2> /dev/null | grep -v Cint | grep -v "/usr/" > Makefile.depend && \
149 echo " ") || find -maxdepth 0 -true > /dev/null
150
151depend: Makefile.depend
152
153# @endcode
Note: See TracBrowser for help on using the repository browser.