OStype = $(shell uname) ARCHtype = $(shell uname -m) BINDIR = ../bin.$(OStype) #-------------------------------------------------------------------- # The symbol SWITCHES is used to active any of the following switches # to enable custom versions of the simulation program. #NTUPLE_OPTIONS = -DBACKGROUND_STUDIES NTUPLE_OPTIONS = -DBACKGROUND_PROFILING #NTUPLE_OPTIONS = -DHISTOGRAM_MATERIAL_SEEN_BY_FIRST_TRACK #NTUPLE_OPTIONS = -DWERNERS_VTX_NTUPLE #NTUPLE_OPTIONS = -DCERENKOV_PID_NTUPLE #NTUPLE_OPTIONS = -DFCAL_SPLASH_NTUPLE #NTUPLE_OPTIONS = -DTESTING_CAL_CONTAINMENT SIM_OPTIONS = -DTRACK_SHOWERS_IN_COLLIMATOR #-------------------------------------------------------------------- SWITCHES = -DCERNLIB_TYPE $(SIM_OPTIONS) $(NTUPLE_OPTIONS) ifeq ($(OStype),Linux) ifeq ($(ARCHtype),alpha) CC := gcc CPP := g++ F77 := g77 NETLIB := -lnsl XLIBS := -L/usr/X11R6/lib -lXpm -lSM -lXm -lXt -lICE -lXext -lX11 -lXp -ldl COPTS = -g $(SWITCHES) FOPTS = -g -Wno-globals $(SWITCHES) GLIBS := -L/usr/lib/gcc/i386-redhat-linux/3.4.6/ -lg2c else CC := gcc CPP := g++ F77 := gfortran NETLIB := -lnsl XLIBS := -L/usr/X11R6/lib -lXpm -lSM -lXm -lXt -lICE -lXext -lX11 -lXp -ldl COPTS = -g $(SWITCHES) FOPTS = -g -Wno-globals $(SWITCHES) GLIBS := -lXmu -lSM -lICE -lpthread EXPORTDYNAMIC = -Wl,-export-dynamic # STATIC = -Wl,-Bstatic STATIC = endif endif ifeq ($(OStype),OSF1) CC := cc CPP := g++ F77 := f77 NETLIB := EXPORTDYNAMIC := STATIC := XLIBS := -L/usr/lib -lXm -lSM -lICE -lXt -lX11 -lm -lPW -ldnet_stub COPTS = -g -D_Tru64 $(SWITCHES) FOPTS = -g -fpe4 $(SWITCHES) LOPTS = -g -non_shared -fpe4 GLIBS := -L/r5d1/applications/gcc3/lib/gcc-lib/alphaev5-dec-osf4.0f/ -lg2c -L/r5d1/applications/gcc3/lib/gcc-lib/alphaev5-dec-osf4.0f/3.3/ -lgcc endif ifeq ($(OStype),SunOS) CC := cc CPP := CC F77 := f77 NETLIB := EXPORTDYNAMIC := STATIC := XLIBS := -L/usr/lib -lXm -lSM -lICE -lXt -lX11 -lm COPTS := -g $(SWITCHES) FOPTS := -g $(SWITCHES) LOPTS := -g GLIBS := endif ifeq ($(OStype),Darwin) CC := gcc CPP := g++ F77 := g77 NETLIB := XLIBS := -L/usr/X11R6/lib -lXpm -lSM -lXm -lXt -lICE -lXext -lX11 -lXp -ldl COPTS = -g $(SWITCHES) FOPTS = -g -Wno-globals $(SWITCHES) GLIBS := -L$(CERN_ROOT)/lib -lcompat /usr/lib/libgcc.a endif HDDS = $(HALLD_HOME)/src/programs/Simulation/hdds HDDM = $(HALLD_HOME)/src/libraries/HDDM ifeq ($(OStype),OSF1) MISC_FIXES := vunit.o gsrotm.o fint.o gthion.o else MISC_FIXES := endif AUXF = guhadr.o gukine.o guout.o guphad.o gustep.o guxcs.o gsstak.o gltrac.o \ gelhad/gtgama.o gelhad/caspim.o gelhad/caspip.o gpairg.o savehits.o \ hddsGeant3.o goptimize.o cobrems.o beamgen.o settofg.o seteventid.o AUXC = hddmInput.o hddmOutput.o hddm_s.o \ hitStart.o hitCDC.o hitFDC.o hitBCal.o hitCerenkov.o hitFTOF.o \ hitFCal.o hitUPV.o bintree.o memcheck.o timel.o trapfpe.o \ calibDB.o hitTag.o storeTrajectory.o hitGCal.o GXFIXED = gxcs.o gxphys.o GELHAD = gelhad/libgelhad.a CERNLIB = $(CERN_ROOT)/bin/cernlib hdgeant++: hdgeant++.o gxint.o uginit.o uglast.o $(GELHAD) $(AUXF) $(AUXC) $(GXFIXED) \ $(MISC_FIXES) $(CPP) -mtune=generic -o $@ hdgeant++.o gxint.o uginit.o uglast.o \ $(FOPTS) $(AUXF) $(AUXC) $(GXFIXED) $(MISC_FIXES) \ -Lgelhad -lgelhad -Lhitutil -lhitutil \ -L$(HALLD_HOME)/lib/$(OSNAME) -lHDGEOMETRY \ -L$(JANA_HOME)/lib/$(OSNAME) -lJANA \ `cernlib -v $(CERN_LEVEL) geant321 pawlib graflib/Motif packlib mathlib` \ $(EXPORTDYNAMIC) $(GLIBS) hdgeant: hdgeant.o hdgeant_f.o uginit.o uglast.o $(GELHAD) $(AUXF) $(AUXC) $(MISC_FIXES) $(CPP) -mtune=generic $(LOPTS) -o $@ -I$(CERN_ROOT)/include $(STATIC) $(FOPTS) \ hdgeant.o hdgeant_f.o uginit.o uglast.o $(AUXF) $(AUXC) \ -Lgelhad -lgelhad -Lhitutil -lhitutil \ -L$(HALLD_HOME)/lib/$(OSNAME) -lHDGEOMETRY \ -L$(JANA_HOME)/lib/$(OSNAME) -lJANA \ `$(CERNLIB) geant321 mathlib graflib grafX11` \ $(NETLIB) $(XLIBS) $(GLIBS) install: hdgeant hdgeant++ cp $^ $(HALLD_HOME)/bin/$(OStype) .F.o: $(F77) $(FOPTS) -I. -I$(CERN_ROOT)/include -DCERNLIB_MOTIF -c -o $@ $< .f.o: $(F77) $(FOPTS) -I. -I$(CERN_ROOT)/include -c -o $@ $< .c.o: $(CC) $(COPTS) -I. -I$(HALLD_HOME)/src/include -I$(HDDM) \ -I$(JANA_HOME)/src \ -I$(HALLD_HOME)/src/libraries \ -I$(HALLD_HOME)/src/libraries/include \ -I$(CERN_ROOT)/include \ -c -o $@ $< $(AUXC): $(HDDM)/hddm_s.h bintree.h geant3.h hddmOutput.h .cpp.o: $(CPP) $(COPTS) -I. -I$(HALLD_HOME)/src/include -I$(HDDM) \ -I$(JANA_HOME)/src \ -I$(HALLD_HOME)/src/libraries/include \ -I$(HALLD_HOME)/src/libraries -c -o $@ $< .cc.o: $(CPP) $(COPTS) -I. -I$(HALLD_HOME)/src/include -I$(HDDM) \ -I$(JANA_HOME)/src \ -I$(HALLD_HOME)/src/libraries/include \ -I$(HALLD_HOME)/src/libraries -c -o $@ $< hddm_s.o: $(HDDM)/hddm_s.c $(CC) $(COPTS) -I. -I$(HALLD_HOME)/src/include -I$(HDDM) \ -I$(JANA_HOME)/src \ -I$(HALLD_HOME)/src/libraries/include \ -I$(HALLD_HOME)/src/libraries -c -o $@ $< cdcdump: cdcdump.c hddm_s.o $(CC) $(COPTS) -I. -I$(HALLD_HOME)/src/include -I$(HDDM) \ -I$(HALLD_HOME)/src/libraries/include \ -I$(HALLD_HOME)/src/libraries -o $@ $^ %2nt: %2nt.c hddm_s.o $(CC) $(COPTS) -I. -I$(HALLD_HOME)/src/include -I$(HDDM) \ -I$(JANA_HOME)/src \ -I$(HALLD_HOME)/src/libraries/include \ -I$(HALLD_HOME)/src/libraries -o $@ $^ \ -L$(CERN_ROOT)/lib -lpacklib -lkernlib -lg2c $(GELHAD): $(MAKE) -C gelhad clean: rm -f *.o core last.kumac* paw.metafile