source: trunk/MagicSoft/Mars/Makefile@ 2485

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