Commit 2199e6c6 authored by Roland Levillain's avatar Roland Levillain
Browse files

Have doc/gen-figures-mk generate more Makefile bits.

	* doc/gen-figures-mk: Generate Make variables PBM_FIGURES,
	PGM_FIGURES and PPM_FIGURES in output.
	* doc/figures.mk: Regen.
	* doc/Makefile.am: No longer include $(srcdir)/pbm-figures.mk,
	$(srcdir)/pgm-figures.mk nor $(srcdir)/ppm-figures.mk.
	($(srcdir)/pbm-figures.mk, regen-pbm-figures-mk)
	($(srcdir)/pgm-figures.mk, regen-pgm-figures-mk)
	($(srcdir)/ppm-figures.mk, regen-ppm-figures-mk):
	Remove rules.
	(EXTRA_DIST): Add $(FIGURES).
	Remove $(PBM_FIGURES), $(PGM_FIGURES) and $(PPM_FIGURES).
	* doc/pbm-figures.mk,
	* doc/pgm-figures.mk,
	* doc/ppm-figures.mk:
	Remove.
parent 390b0955
2010-03-22 Roland Levillain <roland@lrde.epita.fr>
Have doc/gen-figures-mk generate more Makefile bits.
* doc/gen-figures-mk: Generate Make variables PBM_FIGURES,
PGM_FIGURES and PPM_FIGURES in output.
* doc/figures.mk: Regen.
* doc/Makefile.am: No longer include $(srcdir)/pbm-figures.mk,
$(srcdir)/pgm-figures.mk nor $(srcdir)/ppm-figures.mk.
($(srcdir)/pbm-figures.mk, regen-pbm-figures-mk)
($(srcdir)/pgm-figures.mk, regen-pgm-figures-mk)
($(srcdir)/ppm-figures.mk, regen-ppm-figures-mk):
Remove rules.
(EXTRA_DIST): Add $(FIGURES).
Remove $(PBM_FIGURES), $(PGM_FIGURES) and $(PPM_FIGURES).
* doc/pbm-figures.mk,
* doc/pgm-figures.mk,
* doc/ppm-figures.mk:
Remove.
2010-03-22 Roland Levillain <roland@lrde.epita.fr>
 
Rework doc/gen-figures-mk a bit.
......@@ -102,10 +102,7 @@ $(srcdir)/figures.mk: $(srcdir)/gen-figures-mk
mv -f $@.tmp $@
chmod -w $@
include $(srcdir)/figures.mk
# FIXME: $(FIGURES) is not added to EXTRA_DIST (though it is added to
# MAINTAINERCLEANFILES), because its contents is already in EXTRA_DIST
# thanks to PBM_FIGURES, PGM_FIGURES and PPM_FIGURES. However, these
# variables may be removed someday (see FIXME below).
EXTRA_DIST += $(FIGURES)
MAINTAINERCLEANFILES = $(FIGURES)
.PHONY: regen-figures-mk
......@@ -115,82 +112,11 @@ regen-figures-mk:
mv -f $(srcdir)/figures.mk.tmp $(srcdir)/figures.mk
chmod -w $(srcdir)/figures.mk
# This image seems to be used nowhere.
MORE_FIGURES = figures/accu_image_morpher_big_picture.pdf
EXTRA_DIST += $(MORE_FIGURES)
# ------------- #
# PNG figures. #
# ------------- #
# ----- #
# PBM. #
# ----- #
$(srcdir)/pbm-figures.mk: $(srcdir)/gen-make-variable
rm -f $@.tmp
$(srcdir)/gen-make-variable PBM_FIGURES \
`find $(srcdir)/figures/*.pbm | sed 's,^$(srcdir),\$$(srcdir),'` \
>$@.tmp
mv -f $@.tmp $@
chmod -w $@
include $(srcdir)/pbm-figures.mk
EXTRA_DIST += $(PBM_FIGURES)
.PHONY: regen-pbm-figures-mk
regen-pbm-figures-mk:
rm -f $(srcdir)/pbm-figures.mk.tmp
$(srcdir)/gen-make-variable PBM_FIGURES \
`find $(srcdir)/figures/*.pbm | sed 's,^$(srcdir),\$$(srcdir),'` \
>$(srcdir)/pbm-figures.mk.tmp
mv -f $(srcdir)/pbm-figures.mk.tmp $(srcdir)/pbm-figures.mk
chmod -w $(srcdir)/pbm-figures.mk
# ----- #
# PGM. #
# ----- #
$(srcdir)/pgm-figures.mk: $(srcdir)/gen-make-variable
rm -f $@.tmp
$(srcdir)/gen-make-variable PGM_FIGURES \
`find $(srcdir)/figures/*.pgm | sed 's,^$(srcdir),\$$(srcdir),'` \
>$@.tmp
mv -f $@.tmp $@
chmod -w $@
include $(srcdir)/pgm-figures.mk
EXTRA_DIST += $(PGM_FIGURES)
.PHONY: regen-pgm-figures-mk
regen-pgm-figures-mk:
rm -f $(srcdir)/pgm-figures.mk.tmp
$(srcdir)/gen-make-variable PGM_FIGURES \
`find $(srcdir)/figures/*.pgm | sed 's,^$(srcdir),\$$(srcdir),'` \
>$(srcdir)/pgm-figures.mk.tmp
mv -f $(srcdir)/pgm-figures.mk.tmp $(srcdir)/pgm-figures.mk
chmod -w $(srcdir)/pgm-figures.mk
# ----- #
# PPM. #
# ----- #
$(srcdir)/ppm-figures.mk: $(srcdir)/gen-make-variable
rm -f $@.tmp
$(srcdir)/gen-make-variable PPM_FIGURES \
`find $(srcdir)/figures/*.ppm | sed 's,^$(srcdir),\$$(srcdir),'` \
>$@.tmp
mv -f $@.tmp $@
chmod -w $@
include $(srcdir)/ppm-figures.mk
EXTRA_DIST += $(PPM_FIGURES)
.PHONY: regen-ppm-figures-mk
regen-ppm-figures-mk:
rm -f $(srcdir)/ppm-figures.mk.tmp
$(srcdir)/gen-make-variable PPM_FIGURES \
`find $(srcdir)/figures/*.ppm | sed 's,^$(srcdir),\$$(srcdir),'` \
>$(srcdir)/ppm-figures.mk.tmp
mv -f $(srcdir)/ppm-figures.mk.tmp $(srcdir)/ppm-figures.mk
chmod -w $(srcdir)/ppm-figures.mk
# ----- #
# PNG. #
# ----- #
# PNG figures are generated from PBM, PGM and PPM figures.
convert_to_png = convert -scale 250 -bordercolor black -border 2x2
......@@ -212,6 +138,14 @@ PNG_FIGURES = \
EXTRA_DIST += $(PNG_FIGURES)
MAINTAINERCLEANFILES += $(PNG_FIGURES)
# --------------- #
# Other figures. #
# --------------- #
# This image seems to be used nowhere.
MORE_FIGURES = figures/accu_image_morpher_big_picture.pdf
EXTRA_DIST += $(MORE_FIGURES)
## ---------- ##
## Examples. ##
......
......@@ -145,3 +145,44 @@ FIGURES = \
$(TUTO3_COLORIZE_FIGURES) \
$(TUTO3_RW_IMAGE_FIGURES) \
$(TUTO4_GENERICITY_AND_ALGORITHMS_FIGURES)
# The list of all generated PBM figures.
PBM_FIGURES = \
$(srcdir)/figures/fill-subdomain-1.pbm \
$(srcdir)/figures/ima_save.pbm \
$(srcdir)/figures/labeling-compute-1.pbm \
$(srcdir)/figures/logical-not-1.pbm \
$(srcdir)/figures/logical-not-2.pbm \
$(srcdir)/figures/logical-not-3.pbm \
$(srcdir)/figures/tuto2_first_image-1.pbm \
$(srcdir)/figures/tuto4_genericity_and_algorithms-3.pbm
# The list of all generated PGM figures.
PGM_FIGURES = \
$(srcdir)/figures/tuto3_colorize-1.pgm
# The list of all generated PPM figures.
PPM_FIGURES = \
$(srcdir)/figures/extend-1.ppm \
$(srcdir)/figures/extend-2.ppm \
$(srcdir)/figures/extend-3.ppm \
$(srcdir)/figures/extend-4.ppm \
$(srcdir)/figures/extend-5.ppm \
$(srcdir)/figures/fill-1.ppm \
$(srcdir)/figures/fill-2.ppm \
$(srcdir)/figures/fill-imageif-cfun-1.ppm \
$(srcdir)/figures/fill-subdomain-2.ppm \
$(srcdir)/figures/fill-subdomain-3.ppm \
$(srcdir)/figures/fill-subdomain-4.ppm \
$(srcdir)/figures/ima2d-rot-1.ppm \
$(srcdir)/figures/ima2d-rot-2.ppm \
$(srcdir)/figures/labeling-compute-2.ppm \
$(srcdir)/figures/tuto3_colorize-2.ppm \
$(srcdir)/figures/tuto3_rw_image-1.ppm \
$(srcdir)/figures/tuto3_rw_image-2.ppm \
$(srcdir)/figures/tuto3_rw_image-3.ppm \
$(srcdir)/figures/tuto4_genericity_and_algorithms-1.ppm \
$(srcdir)/figures/tuto4_genericity_and_algorithms-2.ppm \
$(srcdir)/figures/tuto4_genericity_and_algorithms-4.ppm \
$(srcdir)/figures/tuto4_genericity_and_algorithms-5.ppm \
$(srcdir)/figures/tuto4_genericity_and_algorithms-6.ppm
......@@ -102,6 +102,14 @@ gen_var()
done
} | backslashify
}
# List of paths to PBM figures.
pbm_fig_paths=
# List of paths to PGM figures.
pgg_fig_paths=
# List of paths to PPM figures.
ppm_fig_paths=
cat<<EOF
## Generated by $me. Do not edit by hand.
......@@ -134,6 +142,16 @@ for file in `inputs`; do
# Populate the list of variables of figures.
fig_vars="$fig_vars \$($fig_var)"
# Populate the list of paths to figures of a given format.
for figure in $figures; do
fig_path=" \$(srcdir)/figures/$figure"
case "$figure" in
*.pbm) pbm_fig_paths="$pbm_fig_paths $fig_path";;
*.pgm) pgm_fig_paths="$pgm_fig_paths $fig_path";;
*.ppm) ppm_fig_paths="$ppm_fig_paths $fig_path";;
esac
done
# Generate a Make variable for the figures produced by FILE.
{
echo "$fig_var ="
......@@ -160,6 +178,15 @@ EOF
done
# Output the list of figures.
# More Make variables.
echo "# The list of all generated figures."
gen_var FIGURES $fig_vars
echo
echo "# The list of all generated PBM figures."
gen_var PBM_FIGURES $pbm_fig_paths
echo
echo "# The list of all generated PGM figures."
gen_var PGM_FIGURES $pgm_fig_paths
echo
echo "# The list of all generated PPM figures."
gen_var PPM_FIGURES $ppm_fig_paths
## Generated by gen-make-variable. Do not edit by hand.
PBM_FIGURES = \
$(srcdir)/figures/fill-subdomain-1.pbm \
$(srcdir)/figures/ima_save.pbm \
$(srcdir)/figures/labeling-compute-1.pbm \
$(srcdir)/figures/logical-not-1.pbm \
$(srcdir)/figures/logical-not-2.pbm \
$(srcdir)/figures/logical-not-3.pbm \
$(srcdir)/figures/tuto2_first_image-1.pbm \
$(srcdir)/figures/tuto4_genericity_and_algorithms-3.pbm
## Generated by gen-make-variable. Do not edit by hand.
PGM_FIGURES = \
$(srcdir)/figures/tuto3_colorize-1.pgm \
$(srcdir)/figures/tuto4_genericity_and_algorithms-7.pgm \
$(srcdir)/figures/tuto4_genericity_and_algorithms-8.pgm \
$(srcdir)/figures/tuto4_genericity_and_algorithms-9.pgm
## Generated by gen-make-variable. Do not edit by hand.
PPM_FIGURES = \
$(srcdir)/figures/extend-1.ppm \
$(srcdir)/figures/extend-2.ppm \
$(srcdir)/figures/extend-3.ppm \
$(srcdir)/figures/extend-4.ppm \
$(srcdir)/figures/extend-5.ppm \
$(srcdir)/figures/fill-1.ppm \
$(srcdir)/figures/fill-2.ppm \
$(srcdir)/figures/fill-imageif-cfun-1.ppm \
$(srcdir)/figures/fill-subdomain-2.ppm \
$(srcdir)/figures/fill-subdomain-3.ppm \
$(srcdir)/figures/fill-subdomain-4.ppm \
$(srcdir)/figures/ima2d-rot-1.ppm \
$(srcdir)/figures/ima2d-rot-2.ppm \
$(srcdir)/figures/labeling-compute-2.ppm \
$(srcdir)/figures/tuto3_colorize-2.ppm \
$(srcdir)/figures/tuto3_rw_image-1.ppm \
$(srcdir)/figures/tuto3_rw_image-2.ppm \
$(srcdir)/figures/tuto3_rw_image-3.ppm \
$(srcdir)/figures/tuto4_genericity_and_algorithms-1.ppm \
$(srcdir)/figures/tuto4_genericity_and_algorithms-2.ppm \
$(srcdir)/figures/tuto4_genericity_and_algorithms-4.ppm \
$(srcdir)/figures/tuto4_genericity_and_algorithms-5.ppm \
$(srcdir)/figures/tuto4_genericity_and_algorithms-6.ppm \
$(srcdir)/figures/tuto4_genericity_and_algorithms-7.ppm \
$(srcdir)/figures/tuto4_genericity_and_algorithms-8.ppm \
$(srcdir)/figures/tuto4_genericity_and_algorithms-9.ppm
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment