source: trunk/MagicSoft/Mars/Makefile@ 2704

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