source: trunk/MagicSoft/Mars/Makefile@ 2493

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