diff --git a/Makefile b/Makefile index d06bac5..399f0f8 100644 --- a/Makefile +++ b/Makefile @@ -39,6 +39,14 @@ SOURCES_plot_plates := $(TARGETS_signif_wells) TARGETS_plot_plates := $(addsuffix results/plots/,) TARGETS_plots := $(TARGETS_plot_overlap) $(TARGETS_plot_plates) +# Functions +# +# Hack of single rule invocation for multiple targets by substituting +# file extension "." with "%" per http://stackoverflow.com/a/3077254 +define singleton +$(foreach path,$1,$(shell echo -n $(path) | sed 's#\(.*\)\.#\1%##')) +endef + .PHONY : all all : z-projection cellprofiler plots ## (Default) Run full pipeline from image processing to plots. @@ -62,7 +70,7 @@ $(TARGETS_img_zproj) : $(SOURCES_img_zproj) .PHONY : cellprofiler cellprofiler : $(TARGETS_cellprofiler) ## Collect statistics about all images. -$(TARGETS_cellprofiler) : $(SOURCES_cellprofiler) +$(call singleton,$(TARGETS_cellprofiler)) : $(SOURCES_cellprofiler) $(CELLPROFILER) $(CELLPROFILER_OPTS) --run-headless .PHONY : gui-cellprofiler