# Last edited on 2026-05-01 04:36:06 by stolfi

SHELL := /bin/bash -eu

.PHONY:
.PHONY: \
  some-targets \
  test-analyze_starps_parag_funcs \
  test-align_bencao_starps_items_funcs \
  test-del_shift_add_funcs \
  test-make_graph_from_dic \
  test-list_word_positions_in_lines \
  test-size_position_funcs \
  test-bitemplate_match_funcs \
  test-bimatching_eval_funcs \
  test-report_077_funcs \

SCRIPTS := ${wildcard {work/,}*.{sh,gawk,py,sed} }
SOURCES := in/bencao.uts in/bencao.pys ../074/st_files/str-parags.ivt

TARGETS_OPA := \
  starps-fu-ec-par-with-daiin.opc \
  starps-fu-ec-par-with-XaiR.opc \
  starps-fu-ec-par-with-DAIIN.opc \
  bencao-fu-ch-par-with-zhu3.opc

TARGETS_UPP := \
  bencao-fu-ch-par.upp \
  bencao-fu-ps-par.upp \
  starps-fu-wp-par.upp \
  starps-fu-wc-par.upp \
  starps-fu-ec-par.upp \
  starps-fu-wp-pag.upp \
  starps-fu-wc-pag.upp \
  starps-fu-ec-pag.upp \
  starps-gd-wp-par.upp \
  starps-gd-wc-par.upp \
  starps-gd-ec-par.upp \

TARGETS_TFR := \
  bencao-fu-ch-par-1.tfr \
  bencao-fu-ch-par-2.tfr \
  starps-fu-wc-par-1.tfr \
  starps-fu-wc-par-2.tfr \
  starps-fu-wp-par-1.tfr \
  starps-fu-wp-par-2.tfr \
  starps-gd-wc-par-1.tfr \
  starps-gd-wc-par-2.tfr \

TARGETS_TUP := \
  bencao-fu-ch-par-4-with-zhu3.tfr \
  starps-fu-wp-pag-2-with-DAIIN.tfr \
  starps-fu-ec-pag-11.tfr

TARGETS_WPAIR_A := \
  bencao-fu-ch-par-zhu3zhi4-bA-starps-fu-wp-par-daiin-fA-wdpairs.png

TARGETS_WPAIR_R := \
  bencao-fu-ch-par-zhu3zhi4-bR-starps-fu-wp-par-daiin-fR-wdpairs.png

TARGETS_WPAIR_AR := ${TARGETS_A} ${TARGETS_R}

# TARGETS := ALL
# TARGETS := starps-fu-ec-par-starps-gd-ec-par-upp-hist.png
# TARGETS := starps-fu-wp-pag-daiin.wpo
# TARGETS := starps-fu-wp-par-daiin.wpo
TARGETS := ${TARGETS_UPP} ${TARGETS_TFR}

# all: some-targets

# all: test-align_bencao_starps_items_funcs
# all: test-del_shift_add_funcs
# all: test-list_word_positions_in_lines
# all: test-size_position_funcs
# all: test-analyze_starps_parag_funcs
# all: test-bitemplate_match_funcs
all: test-bimatching_eval_funcs
# all: test-report_077_funcs
# all: test-make_graph_from_dic

some-targets: ${SCRIPTS} ${SOURCES}
	do_note_077.py ${TARGETS}

test-make_graph_from_dic: \
            make_graph_from_dic.py 
	make_graph_from_dic.py 'MGF.TEST'

test-analyze_starps_parag_funcs: \
            analyze_starps_parag_funcs.py 
	analyze_starps_parag_funcs.py 'ANN.TEST'

test-bitemplate_match_funcs: \
            bitemplate_match_funcs.py
	bitemplate_match_funcs.py 'BMF.TEST'

test-bimatching_eval_funcs: \
            bimatching_eval_funcs.py
	bimatching_eval_funcs.py 'BEF.TEST'

test-align_bencao_starps_items_funcs: \
            align_bencao_starps_items_funcs.py 
	align_bencao_starps_items_funcs.py 'ALBSI.TEST' 2>&1 \
          | sed -e 's:\\u3000:　:g'

test-del_shift_add_funcs: \
            test_del_shift_add_funcs.py \
            work/del_shift_add_funcs.py \
            plot_pos_file.sh \
            plot_pos_file_aux.gawk
	test_del_shift_add_funcs.py

test-list_word_positions_in_lines: \
            size_position_funcs.py
	list_word_positions_in_lines.py test

test-size_position_funcs: \
            size_position_funcs.py
	size_position_funcs.py 'SPF.TEST'

test-report_077_funcs: \
            report_077_funcs.py
	report_077_funcs.py 'R77.TEST' 0 > res/report_077_funcs_test_alt.html
	report_077_funcs.py 'R77.TEST' 1 > res/report_077_funcs_test_org.html
