# # Makefile for the ZEaze shared library # # $Author: kind $ # $Date: 2004/04/02 16:48:59 $ # $Revision: 1.3 $ # # Defaults ZEUSRELEASE = new DEBUG = off MAP = off # Setup ZEUS library definitions ZARCH_TYPER = /$(ZARCH_TYPE) include $(ZMAKEDIR)/ZEUS/setup_project_paths.make # Use private phantom library due to 98-00 dedx correction routines PHANTOMLIBDIR = /data/zenith210a/kind/zeuslibs/phantom/v2004a/lib/$(ZARCH_TYPE) # Use private orange library for debugging reasons #ORANGELIBDIR = /data/zenith210a/kind/zeuslibs/orange/v2003a/lib/$(ZARCH_TYPE) # Use private copy of AdamoTAP for debugging reasons #TAPLIBDIR = /data/zenith210a/kind/zeuslibs/Adamo/v3x3.896/tap/lib/$(ZARCH_TYPE) # CERN library CERNLIBDIR = /cern/2002/lib CERNLIBS = packlib # Zeus libraries ZEUSLIBDIRS = $(CERNLIBDIR) $(PHANTOMLIBDIR) $(ZADAMOLIBDIR) $(TAPLIBDIR) \ $(CCLIBDIR) $(TGLIBDIR) $(FLDMINLIBDIR) $(MOZARTLIBDIR) $(VTLIBDIR) \ $(GEANTLIBDIR) $(ZRLIBDIR) $(ORANGELIBDIR) $(VCLIBDIR) $(PRLIBDIR) \ $(BPLIBDIR) $(SRTDLIBDIR) $(GENUTILLIBDIR) $(HESLIBDIR) $(ZRECONDIR) \ $(RLLIBDIR) ZEUSLIBS = phantom AdamoTAP kernlib ccrecon mathlib tgrecon fldmin packlib \ mozart_g321 vtrecon kernlib zgeant313 AdamoTAP zrecon kernlib \ mozart_g321 orange phantom kernlib vcrecon ccrecon AdamoTAP prrecon \ zgeant313 zrecon AdamoTAP packlib bprecon srtdrecon genutil hesrecon \ RFIO zrecon phantom orange ccrecon AdamoTAP mozart_g321 runlib phantom # Other libs (mostly system libs not required by Root) OTHERLIBDIRS = /products/gcc-2.95/lib/gcc-lib/i686-pc-linux-gnu/2.95.2 \ /usr/lib /usr/X11R6/lib OTHERLIBS = g2c f2c X11 # CXX = HdrSuf = h ObjSuf = o SrcSuf = cxx ExeSuf = DllSuf = so OutPutOpt = -o ROOTCFLAGS := $(shell root-config --cflags) ROOTLIBS := $(shell root-config --libs) ROOTGLIBS := $(shell root-config --glibs) # Linux with egcs (>= RedHat 5.2) ifeq ($(ZARCH_TYPE),i386-suse63-linux) CXX = g++ CXXFLAGS = -O -Wall -fPIC LD = g++ LDFLAGS = -O SOFLAGS = -shared endif ifeq ($(ZARCH_TYPE),i386-suse72-linux) CXX = g++ CXXFLAGS = -O -Wall -fPIC LD = g++ LDFLAGS = -O SOFLAGS = -shared endif CXXFLAGS += $(ROOTCFLAGS) LIBS = $(ROOTLIBS) $(SYSLIBS) GLIBS = $(ROOTGLIBS) $(SYSLIBS) # Debug mode ? ifeq ($(DEBUG),on) CXXFLAGS += -g CXXFLAGS += -DCF__DEBUG endif # Linker map ? ifeq ($(MAP),on) LDFLAGS += -Xlinker -Map -Xlinker linker.map endif OBJDIR = ../obj/$(ZARCH_TYPE) DICTDIR = ../dict USRINCS += ../inc ALLINCS = $(USRINCS) ../inc/orange ../inc/windows_c $(ZEVENTLIB)/inc \ ../inc/phantom ../inc/adamo USRSRC += ../src LIBDIR = ../lib/$(ZARCH_TYPE) CXXFLAGS += $(addprefix -I,$(ALLINCS)) LDFLAGS += $(addprefix -I,$(ALLINCS)) LIBNAMESO = libZEaze.$(DllSuf) SRCFILES = $(wildcard $(USRSRC)/*.$(SrcSuf)) HDRFILES = $(wildcard $(USRINCS)/*.$(HdrSuf)) DICTFILES = $(addprefix $(DICTDIR)/, $(addsuffix Dict.$(SrcSuf), \ $(notdir $(basename $(HDRFILES))))) OBJFILES = $(addprefix $(OBJDIR)/, $(addsuffix .$(ObjSuf), \ $(notdir $(basename $(SRCFILES))))) \ $(addprefix $(OBJDIR)/, $(addsuffix .$(ObjSuf), \ $(notdir $(basename $(DICTFILES))))) #------------------------------------------------------------------ all: dict lib html lib: $(OBJFILES) $(LD) $(SOFLAGS) $^ $(LDFLAGS) $(GLIBS) \ $(addprefix -L, $(ZEUSLIBDIRS)) $(addprefix -l, $(ZEUSLIBS)) \ $(addprefix -L, $(OTHERLIBDIRS)) $(addprefix -l, $(OTHERLIBS)) \ $(addprefix -L, $(CERNLIBDIR)) $(addprefix -l, $(CERNLIBS)) \ $(OutPutOpt) $(LIBDIR)/$(LIBNAMESO) @echo "$@ done" $(OBJDIR)/%.$(ObjSuf): $(USRSRC)/%.$(SrcSuf) $(CXX) $(CXXFLAGS) -c $< -o $@ $(OBJDIR)/%.$(ObjSuf): $(DICTDIR)/%.$(SrcSuf) $(CXX) $(CXXFLAGS) -c $< -o $@ $(OBJDIR)/%.$(ObjSuf): $(USRINCS)/%.$(HdrSuf) dict: $(DICTFILES) $(DICTDIR)/%Dict.$(SrcSuf): $(USRINCS)/%.$(HdrSuf) @echo -n "Generating dictionary $@... " @rootcint -f $@ -c $(addprefix -I,$(ALLINCS)) $^ @echo "done" clean: @rm -fv $(OBJDIR)/*.$(ObjSuf) cleanall: clean @rm -fv $(DICTDIR)/*.* @rm -fv $(LIBDIR)/*.$(DllSuf) @rm -frv ../htmldoc/* purge: @rm -fv $(USRSRC)/*~ @rm -fv $(USRINCS)/*~ @rm -fv ../*~ checkdirs: ../lib/$(ZARCH_TYPE) ../obj/$(ZARCH_TYPE) ../dict ../htmldoc ../lib/$(ZARCH_TYPE): ../lib mkdir $@ ../obj/$(ZARCH_TYPE): ../obj mkdir $@ ../lib: mkdir $@ ../obj: mkdir $@ ../exe: mkdir $@ ../dict: mkdir $@ ../htmldoc: mkdir $@ html: @echo "Generating HTML documentation ..." @root -q -l makehtml.C @echo "Done." help: @echo "" @echo "Make the ZEaze shared library." @echo "Just type make." @echo "" @echo "Options available:" @echo "all -> make shared library" @echo "clean -> remove object files" @echo "cleanall -> remove object files, dictionaries, the shared" @echo " library and the HTML documentation" @echo "purge -> remove backup files" @echo "dep -> remake dependencies" @echo "html -> make HTML documentation" @echo "checkdirs -> create necessary directories" @echo "testlib -> test output" @echo "" @echo "To create a debug version set DEBUG=on." @echo "E.g. 'make clean all DEBUG=on'" @echo "For creating a linker map set MAP=on." @echo "" testlib: @echo "" @echo "Library Name = $(LIBNAMESO)" @echo "Source Files = $(SRCFILES)" @echo "Include Files = $(HDRFILES)" @echo "Object Files = $(OBJFILES)" @echo "Zeus Libraries = $(ZEUSLIBS)" @echo "Cern Libraries = $(CERNLIBS)" @echo "Other Libraries = $(OTHERLIBS)" @echo "" # Automatic dependencies: dep: .depend .depend: $(SRCFILES) $(CXX) $(CXXFLAGS) -M $^ > .depend 2> /dev/null # Include the dependency list: include .depend