# Makefile for the ROOT test programs. # This Makefile shows nicely how to compile and link applications # using the ROOT libraries on all supported platforms. # # Copyright (c) 2000 Rene Brun and Fons Rademakers # # Author: Fons Rademakers, 29/2/2000 ARCH = linux CXX = ObjSuf = o SrcSuf = cc ExeSuf = exe DllSuf = so OutPutOpt = -o EVENTLIB = $(EVENTSO) #ROOTCFLAGS := $(shell root-config --cflags) #ROOTLIBS := $(shell root-config --libs) #ROOTGLIBS := $(shell root-config --glibs) ifeq ($(ARCH),linux) # Linux with gcc 2.7.2.x #--------------------------------------- #PROFILING = -O3 -finline-functions -finline-functions-called-once -finline-limit=2000 \ # -funsafe-loop-optimizations # -floop-optimize2 -funsafe-loop-optimizations #PROFILING = -O3 #PROFILING = -O0 -g #PROFILING = -O0 -g -Wno-write-strings PROFILING = -O0 -g #PROFILING = -O0 -g -pg #--------------------------------------- FFLAGS = -Wall -c -fno-automatic #--------------------------------------- CC = g++ CXX = g++ CFLAGS = -Wall -c $(PROFILING) CXXFLAGS = -Wall -fPIC $(PROFILING) LD = g++ LDFLAGS = $(PROFILING) CPP =$(CXX) -E #--------------------------------------- SOFLAGS = -shared endif #CXXFLAGS += $(ROOTCFLAGS) #LIBS = $(ROOTLIBS) -lThread $(SYSLIBS) -lgfortran #GLIBS = $(ROOTGLIBS) -lThread $(SYSLIBS) -lgfortran #------------------------------------------------------------ # VME stuff #------------------------------------------------------------ ifeq ($(MACHTYPE),x86_64) libdir:=/usr/lib64/gef else libdir:=/usr/lib/gef endif # check if the gefvme-kmod-common RPM is not installed. ifeq (,$(wildcard $(libdir)/libvme.a)) VME=0 else VME=1 endif ifeq ($(VME),1) ifeq ($(vmeDSC),1) CFLAGS += $(DEFS) -DUSEVME -DUSE_vmeDSC -Wall \ -I${LINUXVME_INC} -I. \ -L${LINUXVME_LIB} -L. -DJLAB -g VMELIBS = -L$(LINUXVME_LIB) -lrt -ljvme -lfadc -lsd -lts -lti -ltd -lfa125 -lf1tdc -lctp -DJLAB -lvmeDSC else CFLAGS += $(DEFS) -DUSEVME -DLinux_vme -Wall \ -I${LINUXVME_INC} -I. \ -L${LINUXVME_LIB} -L. -DJLAB -g VMELIBS = -L$(LINUXVME_LIB) -lrt -ljvme -lfadc -lsd -lts -lti -ltd -lfa125 -lf1tdc -lctp -DJLAB -ldsc2 -lssp endif endif #------------------------------------------------------------ #PROGRAMS = Monitor hist-srv PROGRAMS = srv host #------------------------------------------------------------ all: $(PROGRAMS) #............................................................... #dep: # rm .depend # touch .depend # $(CPP) -M -DCF__LINUX -I $(ROOTCFLAGS) *.cc *.c > .depend #include .depend #............................................................... ifeq ($(VME),1) VMEOBJ = rc_vme.o dirc_vme.o endif #------------------------------------------------------------------------------ # #------------------------------------------------------------------------------ .f.o: gfortran $(FFLAGS) $< .c.o: @echo CFLAGS=$(CFLAGS) INC=${LINUXVME_INC} gcc $(CFLAGS) $< .cc.o: @echo CFLAGS=$(CFLAGS) $(CXX) $(CFLAGS) -c $< #------------------------------------------------------------------------------ # #------------------------------------------------------------------------------ SRV = shmem_srv.o tcplib.o rc_client.o hbook.o proc_read.o $(VMEOBJ) srv: $(SRV) @echo "----------------------------------" @echo "OS release ${BMS_OSNAME}" @echo VME=$(VME) @echo "Building $@ from $<" @mkdir -p $(BMS_OSNAME) g++ $(LDFLAGS) $(SRV) -Wl,-Map,$@.map $(VMELIBS) -lpthread -lm -o ${BMS_OSNAME}/shmem_srv.exe sync #------------------------------------------------------------------------------ # #------------------------------------------------------------------------------ DFLAGS += $(DEFS) -DUSEVME -DLinux_vme -Wall \ -I${LINUXVME_INC} -I. \ -L${LINUXVME_LIB} -L. -DJLAB -g DIRC = dirc_vme.c dirc: $(DIRC) @echo "----------------------------------" @echo "OS release ${BMS_OSNAME}" @echo VME=$(VME) @echo "Building $@ from $<" @mkdir -p $(BMS_OSNAME) gcc -DSERVER $(DFLAGS) $(DIRC) $(LDFLAGS) -g -Wl,-Map,$@.map $(VMELIBS) -lpthread -lm -o ${BMS_OSNAME}/dirc_srv.exe sync #------------------------------------------------------------------------------ # #------------------------------------------------------------------------------ HOST = get_host.o host: $(HOST) @echo "----------------------------------" @echo "OS release ${BMS_OSNAME}" @echo VME=$(VME) @echo "Building $@ from $<" @mkdir -p $(BMS_OSNAME) g++ $(LDFLAGS) $(HOST) -Wl,-Map,$@.map $(VMELIBS) -lpthread -lm -o ${BMS_OSNAME}/get_host.exe sync #------------------------------------------------------------------------------ .SUFFIXES: .$(SrcSuf) .$(ObjSuf) .$(DllSuf) .PHONY: Aclock Hello Tetris #------------------------------------------------------------------------------ clean: @rm -f $(OBJS) core *.o *.exe ${BMS_OSNAME}/*.exe distclean: clean @rm -f $(PROGRAMS) $(EVENTSO) $(EVENTLIB) *Dict.* *.def *.exp \ *.root *.ps *.so .def so_locations .SUFFIXES: .$(SrcSuf) ### #.$(SrcSuf).$(ObjSuf): # $(CXX) $(CFLAGS) -c $< test: @echo ARCH=$(ARCH) @echo MACHTYPE=$(MACHTYPE) @echo OS release ${BMS_OSNAME} @echo VME=$(VME) @echo libdir=$(libdir) @echo OBJS=$(OBJS) @echo OBJS=$(OBJS)