From: David Seifert Date: Sun, 17 Apr 2022 10:53:37 +0000 (+0200) Subject: Simplify PDF generation X-Git-Tag: 4.0.0~79^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=def16bd0dd2cc161ac474c2ac1e2003a30224f0b;p=graphviz Simplify PDF generation * Make the suffix rule visible unconditionally, make only the PDF target (`pdf_DATA`) visible if `groff` is available and the user hasn't explicitly disabled PDF generation. --- diff --git a/cmd/dot/Makefile.am b/cmd/dot/Makefile.am index c9bb04efb..339b9d265 100644 --- a/cmd/dot/Makefile.am +++ b/cmd/dot/Makefile.am @@ -50,16 +50,6 @@ if ENABLE_MAN_PDFS pdf_DATA = dot.1.pdf osage.1.pdf patchwork.1.pdf endif -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -pdf = $(pdf_DATA) -else -pdf = ERROR_NO_PS2PDF -endif -else -pdf = -endif - dot_SOURCES = dot.c no_builtins.c dot_CPPFLAGS = $(AM_CPPFLAGS) -DDEMAND_LOADING=1 dot_LDADD = \ @@ -82,27 +72,11 @@ uninstall-hook: (cd $(DESTDIR)$(bindir); for i in $(linkedprogram); do rm -f $$i; done;) (cd $(DESTDIR)$(libdir); rm -f config;) -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -dot.1.pdf: dot.1.ps - $(PS2PDF) $< - -dot.1.ps: $(srcdir)/dot.1 - $(GROFF) -Tps -man $< >$@ - -osage.1.pdf: osage.1.ps - $(PS2PDF) $< - -osage.1.ps: $(srcdir)/osage.1 - $(GROFF) -Tps -man $< >$@ - -patchwork.1.pdf: patchwork.1.ps - $(PS2PDF) $< - -patchwork.1.ps: $(srcdir)/patchwork.1 - $(GROFF) -Tps -man $< >$@ -endif -endif +.1.1.pdf: + rm -f $@; pdffile=$@; psfile=$${pdffile%pdf}ps; \ + $(GROFF) -Tps -man $< > $$psfile || { rm -f $$psfile; exit 1; }; \ + $(PS2PDF) $$psfile && rm -f $$psfile || { rm -f $$psfile; exit 1; } +SUFFIXES = .1 .1.pdf dot_static_SOURCES = dot.c dot_builtins.c dot_static_CPPFLAGS = $(AM_CPPFLAGS) -DDEMAND_LOADING=0 @@ -154,6 +128,6 @@ endif nodist_EXTRA_dot_static_SOURCES = fake.cxx nodist_EXTRA_dot_builtins_SOURCES = fake.cxx -EXTRA_DIST = dot.1 osage.1 patchwork.1 $(pdf) dot.vcxproj* +EXTRA_DIST = dot.1 osage.1 patchwork.1 dot.vcxproj* -DISTCLEANFILES = $(pdf) dot.1.ps osage.1.ps patchwork.1.ps +DISTCLEANFILES = $(pdf_DATA) diff --git a/cmd/edgepaint/Makefile.am b/cmd/edgepaint/Makefile.am index e24eb5e5e..cbcf0c204 100644 --- a/cmd/edgepaint/Makefile.am +++ b/cmd/edgepaint/Makefile.am @@ -11,14 +11,6 @@ bin_PROGRAMS = edgepaint man_MANS = edgepaint.1 if ENABLE_MAN_PDFS pdf_DATA = edgepaint.1.pdf - -if HAVE_PS2PDF -pdf = $(pdf_DATA) -else -pdf = ERROR_NO_PS2PDF -endif -else -pdf = endif edgepaint_SOURCES = edgepaintmain.c @@ -40,16 +32,12 @@ edgepaint_LDADD = \ # linking, so the C++ standard library is included for our C++ dependencies nodist_EXTRA_edgepaint_SOURCES = fake.cxx -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -edgepaint.1.pdf: edgepaint.1.ps - $(PS2PDF) $< - -edgepaint.1.ps: $(srcdir)/edgepaint.1 - $(GROFF) -e -Tps -man -t $< >$@ -endif -endif +.1.1.pdf: + rm -f $@; pdffile=$@; psfile=$${pdffile%pdf}ps; \ + $(GROFF) -Tps -man $< > $$psfile || { rm -f $$psfile; exit 1; }; \ + $(PS2PDF) $$psfile && rm -f $$psfile || { rm -f $$psfile; exit 1; } +SUFFIXES = .1 .1.pdf -EXTRA_DIST = $(man_MANS) $(pdf) edgepaint.vcxproj* +EXTRA_DIST = $(man_MANS) edgepaint.vcxproj* -DISTCLEANFILES = $(pdf) edgepaint.1.ps +DISTCLEANFILES = $(pdf_DATA) diff --git a/cmd/gvedit/Makefile.am b/cmd/gvedit/Makefile.am index 4a60e7e56..b5c1f24f3 100644 --- a/cmd/gvedit/Makefile.am +++ b/cmd/gvedit/Makefile.am @@ -5,15 +5,6 @@ SUBDIRS = ui images gveditdir = $(pkgdatadir)/gvedit mans = gvedit.1 -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -pdfs = gvedit.1.pdf -else -pdfs = ERROR_NO_PS2PDF -endif -else -pdfs = -endif if WITH_QT bin_PROGRAMS = gvedit @@ -66,20 +57,16 @@ qMakefile: gvedit.pro attrs.txt: $(top_srcdir)/doc/infosrc/attrs cp $(top_srcdir)/doc/infosrc/attrs attrs.txt -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -gvedit.1.pdf: gvedit.1.ps - $(PS2PDF) $< - -gvedit.1.ps: $(srcdir)/gvedit.1 - $(GROFF) -Tps -man $< >$@ -endif -endif +.1.1.pdf: + rm -f $@; pdffile=$@; psfile=$${pdffile%pdf}ps; \ + $(GROFF) -Tps -man $< > $$psfile || { rm -f $$psfile; exit 1; }; \ + $(PS2PDF) $$psfile && rm -f $$psfile || { rm -f $$psfile; exit 1; } +SUFFIXES = .1 .1.pdf -EXTRA_DIST = gvedit.vcxproj* gvedit.pro.in mdi.qrc $(mans) $(pdfs) +EXTRA_DIST = gvedit.vcxproj* gvedit.pro.in mdi.qrc $(mans) CLEANFILES = moc_csettings.cpp moc_imageviewer.cpp moc_mainwindow.cpp moc_mdichild.cpp qrc_mdi.cpp -DISTCLEANFILES = attrs.txt $(pdf) qMakefile gvedit.1.ps +DISTCLEANFILES = attrs.txt qMakefile $(pdf_DATA) clean-local: -$(MAKE) -f qMakefile clean diff --git a/cmd/gvmap/Makefile.am b/cmd/gvmap/Makefile.am index 3b2c15411..aa44d09d0 100644 --- a/cmd/gvmap/Makefile.am +++ b/cmd/gvmap/Makefile.am @@ -10,18 +10,9 @@ if WITH_SFDP bin_PROGRAMS = gvmap cluster dist_bin_SCRIPTS = gvmap.sh man_MANS = gvmap.1 cluster.1 gvmap.sh.1 -endif - if ENABLE_MAN_PDFS pdf_DATA = gvmap.1.pdf cluster.1.pdf gvmap.sh.1.pdf - -if HAVE_PS2PDF -pdf = $(pdf_DATA) -else -pdf = ERROR_NO_PS2PDF endif -else -pdf = endif noinst_HEADERS = make_map.h power.h country_graph_coloring.h @@ -60,28 +51,12 @@ cluster_LDADD = \ gvmap.sh : -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -gvmap.1.pdf: gvmap.1.ps - $(PS2PDF) $< - -gvmap.1.ps: $(srcdir)/gvmap.1 - $(GROFF) -Tps -man $< >$@ - -cluster.1.pdf: cluster.1.ps - $(PS2PDF) $< - -cluster.1.ps: $(srcdir)/cluster.1 - $(GROFF) -Tps -man $< >$@ - -gvmap.sh.1.pdf: gvmap.sh.1.ps - $(PS2PDF) $< - -gvmap.sh.1.ps: $(srcdir)/gvmap.sh.1 - $(GROFF) -Tps -man $< >$@ -endif -endif +.1.1.pdf: + rm -f $@; pdffile=$@; psfile=$${pdffile%pdf}ps; \ + $(GROFF) -Tps -man $< > $$psfile || { rm -f $$psfile; exit 1; }; \ + $(PS2PDF) $$psfile && rm -f $$psfile || { rm -f $$psfile; exit 1; } +SUFFIXES = .1 .1.pdf -EXTRA_DIST = gvmap.1 cluster.1 gvmap.sh.1 $(pdf) gvmap.vcxproj* +EXTRA_DIST = gvmap.1 cluster.1 gvmap.sh.1 gvmap.vcxproj* -DISTCLEANFILES = $(pdf) gvmap.1.ps cluster.1.ps gvmap.sh.1.ps +DISTCLEANFILES = $(pdf_DATA) diff --git a/cmd/gvpr/Makefile.am b/cmd/gvpr/Makefile.am index 0d591bbe7..32a9323df 100644 --- a/cmd/gvpr/Makefile.am +++ b/cmd/gvpr/Makefile.am @@ -17,14 +17,6 @@ endif man_MANS = gvpr.1 if ENABLE_MAN_PDFS pdf_DATA = gvpr.1.pdf - -if HAVE_PS2PDF -pdf = $(pdf_DATA) -else -pdf = ERROR_NO_PS2PDF -endif -else -pdf = endif gvpr_SOURCES = gvprmain.c @@ -33,15 +25,12 @@ gvpr_LDADD = $(top_builddir)/lib/gvpr/libgvpr.la \ $(top_builddir)/lib/cgraph/libcgraph.la \ $(top_builddir)/lib/cdt/libcdt.la -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -gvpr.1.pdf: gvpr.1.ps - $(PS2PDF) $< +.1.1.pdf: + rm -f $@; pdffile=$@; psfile=$${pdffile%pdf}ps; \ + $(GROFF) -Tps -man $< > $$psfile || { rm -f $$psfile; exit 1; }; \ + $(PS2PDF) $$psfile && rm -f $$psfile || { rm -f $$psfile; exit 1; } +SUFFIXES = .1 .1.pdf -gvpr.1.ps: $(srcdir)/gvpr.1 - $(GROFF) -Tps -man -t $< >$@ -endif -endif gvpr_static_SOURCES = gvprmain.c gvpr_static_CPPFLAGS = $(AM_CPPFLAGS) gvpr_static_LDADD = \ @@ -55,6 +44,6 @@ gvpr_static_LDADD = \ $(top_builddir)/lib/cdt/libcdt_C.la \ $(MATH_LIBS) -EXTRA_DIST = $(man_MANS) $(pdf) lib gvpr.vcxproj* +EXTRA_DIST = $(man_MANS) lib gvpr.vcxproj* -DISTCLEANFILES = $(pdf) gvpr.1.ps +DISTCLEANFILES = $(pdf_DATA) diff --git a/cmd/mingle/Makefile.am b/cmd/mingle/Makefile.am index 41091fb47..1b4f3df66 100644 --- a/cmd/mingle/Makefile.am +++ b/cmd/mingle/Makefile.am @@ -9,18 +9,9 @@ AM_CPPFLAGS = \ if WITH_ANN bin_PROGRAMS = mingle man_MANS = mingle.1 -endif - if ENABLE_MAN_PDFS pdf_DATA = mingle.1.pdf - -if HAVE_PS2PDF -pdf = $(pdf_DATA) -else -pdf = ERROR_NO_PS2PDF endif -else -pdf = endif mingle_SOURCES = minglemain.cpp @@ -37,16 +28,12 @@ mingle_LDADD = \ $(top_builddir)/lib/cdt/libcdt.la \ $(ANN_LIBS) -lm -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -mingle.1.pdf: mingle.1.ps - $(PS2PDF) $< - -mingle.1.ps: $(srcdir)/mingle.1 - $(GROFF) -e -Tps -man -t $< >$@ -endif -endif +.1.1.pdf: + rm -f $@; pdffile=$@; psfile=$${pdffile%pdf}ps; \ + $(GROFF) -Tps -man $< > $$psfile || { rm -f $$psfile; exit 1; }; \ + $(PS2PDF) $$psfile && rm -f $$psfile || { rm -f $$psfile; exit 1; } +SUFFIXES = .1 .1.pdf -EXTRA_DIST = mingle.1 $(pdf) mingle.vcxproj* +EXTRA_DIST = mingle.1 mingle.vcxproj* -DISTCLEANFILES = $(pdf) mingle.1.ps +DISTCLEANFILES = $(pdf_DATA) diff --git a/cmd/smyrna/Makefile.am b/cmd/smyrna/Makefile.am index 25d327801..a2c43991d 100644 --- a/cmd/smyrna/Makefile.am +++ b/cmd/smyrna/Makefile.am @@ -16,7 +16,6 @@ AM_CPPFLAGS = \ bin_PROGRAMS = man_MANS = -pdf_DATA = if ENABLE_SHARED bin_PROGRAMS += smyrna endif @@ -25,17 +24,7 @@ bin_PROGRAMS += smyrna_static endif man_MANS += smyrna.1 if ENABLE_MAN_PDFS -pdf_DATA += smyrna.1.pdf -endif - -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -pdf = smyrna.1.pdf -else -pdf = ERROR_NO_PS2PDF -endif -else -pdf = +pdf_DATA = smyrna.1.pdf endif noinst_HEADERS = arcball.h draw.h glexpose.h \ @@ -87,16 +76,12 @@ smyrna_static_LDADD = $(top_builddir)/lib/cgraph/libcgraph_C.la \ $(top_builddir)/lib/pathplan/libpathplan_C.la \ $(GTK_LIBS) $(GLUT_LIBS) $(GTKGLEXT_LIBS) $(GLADE_LIBS) $(X_LIBS) $(EXPAT_LIBS) $(GTS_LIBS) $(MATH_LIBS) -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -smyrna.1.pdf: smyrna.1.ps - $(PS2PDF) $< - -smyrna.1.ps: $(srcdir)/smyrna.1 - $(GROFF) -Tps -man $< >$@ -endif -endif +.1.1.pdf: + rm -f $@; pdffile=$@; psfile=$${pdffile%pdf}ps; \ + $(GROFF) -Tps -man $< > $$psfile || { rm -f $$psfile; exit 1; }; \ + $(PS2PDF) $$psfile && rm -f $$psfile || { rm -f $$psfile; exit 1; } +SUFFIXES = .1 .1.pdf -EXTRA_DIST = smyrna.vcxproj* $(man_MANS) $(pdf) smyrna.1 +EXTRA_DIST = smyrna.vcxproj* $(man_MANS) smyrna.1 -DISTCLEANFILES = $(pdf) smyrna.1.ps +DISTCLEANFILES = $(pdf_DATA) diff --git a/cmd/tools/Makefile.am b/cmd/tools/Makefile.am index dbfeaeb4c..218c0756a 100644 --- a/cmd/tools/Makefile.am +++ b/cmd/tools/Makefile.am @@ -27,14 +27,6 @@ pdf_DATA = gc.1.pdf gvcolor.1.pdf gxl2gv.1.pdf acyclic.1.pdf \ nop.1.pdf ccomps.1.pdf sccmap.1.pdf tred.1.pdf \ unflatten.1.pdf gvpack.1.pdf dijkstra.1.pdf \ bcomps.1.pdf mm2gv.1.pdf gvgen.1.pdf gml2gv.1.pdf graphml2gv.1.pdf - -if HAVE_PS2PDF -pdf = $(pdf_DATA) -else -pdf = ERROR_NO_PS2PDF -endif -else -pdf = endif install-data-hook: @@ -77,15 +69,11 @@ gxl2gv_LDADD = \ $(top_builddir)/lib/cgraph/libcgraph.la \ $(top_builddir)/lib/cdt/libcdt.la $(EXPAT_LIBS) -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -gxl2gv.1.pdf: gxl2gv.1.ps - $(PS2PDF) $< - -gxl2gv.1.ps: $(srcdir)/gxl2gv.1 - $(GROFF) -Tps -man $< >$@ -endif -endif +.1.1.pdf: + rm -f $@; pdffile=$@; psfile=$${pdffile%pdf}ps; \ + $(GROFF) -Tps -man $< > $$psfile || { rm -f $$psfile; exit 1; }; \ + $(PS2PDF) $$psfile && rm -f $$psfile || { rm -f $$psfile; exit 1; } +SUFFIXES = .1 .1.pdf sccmap_SOURCES = sccmap.c @@ -93,15 +81,6 @@ sccmap_LDADD = \ $(top_builddir)/lib/ingraphs/libingraphs_C.la \ $(top_builddir)/lib/cgraph/libcgraph.la $(EXPAT_LIBS) -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -sccmap.1.pdf: sccmap.1.ps - $(PS2PDF) $< - -sccmap.1.ps: $(srcdir)/sccmap.1 - $(GROFF) -Tps -man $< >$@ -endif -endif ccomps_SOURCES = ccomps.c @@ -109,15 +88,6 @@ ccomps_LDADD = \ $(top_builddir)/lib/ingraphs/libingraphs_C.la \ $(top_builddir)/lib/cgraph/libcgraph.la -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -ccomps.1.pdf: ccomps.1.ps - $(PS2PDF) $< - -ccomps.1.ps: $(srcdir)/ccomps.1 - $(GROFF) -Tps -man $< >$@ -endif -endif tred_SOURCES = tred.c @@ -126,15 +96,6 @@ tred_LDADD = \ $(top_builddir)/lib/ingraphs/libingraphs_C.la \ $(top_builddir)/lib/cgraph/libcgraph.la -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -tred.1.pdf: tred.1.ps - $(PS2PDF) $< - -tred.1.ps: $(srcdir)/tred.1 - $(GROFF) -Tps -man $< >$@ -endif -endif unflatten_SOURCES = unflatten.c @@ -142,15 +103,6 @@ unflatten_LDADD = \ $(top_builddir)/lib/ingraphs/libingraphs_C.la \ $(top_builddir)/lib/cgraph/libcgraph.la -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -unflatten.1.pdf: unflatten.1.ps - $(PS2PDF) $< - -unflatten.1.ps: $(srcdir)/unflatten.1 - $(GROFF) -Tps -man $< >$@ -endif -endif acyclic_SOURCES = acyclic.c @@ -158,15 +110,6 @@ acyclic_LDADD = \ $(top_builddir)/lib/ingraphs/libingraphs_C.la \ $(top_builddir)/lib/cgraph/libcgraph.la -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -acyclic.1.pdf: acyclic.1.ps - $(PS2PDF) $< - -acyclic.1.ps: $(srcdir)/acyclic.1 - $(GROFF) -Tps -man $< >$@ -endif -endif nop_SOURCES = nop.c @@ -174,15 +117,6 @@ nop_LDADD = \ $(top_builddir)/lib/ingraphs/libingraphs_C.la \ $(top_builddir)/lib/cgraph/libcgraph.la -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -nop.1.pdf: nop.1.ps - $(PS2PDF) $< - -nop.1.ps: $(srcdir)/nop.1 - $(GROFF) -Tps -man $< >$@ -endif -endif gvcolor_SOURCES = gvcolor.c colxlate.c colortbl.h @@ -190,15 +124,6 @@ gvcolor_LDADD = \ $(top_builddir)/lib/ingraphs/libingraphs_C.la \ $(top_builddir)/lib/cgraph/libcgraph.la -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -gvcolor.1.pdf: gvcolor.1.ps - $(PS2PDF) $< - -gvcolor.1.ps: $(srcdir)/gvcolor.1 - $(GROFF) -Tps -man $< >$@ -endif -endif bcomps_SOURCES = bcomps.c @@ -206,15 +131,6 @@ bcomps_LDADD = \ $(top_builddir)/lib/ingraphs/libingraphs_C.la \ $(top_builddir)/lib/cgraph/libcgraph.la -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -bcomps.1.pdf: bcomps.1.ps - $(PS2PDF) $< - -bcomps.1.ps: $(srcdir)/bcomps.1 - $(GROFF) -Tps -man $< >$@ -endif -endif gc_SOURCES = gc.c @@ -222,15 +138,6 @@ gc_LDADD = \ $(top_builddir)/lib/ingraphs/libingraphs_C.la \ $(top_builddir)/lib/cgraph/libcgraph.la -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -gc.1.pdf: gc.1.ps - $(PS2PDF) $< - -gc.1.ps: $(srcdir)/gc.1 - $(GROFF) -Tps -man $< >$@ -endif -endif gvpack_SOURCES = gvpack.c gvpack_CPPFLAGS = $(AM_CPPFLAGS) -DDEMAND_LOADING=0 @@ -263,15 +170,6 @@ gvpack_static_LDADD = \ nodist_EXTRA_gvpack_static_SOURCES = fake.cxx endif -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -gvpack.1.pdf: gvpack.1.ps - $(PS2PDF) $< - -gvpack.1.ps: $(srcdir)/gvpack.1 - $(GROFF) -Tps -man $< >$@ -endif -endif mm2gv_SOURCES = mm2gv.c matrix_market.c mmio.c @@ -282,15 +180,6 @@ mm2gv_LDADD = \ $(top_builddir)/lib/pathplan/libpathplan_C.la \ $(top_builddir)/lib/cgraph/libcgraph.la $(MATH_LIBS) -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -mm2gv.1.pdf: mm2gv.1.ps - $(PS2PDF) $< - -mm2gv.1.ps: mm2gv.1 - $(GROFF) -Tps -man -e -t $< >$@ -endif -endif gv2gml_SOURCES = gv2gml.c @@ -313,15 +202,6 @@ gml2gv_LDADD = \ $(top_builddir)/lib/cgraph/libcgraph.la \ $(top_builddir)/lib/cdt/libcdt.la $(MATH_LIBS) -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -gml2gv.1.pdf: gml2gv.1.ps - $(PS2PDF) $< - -gml2gv.1.ps: gml2gv.1 - $(GROFF) -Tps -man $< >$@ -endif -endif graphml2gv_SOURCES = graphml2gv.c @@ -330,15 +210,6 @@ graphml2gv_LDADD = \ $(top_builddir)/lib/cgraph/libcgraph.la \ $(top_builddir)/lib/cdt/libcdt.la $(EXPAT_LIBS) -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -graphml2gv.1.pdf: graphml2gv.1.ps - $(PS2PDF) $< - -graphml2gv.1.ps: $(srcdir)/graphml2gv.1 - $(GROFF) -Tps -man $< >$@ -endif -endif dijkstra_SOURCES = dijkstra.c @@ -347,32 +218,13 @@ dijkstra_LDADD = \ $(top_builddir)/lib/cgraph/libcgraph.la \ $(top_builddir)/lib/cdt/libcdt.la -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -dijkstra.1.pdf: dijkstra.1.ps - $(PS2PDF) $< - -dijkstra.1.ps: $(srcdir)/dijkstra.1 - $(GROFF) -Tps -man $< >$@ -endif -endif gvgen_SOURCES = gvgen.c graph_generator.c gvgen_LDADD = \ $(top_builddir)/lib/cgraph/libcgraph.la $(MATH_LIBS) -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -gvgen.1.pdf: gvgen.1.ps - $(PS2PDF) $< - -gvgen.1.ps: $(srcdir)/gvgen.1 - $(GROFF) -Tps -man $< >$@ -endif -endif - -EXTRA_DIST = $(man_MANS) $(pdf) bcomps.vcxproj* \ +EXTRA_DIST = $(man_MANS) bcomps.vcxproj* \ acyclic.vcxproj* bcomps.vcxproj* ccomps.vcxproj* dijkstra.vcxproj* gc.vcxproj* \ gvcolor.vcxproj* gvgen.vcxproj* gvpack.vcxproj* gxl2gv.vcxproj* \ mm2gv.vcxproj* nop.vcxproj* sccmap.vcxproj* tred.vcxproj* unflatten.vcxproj* \ @@ -380,7 +232,4 @@ EXTRA_DIST = $(man_MANS) $(pdf) bcomps.vcxproj* \ graphml2gv.vcxproj* gv2gml.vcxproj* CLEANFILES = stamp.h -DISTCLEANFILES = $(pdf) gmlparse.[ch] gmlscan.c \ - gxl2gv.1.ps sccmap.1.ps ccomps.1.ps tred.1.ps unflatten.1.ps acyclic.1.ps \ - nop.1.ps gvcolor.1.ps bcomps.1.ps gc.1.ps gvpack.1.ps mm2gv.1.ps gml2gv.1.ps \ - graphml2gv.1.ps dijkstra.1.ps gvgen.1.ps +DISTCLEANFILES = $(pdf_DATA) gmlparse.[ch] gmlscan.c diff --git a/configure.ac b/configure.ac index 70acaaa0c..1ed6b712f 100644 --- a/configure.ac +++ b/configure.ac @@ -276,15 +276,21 @@ LT_INIT # prefer GNU variants over, say, Oracle's or Apples AC_CHECK_PROGS(SORT,gsort sort,false) -AC_CHECK_PROG(GROFF,groff,groff,false) -AC_CHECK_PROGS(PS2PDF,ps2pdf pstopdf,false) -AM_CONDITIONAL(HAVE_PS2PDF,[test "x$PS2PDF" != xfalse]) - AC_ARG_ENABLE([man-pdfs], - AS_HELP_STRING([--enable-man-pdfs],[Generate PDFs of man pages (default: auto)]), - [enable_man_pdfs=$enableval], - [enable_man_pdfs=$HAVE_PS2PDF]) -AM_CONDITIONAL(ENABLE_MAN_PDFS,[test "x$enable_man_pdfs" = "xyes"]) + [AS_HELP_STRING([--enable-man-pdfs], [Generate PDFs of man pages (default: auto)])]) + +AS_IF([test "x$enable_man_pdfs" != "xno"], [ + AC_CHECK_PROGS([GROFF], [groff]) + AS_IF([test "x$enable_man_pdfs" = "xyes" && test -z "$GROFF"], [ + AC_MSG_ERROR([You requested PDF generation from man pages, but 'groff' could not be found]) + ]) + + AC_CHECK_PROGS([PS2PDF], [ps2pdf pstopdf]) + AS_IF([test "x$enable_man_pdfs" = "xyes" && test -z "$PS2PDF"], [ + AC_MSG_ERROR([You requested PDF generation from man pages, but neither 'ps2pdf' nor 'pstopdf' could be found]) + ]) +]) +AM_CONDITIONAL([ENABLE_MAN_PDFS], [test "x$enable_man_pdfs" != "xno" && test -n "$GROFF" && test -n "$PS2PDF"]) PKG_INSTALLDIR PKG_PROG_PKG_CONFIG diff --git a/contrib/diffimg/Makefile.am b/contrib/diffimg/Makefile.am index c2cf5f21e..3dece08f7 100644 --- a/contrib/diffimg/Makefile.am +++ b/contrib/diffimg/Makefile.am @@ -6,36 +6,23 @@ AM_CPPFLAGS = \ $(GDLIB_CFLAGS) \ -I$(top_srcdir)/lib -if ENABLE_MAN_PDFS -pdf_DATA = diffimg.1.pdf - -if HAVE_PS2PDF -pdf = $(pdf_DATA) -else -pdf = ERROR_NO_PS2PDF -endif -else -pdf = -endif - if WITH_LIBGD bin_PROGRAMS = diffimg man_MANS = diffimg.1 +if ENABLE_MAN_PDFS +pdf_DATA = diffimg.1.pdf +endif endif diffimg_SOURCES = diffimg.c diffimg_LDADD = $(GDLIB_LIBS) $(MATH_LIBS) -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -diffimg.1.pdf: diffimg.1.ps - $(PS2PDF) $< - -diffimg.1.ps: $(srcdir)/diffimg.1 - $(GROFF) -Tps -man $< >$@ -endif -endif +.1.1.pdf: + rm -f $@; pdffile=$@; psfile=$${pdffile%pdf}ps; \ + $(GROFF) -Tps -man $< > $$psfile || { rm -f $$psfile; exit 1; }; \ + $(PS2PDF) $$psfile && rm -f $$psfile || { rm -f $$psfile; exit 1; } +SUFFIXES = .1 .1.pdf GRAPH = "digraph G { hello -> world }" @@ -47,5 +34,5 @@ test: diffimg if `./diffimg hello1.png hello2.png >test2.png`;then echo same;else echo different;fi CLEANFILES = *.png -EXTRA_DIST = diffimg.vcxproj* diffimg.1 $(pdf) -DISTCLEANFILES = $(pdf) diffimg.1.ps +EXTRA_DIST = diffimg.vcxproj* diffimg.1 +DISTCLEANFILES = $(pdf_DATA) diff --git a/contrib/prune/Makefile.am b/contrib/prune/Makefile.am index c3ab57f84..54e63c6af 100644 --- a/contrib/prune/Makefile.am +++ b/contrib/prune/Makefile.am @@ -11,14 +11,6 @@ noinst_HEADERS = generic_list.h man_MANS = prune.1 if ENABLE_MAN_PDFS pdf_DATA = prune.1.pdf - -if HAVE_PS2PDF -pdf = $(pdf_DATA) -else -pdf = ERROR_NO_PS2PDF -endif -else -pdf = endif prune_SOURCES = generic_list.c prune.c @@ -27,16 +19,12 @@ prune_LDADD = $(top_builddir)/lib/ingraphs/libingraphs_C.la \ $(top_builddir)/lib/cgraph/libcgraph.la \ $(top_builddir)/lib/cdt/libcdt.la -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -prune.1.pdf: prune.1.ps - $(PS2PDF) $< - -prune.1.ps: prune.1 - $(GROFF) -Tps -man $< >$@ -endif -endif +.1.1.pdf: + rm -f $@; pdffile=$@; psfile=$${pdffile%pdf}ps; \ + $(GROFF) -Tps -man $< > $$psfile || { rm -f $$psfile; exit 1; }; \ + $(PS2PDF) $$psfile && rm -f $$psfile || { rm -f $$psfile; exit 1; } +SUFFIXES = .1 .1.pdf -EXTRA_DIST = $(man_MANS) $(pdf) README test.gv prune.vcxproj* +EXTRA_DIST = $(man_MANS) README test.gv prune.vcxproj* -DISTCLEANFILES = $(pdf) prune.1.ps +DISTCLEANFILES = $(pdf_DATA) diff --git a/lib/cdt/Makefile.am b/lib/cdt/Makefile.am index ffcf2e497..044224d9e 100644 --- a/lib/cdt/Makefile.am +++ b/lib/cdt/Makefile.am @@ -20,16 +20,6 @@ pdf_DATA = cdt.3.pdf endif pkgconfig_DATA = libcdt.pc -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -pdf = $(pdf_DATA) -else -pdf = ERROR_NO_PS2PDF -endif -else -pdf = -endif - libcdt_C_la_SOURCES = dtclose.c dtdisc.c dtextract.c dtflatten.c \ dthash.c dtlist.c dtmethod.c dtopen.c dtrenew.c dtrestore.c dtsize.c \ dtstat.c dtstrhash.c dttree.c dtview.c dtwalk.c @@ -37,16 +27,12 @@ libcdt_C_la_SOURCES = dtclose.c dtdisc.c dtextract.c dtflatten.c \ libcdt_la_LDFLAGS = -version-info $(CDT_VERSION) -no-undefined libcdt_la_SOURCES = $(libcdt_C_la_SOURCES) -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -cdt.3.pdf: cdt.3.ps - $(PS2PDF) $< - -cdt.3.ps: $(srcdir)/cdt.3 - $(GROFF) -Tps -man $< >$@ -endif -endif +.3.3.pdf: + rm -f $@; pdffile=$@; psfile=$${pdffile%pdf}ps; \ + $(GROFF) -Tps -man $< > $$psfile || { rm -f $$psfile; exit 1; }; \ + $(PS2PDF) $$psfile && rm -f $$psfile || { rm -f $$psfile; exit 1; } +SUFFIXES = .3 .3.pdf -EXTRA_DIST = $(man_MANS) $(pdf) cdt.vcxproj* +EXTRA_DIST = $(man_MANS) cdt.vcxproj* -DISTCLEANFILES = $(pdf) cdt.3.ps +DISTCLEANFILES = $(pdf_DATA) diff --git a/lib/cgraph/Makefile.am b/lib/cgraph/Makefile.am index e1e96e571..0449061a3 100644 --- a/lib/cgraph/Makefile.am +++ b/lib/cgraph/Makefile.am @@ -19,16 +19,6 @@ if ENABLE_MAN_PDFS pdf_DATA = cgraph.3.pdf endif -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -pdf = $(pdf_DATA) -else -pdf = ERROR_NO_PS2PDF -endif -else -pdf = -endif - libcgraph_C_la_SOURCES = agerror.c agxbuf.c apply.c attr.c edge.c \ flatten.c graph.c grammar.y id.c imap.c io.c mem.c node.c \ obj.c pend.c rec.c refstr.c scan.l subg.c utils.c write.c @@ -45,18 +35,14 @@ scan.c: $(top_srcdir)/lib/cgraph/scan.l grammar.c grammar.h: $(top_srcdir)/lib/cgraph/grammar.y $(YACC) -Wno-yacc -dv --output=grammar.c $(top_srcdir)/lib/cgraph/grammar.y -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -cgraph.3.pdf: cgraph.3.ps - $(PS2PDF) $< - -cgraph.3.ps: $(srcdir)/cgraph.3 - $(GROFF) -Tps -man $< >$@ -endif -endif +.3.3.pdf: + rm -f $@; pdffile=$@; psfile=$${pdffile%pdf}ps; \ + $(GROFF) -Tps -man $< > $$psfile || { rm -f $$psfile; exit 1; }; \ + $(PS2PDF) $$psfile && rm -f $$psfile || { rm -f $$psfile; exit 1; } +SUFFIXES = .3 .3.pdf -EXTRA_DIST = $(man_MANS) $(pdf) cmpnd.c \ +EXTRA_DIST = $(man_MANS) cmpnd.c \ grammar.c grammar.h scan.c \ cgraph.vcxproj* -DISTCLEANFILES = $(pdf) grammar.[ch] scan.c cgraph.3.ps +DISTCLEANFILES = grammar.[ch] scan.c $(pdf_DATA) diff --git a/lib/expr/Makefile.am b/lib/expr/Makefile.am index 6f8abc6e1..3a889f785 100644 --- a/lib/expr/Makefile.am +++ b/lib/expr/Makefile.am @@ -13,14 +13,6 @@ noinst_LTLIBRARIES = libexpr_C.la man_MANS = expr.3 if ENABLE_MAN_PDFS pdf_DATA = expr.3.pdf - -if HAVE_PS2PDF -pdf = $(pdf_DATA) -else -pdf = ERROR_NO_PS2PDF -endif -else -pdf = endif libexpr_C_la_SOURCES = excc.c excontext.c exdata.c exerror.c \ @@ -45,18 +37,14 @@ y.tab.c y.tab.h: y.output y.output: $(top_srcdir)/lib/expr/exparse.y $(YACC) -Wno-yacc -dtv $(top_srcdir)/lib/expr/exparse.y -o y.tab.c -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -expr.3.pdf: expr.3.ps - $(PS2PDF) $< - -expr.3.ps: $(srcdir)/expr.3 - $(GROFF) -Tps -man $< >$@ -endif -endif +.3.3.pdf: + rm -f $@; pdffile=$@; psfile=$${pdffile%pdf}ps; \ + $(GROFF) -Tps -man $< > $$psfile || { rm -f $$psfile; exit 1; }; \ + $(PS2PDF) $$psfile && rm -f $$psfile || { rm -f $$psfile; exit 1; } +SUFFIXES = .3 .3.pdf -EXTRA_DIST = $(man_MANS) $(pdf) \ +EXTRA_DIST = $(man_MANS) \ exparse.c \ y.tab.c y.tab.h y.output expr.vcxproj* -DISTCLEANFILES = $(pdf) exparse.c y.tab.[ch] y.output expr.3.ps +DISTCLEANFILES = exparse.c y.tab.[ch] y.output $(pdf_DATA) diff --git a/lib/gvc/Makefile.am b/lib/gvc/Makefile.am index 23ccd4941..d4a8e5e5e 100644 --- a/lib/gvc/Makefile.am +++ b/lib/gvc/Makefile.am @@ -29,16 +29,6 @@ if ENABLE_MAN_PDFS pdf_DATA = gvc.3.pdf endif -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -pdf = $(pdf_DATA) -else -pdf = ERROR_NO_PS2PDF -endif -else -pdf = -endif - libgvc_C_la_SOURCES = gvrender.c gvlayout.c gvdevice.c gvloadimage.c \ gvcontext.c gvjobs.c gvevent.c gvplugin.c gvconfig.c \ gvtool_tred.c gvtextlayout.c gvusershape.c gvc.c @@ -68,16 +58,12 @@ libgvc_la_LIBADD = $(libgvc_C_la_LIBADD) \ $(EXPAT_LIBS) $(Z_LIBS) $(MATH_LIBS) libgvc_la_DEPENDENCIES = $(libgvc_C_la_DEPENDENCIES) -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -gvc.3.pdf: gvc.3.ps - $(PS2PDF) $< - -gvc.3.ps: $(srcdir)/gvc.3 - $(GROFF) -Tps -man $< >$@ -endif -endif +.3.3.pdf: + rm -f $@; pdffile=$@; psfile=$${pdffile%pdf}ps; \ + $(GROFF) -Tps -man $< > $$psfile || { rm -f $$psfile; exit 1; }; \ + $(PS2PDF) $$psfile && rm -f $$psfile || { rm -f $$psfile; exit 1; } +SUFFIXES = .3 .3.pdf -EXTRA_DIST = $(man_MANS) $(pdf) +EXTRA_DIST = $(man_MANS) -DISTCLEANFILES = $(pdf) gvc.3.ps +DISTCLEANFILES = $(pdf_DATA) diff --git a/lib/gvpr/Makefile.am b/lib/gvpr/Makefile.am index 759bad509..ccb45c55d 100644 --- a/lib/gvpr/Makefile.am +++ b/lib/gvpr/Makefile.am @@ -34,31 +34,17 @@ if ENABLE_MAN_PDFS pdf_DATA = gvpr.3.pdf endif -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -pdf = $(pdf_DATA) -else -pdf = ERROR_NO_PS2PDF -endif -else -pdf = -endif - libgvpr_C_la_SOURCES = actions.c compile.c gvpr.c gprstate.c parse.c queue.c libgvpr_C_la_DEPENDENCIES = \ $(top_builddir)/lib/expr/libexpr_C.la \ $(top_builddir)/lib/common/libcommon_C.la \ $(top_builddir)/lib/ingraphs/libingraphs_C.la -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -gvpr.3.pdf: gvpr.3.ps - $(PS2PDF) $< - -gvpr.3.ps: $(srcdir)/gvpr.3 - $(GROFF) -Tps -man $< >$@ -endif -endif +.3.3.pdf: + rm -f $@; pdffile=$@; psfile=$${pdffile%pdf}ps; \ + $(GROFF) -Tps -man $< > $$psfile || { rm -f $$psfile; exit 1; }; \ + $(PS2PDF) $$psfile && rm -f $$psfile || { rm -f $$psfile; exit 1; } +SUFFIXES = .3 .3.pdf libgvpr_la_LDFLAGS = -version-info $(GVPR_VERSION) -no-undefined libgvpr_la_SOURCES = $(libgvpr_C_la_SOURCES) @@ -74,6 +60,6 @@ if WITH_WIN32 libgvpr_la_LDFLAGS += -export-symbols-regex gvpr endif -EXTRA_DIST = $(man_MANS) $(pdf) trie.c gvprlib.vcxproj* +EXTRA_DIST = $(man_MANS) trie.c gvprlib.vcxproj* -DISTCLEANFILES = $(pdf) gvpr.3.ps +DISTCLEANFILES = $(pdf_DATA) diff --git a/lib/pack/Makefile.am b/lib/pack/Makefile.am index 013b26f71..16f1277ac 100644 --- a/lib/pack/Makefile.am +++ b/lib/pack/Makefile.am @@ -17,28 +17,16 @@ noinst_LTLIBRARIES = libpack_C.la man_MANS = pack.3 if ENABLE_MAN_PDFS pdf_DATA = pack.3.pdf - -if HAVE_PS2PDF -pdf = $(pdf_DATA) -else -pdf = ERROR_NO_PS2PDF -endif -else -pdf = endif libpack_C_la_SOURCES = ccomps.c pack.c -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -pack.3.pdf: pack.3.ps - $(PS2PDF) $< - -pack.3.ps: $(srcdir)/pack.3 - $(GROFF) -Tps -man $< >$@ -endif -endif +.3.3.pdf: + rm -f $@; pdffile=$@; psfile=$${pdffile%pdf}ps; \ + $(GROFF) -Tps -man $< > $$psfile || { rm -f $$psfile; exit 1; }; \ + $(PS2PDF) $$psfile && rm -f $$psfile || { rm -f $$psfile; exit 1; } +SUFFIXES = .3 .3.pdf -EXTRA_DIST = $(man_MANS) $(pdf) +EXTRA_DIST = $(man_MANS) -DISTCLEANFILES = $(pdf) pack.3.ps +DISTCLEANFILES = $(pdf_DATA) diff --git a/lib/pathplan/Makefile.am b/lib/pathplan/Makefile.am index 5bf3cf28b..df092ea28 100644 --- a/lib/pathplan/Makefile.am +++ b/lib/pathplan/Makefile.am @@ -18,14 +18,6 @@ pkgconfig_DATA = libpathplan.pc man_MANS = pathplan.3 if ENABLE_MAN_PDFS pdf_DATA = pathplan.3.pdf - -if HAVE_PS2PDF -pdf = $(pdf_DATA) -else -pdf = ERROR_NO_PS2PDF -endif -else -pdf = endif libpathplan_C_la_SOURCES = cvt.c inpoly.c route.c shortest.c \ @@ -35,16 +27,12 @@ libpathplan_la_LDFLAGS = -version-info $(PATHPLAN_VERSION) -no-undefined libpathplan_la_SOURCES = $(libpathplan_C_la_SOURCES) libpathplan_la_LIBADD = $(MATH_LIBS) -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -pathplan.3.pdf: pathplan.3.ps - $(PS2PDF) $< - -pathplan.3.ps: $(srcdir)/pathplan.3 - $(GROFF) -Tps -man $< >$@ -endif -endif +.3.3.pdf: + rm -f $@; pdffile=$@; psfile=$${pdffile%pdf}ps; \ + $(GROFF) -Tps -man $< > $$psfile || { rm -f $$psfile; exit 1; }; \ + $(PS2PDF) $$psfile && rm -f $$psfile || { rm -f $$psfile; exit 1; } +SUFFIXES = .3 .3.pdf -EXTRA_DIST = $(man_MANS) $(pdf) Pathplan.vcxproj* +EXTRA_DIST = $(man_MANS) Pathplan.vcxproj* -DISTCLEANFILES = $(pdf) pathplan.3.ps +DISTCLEANFILES = $(pdf_DATA) diff --git a/lib/xdot/Makefile.am b/lib/xdot/Makefile.am index df408bc16..471a34b0a 100644 --- a/lib/xdot/Makefile.am +++ b/lib/xdot/Makefile.am @@ -13,30 +13,18 @@ pkgconfig_DATA = libxdot.pc man_MANS = xdot.3 if ENABLE_MAN_PDFS pdf_DATA = xdot.3.pdf - -if HAVE_PS2PDF -pdf = $(pdf_DATA) -else -pdf = ERROR_NO_PS2PDF -endif -else -pdf = endif libxdot_C_la_SOURCES = xdot.c libxdot_la_LDFLAGS = -version-info $(XDOT_VERSION) -no-undefined libxdot_la_SOURCES = $(libxdot_C_la_SOURCES) -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -xdot.3.pdf: xdot.3.ps - $(PS2PDF) $< - -xdot.3.ps: $(srcdir)/xdot.3 - $(GROFF) -Tps -man $< >$@ -endif -endif +.3.3.pdf: + rm -f $@; pdffile=$@; psfile=$${pdffile%pdf}ps; \ + $(GROFF) -Tps -man $< > $$psfile || { rm -f $$psfile; exit 1; }; \ + $(PS2PDF) $$psfile && rm -f $$psfile || { rm -f $$psfile; exit 1; } +SUFFIXES = .3 .3.pdf -EXTRA_DIST = $(man_MANS) $(pdf) xdot.vcxproj* +EXTRA_DIST = $(man_MANS) xdot.vcxproj* -DISTCLEANFILES = $(pdf) xdot.3.ps +DISTCLEANFILES = $(pdf_DATA) diff --git a/plugin/xlib/Makefile.am b/plugin/xlib/Makefile.am index ba32cd24d..2e5eaa7b4 100644 --- a/plugin/xlib/Makefile.am +++ b/plugin/xlib/Makefile.am @@ -19,31 +19,18 @@ pkglib_LTLIBRARIES = libgvplugin_xlib.la endif bin_SCRIPTS = vimdot man_MANS = vimdot.1 -endif -endif - if ENABLE_MAN_PDFS pdf_DATA = vimdot.1.pdf - -if HAVE_PS2PDF -pdf = $(pdf_DATA) -else -pdf = ERROR_NO_PS2PDF endif -else -pdf = -endif - -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -vimdot.1.pdf: vimdot.1.ps - $(PS2PDF) $< - -vimdot.1.ps: $(srcdir)/vimdot.1 - $(GROFF) -Tps -man $< >$@ endif endif +.1.1.pdf: + rm -f $@; pdffile=$@; psfile=$${pdffile%pdf}ps; \ + $(GROFF) -Tps -man $< > $$psfile || { rm -f $$psfile; exit 1; }; \ + $(PS2PDF) $$psfile && rm -f $$psfile || { rm -f $$psfile; exit 1; } +SUFFIXES = .1 .1.pdf + libgvplugin_xlib_C_la_SOURCES = \ gvplugin_xlib.c \ gvdevice_xlib.c @@ -64,6 +51,6 @@ vimdot: $(top_srcdir)/plugin/xlib/vimdot.sh cp $(top_srcdir)/plugin/xlib/vimdot.sh vimdot chmod +x vimdot -EXTRA_DIST = vimdot.sh vimdot.1 $(pdf) +EXTRA_DIST = vimdot.sh vimdot.1 -DISTCLEANFILES = vimdot $(pdf) vimdot.1.ps +DISTCLEANFILES = vimdot $(pdf_DATA) diff --git a/tclpkg/gdtclft/Makefile.am b/tclpkg/gdtclft/Makefile.am index 130a34fd3..89d3b8bc6 100644 --- a/tclpkg/gdtclft/Makefile.am +++ b/tclpkg/gdtclft/Makefile.am @@ -13,15 +13,6 @@ LIBS = @LIBS@ -lc AM_CFLAGS = $(TCL_CFLAGS) man = gdtclft.3tcl -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -pdf = gdtclft.3tcl.pdf -else -pdf = ERROR_NOPS2PDF -endif -else -pdf = -endif if WITH_LIBGD if WITH_TCL @@ -55,17 +46,13 @@ test: endif endif -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -gdtclft.3tcl.pdf: gdtclft.3tcl.ps - $(PS2PDF) $< - -gdtclft.3tcl.ps: $(srcdir)/gdtclft.3tcl - $(GROFF) -Tps -man $< >$@ -endif -endif +.3tcl.3tcl.pdf: + rm -f $@; pdffile=$@; psfile=$${pdffile%pdf}ps; \ + $(GROFF) -Tps -man $< > $$psfile || { rm -f $$psfile; exit 1; }; \ + $(PS2PDF) $$psfile && rm -f $$psfile || { rm -f $$psfile; exit 1; } +SUFFIXES = .3tcl .3tcl.pdf -EXTRA_DIST = $(man) $(pdf) +EXTRA_DIST = $(man) CLEANFILES = pkgIndex.tcl -DISTCLEANFILES = $(pdf) gdtclft.3tcl.ps +DISTCLEANFILES = $(pdf_DATA) diff --git a/tclpkg/gv/Makefile.am b/tclpkg/gv/Makefile.am index cdbca4ca3..2120ed054 100644 --- a/tclpkg/gv/Makefile.am +++ b/tclpkg/gv/Makefile.am @@ -404,17 +404,6 @@ endif man = gv.3sharp gv.3go gv.3guile gv.3io gv.3java gv.3lua gv.3ocaml \ gv.3perl gv.3php gv.3python gv.3r gv.3ruby gv.3tcl -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -pdf = gv.3sharp.pdf gv.3go.pdf gv.3guile.pdf gv.3io.pdf gv.3java.pdf gv.3lua.pdf \ - gv.3ocaml.pdf gv.3perl.pdf gv.3php.pdf gv.3python.pdf gv.3r.pdf gv.3ruby.pdf gv.3tcl.pdf -else -pdf = ERROR_NO_PS2PDF -endif -else -pdf = -endif - # this rule has a trailing semi-colon for the Make cache to work correctly # https://stackoverflow.com/questions/37873522/unreliable-parallel-builds-in-a-makefile-with-intermediate $(man): gv_doc_writer.intermediate ; @@ -423,87 +412,60 @@ $(man): gv_doc_writer.intermediate ; gv_doc_writer.intermediate: gv.i gv_doc_writer.tcl gv_doc_template.tcl gv_doc_langs.tcl $(TCLSH) $(srcdir)/gv_doc_writer.tcl "$(srcdir)" -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -gv.3sharp.pdf: gv.3sharp.ps - $(PS2PDF) $< - -gv.3sharp.ps: gv.3sharp - $(GROFF) -Tps -man $< >$@ - -gv.3go.pdf: gv.3go.ps - $(PS2PDF) $< - -gv.3go.ps: gv.3go - $(GROFF) -Tps -man $< >$@ - -gv.3guile.pdf: gv.3guile.ps - $(PS2PDF) $< - -gv.3guile.ps: gv.3guile - $(GROFF) -Tps -man $< >$@ - -gv.3io.pdf: gv.3io.ps - $(PS2PDF) $< - -gv.3io.ps: gv.3io - $(GROFF) -Tps -man $< >$@ - -gv.3java.pdf: gv.3java.ps - $(PS2PDF) $< - -gv.3java.ps: gv.3java - $(GROFF) -Tps -man $< >$@ - -gv.3lua.pdf: gv.3lua.ps - $(PS2PDF) $< - -gv.3lua.ps: gv.3lua - $(GROFF) -Tps -man $< >$@ +.3sharp.3sharp.pdf: + rm -f $@; pdffile=$@; psfile=$${pdffile%pdf}ps; \ + $(GROFF) -Tps -man $< > $$psfile || { rm -f $$psfile; exit 1; }; \ + $(PS2PDF) $$psfile && rm -f $$psfile || { rm -f $$psfile; exit 1; } +.3go.3go.pdf: + rm -f $@; pdffile=$@; psfile=$${pdffile%pdf}ps; \ + $(GROFF) -Tps -man $< > $$psfile || { rm -f $$psfile; exit 1; }; \ + $(PS2PDF) $$psfile && rm -f $$psfile || { rm -f $$psfile; exit 1; } +.3guile.3guile.pdf: + rm -f $@; pdffile=$@; psfile=$${pdffile%pdf}ps; \ + $(GROFF) -Tps -man $< > $$psfile || { rm -f $$psfile; exit 1; }; \ + $(PS2PDF) $$psfile && rm -f $$psfile || { rm -f $$psfile; exit 1; } +.3io.3io.pdf: + rm -f $@; pdffile=$@; psfile=$${pdffile%pdf}ps; \ + $(GROFF) -Tps -man $< > $$psfile || { rm -f $$psfile; exit 1; }; \ + $(PS2PDF) $$psfile && rm -f $$psfile || { rm -f $$psfile; exit 1; } +.3java.3java.pdf: + rm -f $@; pdffile=$@; psfile=$${pdffile%pdf}ps; \ + $(GROFF) -Tps -man $< > $$psfile || { rm -f $$psfile; exit 1; }; \ + $(PS2PDF) $$psfile && rm -f $$psfile || { rm -f $$psfile; exit 1; } +.3lua.3lua.pdf: + rm -f $@; pdffile=$@; psfile=$${pdffile%pdf}ps; \ + $(GROFF) -Tps -man $< > $$psfile || { rm -f $$psfile; exit 1; }; \ + $(PS2PDF) $$psfile && rm -f $$psfile || { rm -f $$psfile; exit 1; } +.3ocaml.3ocaml.pdf: + rm -f $@; pdffile=$@; psfile=$${pdffile%pdf}ps; \ + $(GROFF) -Tps -man $< > $$psfile || { rm -f $$psfile; exit 1; }; \ + $(PS2PDF) $$psfile && rm -f $$psfile || { rm -f $$psfile; exit 1; } +.3perl.3perl.pdf: + rm -f $@; pdffile=$@; psfile=$${pdffile%pdf}ps; \ + $(GROFF) -Tps -man $< > $$psfile || { rm -f $$psfile; exit 1; }; \ + $(PS2PDF) $$psfile && rm -f $$psfile || { rm -f $$psfile; exit 1; } +.3php.3php.pdf: + rm -f $@; pdffile=$@; psfile=$${pdffile%pdf}ps; \ + $(GROFF) -Tps -man $< > $$psfile || { rm -f $$psfile; exit 1; }; \ + $(PS2PDF) $$psfile && rm -f $$psfile || { rm -f $$psfile; exit 1; } +.3python.3python.pdf: + rm -f $@; pdffile=$@; psfile=$${pdffile%pdf}ps; \ + $(GROFF) -Tps -man $< > $$psfile || { rm -f $$psfile; exit 1; }; \ + $(PS2PDF) $$psfile && rm -f $$psfile || { rm -f $$psfile; exit 1; } +.3r.3r.pdf: + rm -f $@; pdffile=$@; psfile=$${pdffile%pdf}ps; \ + $(GROFF) -Tps -man $< > $$psfile || { rm -f $$psfile; exit 1; }; \ + $(PS2PDF) $$psfile && rm -f $$psfile || { rm -f $$psfile; exit 1; } +.3ruby.3ruby.pdf: + rm -f $@; pdffile=$@; psfile=$${pdffile%pdf}ps; \ + $(GROFF) -Tps -man $< > $$psfile || { rm -f $$psfile; exit 1; }; \ + $(PS2PDF) $$psfile && rm -f $$psfile || { rm -f $$psfile; exit 1; } +.3tcl.3tcl.pdf: + rm -f $@; pdffile=$@; psfile=$${pdffile%pdf}ps; \ + $(GROFF) -Tps -man $< > $$psfile || { rm -f $$psfile; exit 1; }; \ + $(PS2PDF) $$psfile && rm -f $$psfile || { rm -f $$psfile; exit 1; } +SUFFIXES = .3sharp .3sharp.pdf .3go .3go.pdf .3guile .3guile.pdf .3io .3io.pdf .3java .3java.pdf .3lua .3lua.pdf .3ocaml .3ocaml.pdf .3perl .3perl.pdf .3php .3php.pdf .3python .3python.pdf .3r .3r.pdf .3ruby .3ruby.pdf .3tcl .3tcl.pdf -gv.3ocaml.pdf: gv.3ocaml.ps - $(PS2PDF) $< - -gv.3ocaml.ps: gv.3ocaml - $(GROFF) -Tps -man $< >$@ - -gv.3perl.pdf: gv.3perl.ps - $(PS2PDF) $< - -gv.3perl.ps: gv.3perl - $(GROFF) -Tps -man $< >$@ - -gv.3php.pdf: gv.3php.ps - $(PS2PDF) $< - -gv.3php.ps: gv.3php - $(GROFF) -Tps -man $< >$@ - -gv.3python.pdf: gv.3python.ps - $(PS2PDF) $< - -gv.3python.ps: gv.3python - $(GROFF) -Tps -man $< >$@ - -gv.3r.pdf: gv.3r.ps - $(PS2PDF) $< - -gv.3r.ps: gv.3r - $(GROFF) -Tps -man $< >$@ - -gv.3ruby.pdf: gv.3ruby.ps - $(PS2PDF) $< - -gv.3ruby.ps: gv.3ruby - $(GROFF) -Tps -man $< >$@ - -gv.3tcl.pdf: gv.3tcl.ps - $(PS2PDF) $< - -gv.3tcl.ps: gv.3tcl - $(GROFF) -Tps -man $< >$@ -endif -endif install-data-hook: if WITH_JAVA (cd $(DESTDIR)$(pkgjavadir); $(LN_S) -f org/graphviz/libgv_java.$(JSHEXT) ../../libgv.$(JSHEXT); javac -classpath $(DESTDIR)$(libjavadir) gv.java;) @@ -638,7 +600,7 @@ test_tcl: libgv_tcl.la ln -fs ../$(srcdir)/*.gv ../$(srcdir)/*.tcl .; \ $(TCLSH) ./test.tcl) -EXTRA_DIST = $(man) $(pdf) gv_doc_*.tcl +EXTRA_DIST = $(man) gv_doc_*.tcl CLEANFILES = test_*/* pkgIndex.tcl \ gv_sharp.cpp $(SHARP_data) \ @@ -656,6 +618,4 @@ CLEANFILES = test_*/* pkgIndex.tcl \ gv_R.cpp $(R_data) \ gv_ruby.cpp $(RUBY_data) \ gv_tcl.cpp $(TCL_data) pkgIndex.tcl -DISTCLEANFILES = gv_*.n gv_*.pdf gv.3sharp.ps gv.3go.ps gv.3guile.ps \ - gv.3io.ps gv.3java.ps gv.3lua.ps gv.3ocaml.ps gv.3perl.ps gv.3php.ps \ - gv.3python.ps gv.3r.ps gv.3ruby.ps gv.3tcl.ps +DISTCLEANFILES = $(pdf_DATA) diff --git a/tclpkg/tcldot/Makefile.am b/tclpkg/tcldot/Makefile.am index be37a9f93..98be9832e 100644 --- a/tclpkg/tcldot/Makefile.am +++ b/tclpkg/tcldot/Makefile.am @@ -24,15 +24,6 @@ LIBS = -lc $(TCL_STUB_LIB_SPEC) AM_CFLAGS = $(TCL_CFLAGS) man = tcldot.3tcl -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -pdf = tcldot.3tcl.pdf -else -pdf = ERROR_NO_PS2PDF -endif -else -pdf = -endif html = tcldot.html if WITH_TCL @@ -118,17 +109,13 @@ pkgIndex.tcl: libtcldot.la sh $(top_srcdir)/tclpkg/mkpkgindex.sh libtcldot.la Tcldot $(VERSION) endif -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -tcldot.3tcl.pdf: tcldot.3tcl.ps - $(PS2PDF) $< - -tcldot.3tcl.ps: $(srcdir)/tcldot.3tcl - $(GROFF) -Tps -man $< >$@ -endif -endif +.3tcl.3tcl.pdf: + rm -f $@; pdffile=$@; psfile=$${pdffile%pdf}ps; \ + $(GROFF) -Tps -man $< > $$psfile || { rm -f $$psfile; exit 1; }; \ + $(PS2PDF) $$psfile && rm -f $$psfile || { rm -f $$psfile; exit 1; } +SUFFIXES = .3tcl .3tcl.pdf -EXTRA_DIST = $(man) $(pdf) $(html) README README.Tkspline +EXTRA_DIST = $(man) $(html) README README.Tkspline CLEANFILES = pkgIndex.tcl -DISTCLEANFILES = $(pdf) tcldot.3tcl.ps +DISTCLEANFILES = $(pdf_DATA) diff --git a/tclpkg/tkspline/Makefile.am b/tclpkg/tkspline/Makefile.am index 1570311c1..6b746a79a 100644 --- a/tclpkg/tkspline/Makefile.am +++ b/tclpkg/tkspline/Makefile.am @@ -5,15 +5,6 @@ SUBDIRS = demo pkgtcldir = $(pkglibdir)/tcl man = tkspline.3tk -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -pdf = tkspline.3tk.pdf -else -pdf = ERROR_NO_PS2PDF -endif -else -pdf = -endif # If all else fails there is a local copy of tkInt.h in tkstubs/ AM_CPPFLAGS = \ @@ -47,17 +38,13 @@ pkgIndex.tcl: libtkspline.la sh $(top_srcdir)/tclpkg/mkpkgindex.sh libtkspline.la Tkspline $(VERSION) endif -if ENABLE_MAN_PDFS -if HAVE_PS2PDF -tkspline.3tk.pdf: tkspline.3tk.ps - $(PS2PDF) $< - -tkspline.3tk.ps: $(srcdir)/tkspline.3tk - $(GROFF) -Tps -man $< >$@ -endif -endif +.3tk.3tk.pdf: + rm -f $@; pdffile=$@; psfile=$${pdffile%pdf}ps; \ + $(GROFF) -Tps -man $< > $$psfile || { rm -f $$psfile; exit 1; }; \ + $(PS2PDF) $$psfile && rm -f $$psfile || { rm -f $$psfile; exit 1; } +SUFFIXES = .3tk .3tk.pdf -EXTRA_DIST = $(man) $(pdf) dllEntry.c +EXTRA_DIST = $(man) dllEntry.c CLEANFILES = pkgIndex.tcl -DISTCLEANFILES = $(pdf) tkspline.3tk.ps +DISTCLEANFILES = $(pdf_DATA)