source: trunk/MagicSoft/Mars/Makefile@ 2487

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