Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
BUG: Suppress multiple process invocations for multiple targets
  • Loading branch information
pan14001 committed Mar 17, 2017
1 parent cdb5acb commit 0f827d9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Makefile
Expand Up @@ -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.

Expand All @@ -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
Expand Down

0 comments on commit 0f827d9

Please sign in to comment.