| 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 | #
|
|---|
| 17 | include Makefile.conf.$(OSTYPE)
|
|---|
| 18 | include Makefile.conf.general
|
|---|
| 19 |
|
|---|
| 20 | #
|
|---|
| 21 |
|
|---|
| 22 | #PROGRAMS = readraw merpp mars test mona status
|
|---|
| 23 | PROGRAMS = readdaq readraw merpp star status mars mona
|
|---|
| 24 | SOLIB = libmars.so
|
|---|
| 25 | CINT = 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 | #
|
|---|
| 38 | SUBDIRS = mbase \
|
|---|
| 39 | mastro \
|
|---|
| 40 | mmain \
|
|---|
| 41 | mfilter \
|
|---|
| 42 | mdata \
|
|---|
| 43 | mhbase \
|
|---|
| 44 | mhist \
|
|---|
| 45 | manalysis \
|
|---|
| 46 | msignal \
|
|---|
| 47 | mbadpixels \
|
|---|
| 48 | mcalib \
|
|---|
| 49 | mfileio \
|
|---|
| 50 | mreflector \
|
|---|
| 51 | mgeom \
|
|---|
| 52 | msql \
|
|---|
| 53 | mimage \
|
|---|
| 54 | mmontecarlo \
|
|---|
| 55 | mmc \
|
|---|
| 56 | mraw \
|
|---|
| 57 | mcamera \
|
|---|
| 58 | mpointing \
|
|---|
| 59 | mreport \
|
|---|
| 60 | mgui \
|
|---|
| 61 | mranforest \
|
|---|
| 62 | mhistmc \
|
|---|
| 63 | mjobs \
|
|---|
| 64 | mtools
|
|---|
| 65 |
|
|---|
| 66 | # monline \
|
|---|
| 67 |
|
|---|
| 68 | #LIBRARIES = $(SUBDIRS:%=lib/lib%.a)
|
|---|
| 69 | LIBRARIES = $(SUBDIRS:=.a)
|
|---|
| 70 | MRPROPERS = $(SUBDIRS:=.mrproper)
|
|---|
| 71 | CLEANERS = $(SUBDIRS:=.clean)
|
|---|
| 72 | LIBS = $(SOLIB)
|
|---|
| 73 |
|
|---|
| 74 | #------------------------------------------------------------------------------
|
|---|
| 75 |
|
|---|
| 76 | .SUFFIXES: .c .cc .h .o
|
|---|
| 77 |
|
|---|
| 78 | SRCFILES =
|
|---|
| 79 |
|
|---|
| 80 | SRCS = $(SRCFILES)
|
|---|
| 81 | HEADERS = $(SRCFILES:.cc=.h)
|
|---|
| 82 | OBJS = $(SRCFILES:.cc=.o) MCint.o
|
|---|
| 83 |
|
|---|
| 84 | ############################################################
|
|---|
| 85 | all: rmlib $(SOLIB) $(PROGRAMS)
|
|---|
| 86 | @echo " Done. "
|
|---|
| 87 | @echo " "
|
|---|
| 88 |
|
|---|
| 89 | static: LIBS=$(SUBDIRS:=/*.o) $(OBJS)
|
|---|
| 90 | static: rmlib $(LIBRARIES) $(PROGRAMS)
|
|---|
| 91 | @echo " Done. "
|
|---|
| 92 | @echo " "
|
|---|
| 93 |
|
|---|
| 94 | include Makefile.rules
|
|---|
| 95 |
|
|---|
| 96 | #
|
|---|
| 97 | # Use $(CXX) -v ... for a more verbose output
|
|---|
| 98 | #
|
|---|
| 99 | # ROOTGLIBS must be there - why? How can I link the libraries?
|
|---|
| 100 | $(SOLIB): $(LIBRARIES) $(OBJS) $(HEADERS)
|
|---|
| 101 | @echo " Linking $(SOLIB) ..."
|
|---|
| 102 | $(CXX) $(CXXFLAGS) $(DYNLIB) $(OBJS) $(SUBDIRS:=/*.o) $(ROOTGLIBS) -o $@
|
|---|
| 103 | # $(CXX) $(CXXFLAGS) $(DYNLIB) $(OBJS) -Wl,--export-dynamic -Llib $(LIBRARIES:%.a=-l%) -o $@
|
|---|
| 104 |
|
|---|
| 105 | $(PROGRAMS): $(LIBS) $(PROGRAMS:=.o)
|
|---|
| 106 | @echo " Linking $@ ..."
|
|---|
| 107 | $(CXX) $(CXXFLAGS) $(ROOTGLIBS) $(LIBS) $@.o $(MARS_LIB) -o $@
|
|---|
| 108 |
|
|---|
| 109 | # FOR CONVINIENCE CREATE Dep-file first!
|
|---|
| 110 | $(LIBRARIES):
|
|---|
| 111 | @echo " Creating lib$@:"
|
|---|
| 112 | (cd $*; $(MAKE); cd ..; mv $*/$@ lib/lib$@)
|
|---|
| 113 |
|
|---|
| 114 | $(MRPROPERS):
|
|---|
| 115 | @echo " Doing Mr.Proper in $(@:.mrproper=)"
|
|---|
| 116 | (cd $(@:.mrproper=); ($(MAKE) mrproper > /dev/null); cd ..;)
|
|---|
| 117 |
|
|---|
| 118 | $(CLEANERS):
|
|---|
| 119 | @echo "Cleaning $(@:.clean=):"
|
|---|
| 120 | (cd $(@:.clean=); $(MAKE) clean; cd ..;)
|
|---|
| 121 |
|
|---|
| 122 | dox: $(SOLIB)
|
|---|
| 123 | @echo
|
|---|
| 124 | @echo " Creating html documentation and logfile dohtml.log..."
|
|---|
| 125 | rm -f dohtml.log
|
|---|
| 126 | root -b -q dohtml.C 2>&1 >> dohtml.log | tee -a dohtml.log
|
|---|
| 127 | @echo " done."
|
|---|
| 128 | @echo
|
|---|
| 129 |
|
|---|
| 130 | #clean: rmcint rmobjs rmdep rmcore rmlib
|
|---|
| 131 |
|
|---|
| 132 | mrproper: $(MRPROPERS) rmbin rmbak rmbakmac rmhtml clean
|
|---|
| 133 | @echo " Done."
|
|---|
| 134 | @echo " "
|
|---|
| 135 |
|
|---|
| 136 | tar: mrproper
|
|---|
| 137 | @echo "Making tar-file"
|
|---|
| 138 | root -b -q -l -n tar.C
|
|---|
| 139 | # @tar cvf ../mars.tar --exclude=Root .rootrc *
|
|---|
| 140 | # @gzip -9 ../mars.tar
|
|---|
| 141 |
|
|---|
| 142 | #Makefile.depend:
|
|---|
| 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) -w1024 -f- 2> /dev/null | grep -v Cint | grep -v "/usr/" > Makefile.depend && \
|
|---|
| 146 | # echo " ") || find -maxdepth 0 -true > /dev/null
|
|---|
| 147 | #
|
|---|
| 148 | #depend: Makefile.depend
|
|---|
| 149 |
|
|---|
| 150 | # @endcode
|
|---|