################################################################## # # makefile # # for the MARS software # ################################################################## # @maintitle # @code # # please change all system depend values in the # config.mk.${OSTYPE} file # # include Makefile.conf.$(OSTYPE) include Makefile.conf.general # #PROGRAMS = readraw merpp mars test mona status PROGRAMS = readdaq readraw merpp star status mars mona SOLIB = libmars.so CINT = M # # connect the include files defined in the config.mk file # # WARNING: the result (whether the linkage works or not) depends on the # order of the libraries. It seems, that the most base library # must be the last one # # # ----->>> mars libraries # SUBDIRS = mbase \ mastro \ mmain \ mfbase \ mfilter \ mdata \ mhbase \ mhvstime \ mhist \ manalysis \ msignal \ mbadpixels \ mcalib \ mpedestal \ mfileio \ mreflector \ mgeom \ msql \ mimage \ mmontecarlo \ mmc \ mraw \ mcamera \ mpointing \ mreport \ mgui \ mranforest \ mhistmc \ mjobs \ mtools # monline \ #LIBRARIES = $(SUBDIRS:%=lib/lib%.a) LIBRARIES = $(SUBDIRS:=.a) MRPROPERS = $(SUBDIRS:=.mrproper) CLEANERS = $(SUBDIRS:=.clean) LIBS = $(SOLIB) #------------------------------------------------------------------------------ .SUFFIXES: .c .cc .h .o SRCFILES = SRCS = $(SRCFILES) HEADERS = $(SRCFILES:.cc=.h) OBJS = $(SRCFILES:.cc=.o) MCint.o ############################################################ all: rmlib $(SOLIB) $(PROGRAMS) @echo " Done. " @echo " " static: LIBS=$(SUBDIRS:=/*.o) $(OBJS) static: rmlib $(LIBRARIES) $(PROGRAMS) @echo " Done. " @echo " " include Makefile.rules # # Use $(CXX) -v ... for a more verbose output # # ROOTGLIBS must be there - why? How can I link the libraries? $(SOLIB): $(LIBRARIES) $(OBJS) $(HEADERS) @echo " Linking $(SOLIB) ..." $(CXX) $(CXXFLAGS) $(DYNLIB) $(OBJS) $(SUBDIRS:=/*.o) $(ROOTGLIBS) -o $@ # $(CXX) $(CXXFLAGS) $(DYNLIB) $(OBJS) -Wl,--export-dynamic -Llib $(LIBRARIES:%.a=-l%) -o $@ $(PROGRAMS): $(LIBS) $(PROGRAMS:=.o) @echo " Linking $@ ..." $(CXX) $(CXXFLAGS) $(ROOTGLIBS) $(LIBS) $@.o $(MARS_LIB) -o $@ # FOR CONVINIENCE CREATE Dep-file first! $(LIBRARIES): @echo " Creating lib$@:" (cd $*; $(MAKE) -f Makefile; cd ..; mv $*/$@ lib/lib$@) $(MRPROPERS): @echo " Doing Mr.Proper in $(@:.mrproper=)" (cd $(@:.mrproper=); ($(MAKE) -f Makefile mrproper > /dev/null); cd ..;) $(CLEANERS): @echo "Cleaning $(@:.clean=):" (cd $(@:.clean=); $(MAKE) -f Makefile clean; cd ..;) dox: $(SOLIB) @echo @echo " Creating html documentation and logfile dohtml.log..." rm -f dohtml.log root -b -q dohtml.C 2>&1 >> dohtml.log | tee -a dohtml.log @echo " done." @echo #clean: rmcint rmobjs rmdep rmcore rmlib mrproper: $(MRPROPERS) rmbin rmbak rmbakmac rmhtml clean @echo " Done." @echo " " tar: mrproper @echo "Making tar-file" root -b -q -l -n tar.C # @tar cvf ../mars.tar --exclude=Root .rootrc * # @gzip -9 ../mars.tar #Makefile.depend: # (! find ./ Makefile.depend -maxdepth 1 -empty 2> /dev/null && \ # echo " Generating dependancies into Makefile.depend" && \ # makedepend -- $(INCLUDES) -- $(PROGRAMS:=.cc) $(SRCS) $(SUBDIRS:=/*.cc) -w1024 -f- 2> /dev/null | grep -v Cint | grep -v "/usr/" > Makefile.depend && \ # echo " ") || find -maxdepth 0 -true > /dev/null # #depend: Makefile.depend # @endcode