# Last edited on 2021-03-08 03:22:36 by jstolfi # For "make single" the caller must define # ${DAY} ${EGGNAME} ${IMGNUM} ${RSMOOTH} ${KOSC} ${KINC} ${SHOW}. # # For "make combined" the caller must define ${EGGNAME} ${RSMOOTH} ${SHOW}. # # The image name ${EGGNAME} should be "egg-a", "egg-y", etc. # The ${IMGNUM} should be "01", "02", etc. # The smoothing radius ${RSMOOTH} should be zero-padded to 4 digits. # The ${SHOW} should be 1 to display the plots, 0 to just generate them. PROGDIR := .. EXTRACTOR := ${PROGDIR}/extract_egg_outline.py ANALYZER := ${PROGDIR}/analyze_egg_shape.py ANALYZER_IMPORTS := \ ${PROGDIR}/egg_circle.py \ ${PROGDIR}/egg_smooth.py COMBINER := ${PROGDIR}/combine_graphs.py COMBINER_IMPORTS := \ ${PROGDIR}/egg_phase.py \ ${PROGDIR}/egg_interp.py \ ${PROGDIR}/egg_resample.py .PHONY: all single single-one combined combined-one all: echo "make what?" 1>&2 ; exit 1 # ---------------------------------------------------------------------- # For "make single": ifneq "/${DAY}" "/" ifneq "/${IMGNUM}" "/" IMGNAME := ${EGGNAME}-${IMGNUM} INFILE := in/${DAY}/${IMGNAME}.png EXFILE := out/${IMGNAME}-pts.txt ANFILE := out/${IMGNAME}-sm${RSMOOTH}-fit.txt PLOT_PTS := out/${IMGNAME}-contours.png single: ${EXFILE} ${ANFILE} ${PLOT_PTS} for arg in arc ang; do \ for val in cvt rad ano ; do \ ${MAKE} \ EGGNAME=${EGGNAME} IMGNUM=${IMGNUM} RSMOOTH=${RSMOOTH} \ ARG="$${arg}" VAL="$${val}" \ SHOW=${SHOW} \ single-one; \ done ; \ done ${EXFILE}: ${EXTRACTOR} ${INFILE} ${EXTRACTOR} ${DAY} ${IMGNAME} ${ANFILE}: ${ANALYZER} ${ANALYZER_IMPORTS} ${EXFILE} ${ANALYZER} ${IMGNAME} ${RSMOOTH} ${PLOT_PTS}: ${EXFILE} ${ANFILE} ${PROGDIR}/plot_contours.sh ${PROGDIR}/plot_contours.sh ${IMGNAME} ${RSMOOTH} ${KOSC} ${KINC} ${SHOW} # ---------------------------------------------------------------------- # For recursive "make single-one": ifneq "/" "/${ARG}" ifneq "/" "/${VAL}" PLOT_SINGLE := out/${IMGNAME}-sm${RSMOOTH}-${ARG}-${VAL}.png single-one: ${PLOT_SINGLE} ${PLOT_SINGLE}: ${ANFILE} ${PROGDIR}/plot_single.sh ${PROGDIR}/plot_single.sh ${IMGNAME} ${RSMOOTH} ${ARG} ${VAL} ${SHOW} endif endif # End of "make single-one" stuff. # ---------------------------------------------------------------------- endif endif # End of "make single" stuff. # ---------------------------------------------------------------------- # ---------------------------------------------------------------------- # For "make combined": CURV_FILES := ${sort ${wildcard tests/out/${EGGNAME}-[0-9][0-9]-sm${RSMOOTH}-fit.txt}} NF := ${shell echo ${CURV_FILES} | tr ' ' '\012' | wc -l } combined: for arg in arc ang; do \ for val in cvt rad ano ; do \ ${MAKE} \ EGGNAME=${EGGNAME} RSMOOTH=${RSMOOTH} \ ARG="$${arg}" VAL="$${val}" \ SHOW=${SHOW} \ combined-one ; \ done ; \ done # ---------------------------------------------------------------------- # For recursive "make combined-one": ifneq "/" "/${ARG}" ifneq "/" "/${VAL}" CBFILE := out/${EGGNAME}-sm${RSMOOTH}-${ARG}-${VAL}.txt PLOT_COMBINED := out/${EGGNAME}-sm${RSMOOTH}-${ARG}-${VAL}.png combined-one: ${CBFILE} ${PLOT_COMBINED} ${CBFILE}: ${COMBINER} ${COMBINER_IMPORTS} ${CURV_FILES} ${COMBINER} ${EGGNAME} ${RSMOOTH} ${ARG} ${VAL} ${CURV_FILES} ; \ ${PLOT_COMBINED}: ${PROGDIR}/plot_combined.sh ${CBFILE} ${PROGDIR}/plot_combined.sh ${EGGNAME} ${RSMOOTH} ${ARG} ${VAL} ${NF} ${SHOW} endif endif # End of "make combined-one" stuff. # ----------------------------------------------------------------------