FITTER_BINARY = $(shell which fitter) FITTER_TREE_BINARY = $(shell which fitter_tree) ROOT_MACROS = standard.C makeCanvas.C clearCutStrings.C getPads.C makeCanvasHist1d.C ifndef OUTPUT_DIR OUTPUT_DIR = ./output endif ifndef HDGEANT_CONFIG_FILE HDGEANT_CONFIG_FILE = hdgeant_config.txt endif all: check_binaries make_output_dir $(OUTPUT_DIR)/standard1.png check_binaries: @echo FITTER_BINARY = $(FITTER_BINARY) ifndef $(FITTER_BINARY) @echo fitter_binary not found in path, exiting exit 1 endif @echo FITTER_TREE_BINARY = $(FITTER_TREE_BINARY) ifndef $(FITTER_TREE_BINARY) @echo fitter_binary not found in path, exiting exit 1 endif make_output_dir: test -d $(OUTPUT_DIR) || mkdir -p $(OUTPUT_DIR) $(OUTPUT_DIR)/control.in: $(HDGEANT_CONFIG_FILE) control.in.template make_control.pl cp -v $(HDGEANT_CONFIG_FILE) $(OUTPUT_DIR) cp -v control.in.template $(OUTPUT_DIR) cp -v make_control.pl $(OUTPUT_DIR) cd $(OUTPUT_DIR) ; ./make_control.pl $(HDGEANT_CONFIG_FILE) $(OUTPUT_DIR)/hdgeant.hddm: $(OUTPUT_DIR)/control.in cd $(OUTPUT_DIR) ; hdgeant $(OUTPUT_DIR)/hdgeant_smeared.hddm: $(OUTPUT_DIR)/hdgeant.hddm cd $(OUTPUT_DIR) ; mcsmear -n -u2.72727 hdgeant.hddm $(OUTPUT_DIR)/fitter.hddm: config.txt $(OUTPUT_DIR)/hdgeant_smeared.hddm cp config.txt $(OUTPUT_DIR) cd $(OUTPUT_DIR) ; $(FITTER_BINARY) hdgeant_smeared.hddm $(OUTPUT_DIR)/fitter_tree.root: $(OUTPUT_DIR)/fitter.hddm cd $(OUTPUT_DIR) ; fitter_tree ifdef MULTI_FILE $(OUTPUT_DIR)/addToChain.C: make_addToChain.pl else $(OUTPUT_DIR)/addToChain.C: make_addToChain.pl $(OUTPUT_DIR)/fitter_tree.root endif cp make_addToChain.pl $(OUTPUT_DIR) cd $(OUTPUT_DIR) ; ./make_addToChain.pl $(OUTPUT_DIR)/standard1.png: $(OUTPUT_DIR)/addToChain.C $(ROOT_MACROS) $(RM) $(OUTPUT_DIR)/*.png cp $(ROOT_MACROS) $(OUTPUT_DIR) cd $(OUTPUT_DIR) ; root -b -q standard.C display: $(OUTPUT_DIR)/standard1.png eog $(OUTPUT_DIR)/*.png &