From a838d5143dfd2909155dac111a5ca6c8ce7f0216 Mon Sep 17 00:00:00 2001 From: Cary R Date: Sun, 8 Feb 2026 22:21:26 -0800 Subject: [PATCH] cleanup Makefile and add complete man PDF generation --- Makefile.in | 20 ++++++++++++++------ configure.ac | 1 + driver/Makefile.in | 10 +++++----- vvp/Makefile.in | 12 ++++++------ 4 files changed, 26 insertions(+), 17 deletions(-) diff --git a/Makefile.in b/Makefile.in index 7ad982627..9d594101e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -89,6 +89,7 @@ LEX = @LEX@ YACC = @YACC@ MAN = @MAN@ PS2PDF = @PS2PDF@ +GROFF = @GROFF@ GIT = @GIT@ ifeq (@srcdir@,.) @@ -275,17 +276,24 @@ lexor.cc: $(srcdir)/lexor.lex lexor_keyword.o: lexor_keyword.cc parse.h lexor_keyword.cc: $(srcdir)/lexor_keyword.gperf - gperf -o -i 7 -C -k 1-4,6,9,$$ -H keyword_hash -N check_identifier -t $(srcdir)/lexor_keyword.gperf > lexor_keyword.cc || (rm -f lexor_keyword.cc ; false) + gperf -o -i 7 -C -k 1-4,6,9,$$ -H keyword_hash -N check_identifier -t $< > $@ || (rm -f $@ ; false) iverilog-vpi.man: $(srcdir)/iverilog-vpi.man.in version.exe - ./version.exe `head -1 $(srcdir)/iverilog-vpi.man.in`'\n' > $@ - tail -n +2 $(srcdir)/iverilog-vpi.man.in >> $@ + ./version.exe `head -1 $<`'\n' > $@ + tail -n +2 $< >> $@ -iverilog-vpi.ps: iverilog-vpi.man - $(MAN) -t ./iverilog-vpi.man > iverilog-vpi.ps +iverilog-vpi.ps: ./iverilog-vpi.man + $(MAN) -t $< > $@ iverilog-vpi.pdf: iverilog-vpi.ps - $(PS2PDF) iverilog-vpi.ps iverilog-vpi.pdf + $(PS2PDF) $< $@ + +iverilog_man.ps: driver/iverilog.man vvp/vvp.man iverilog-vpi.man + $(GROFF) -man -rC1 -rD1 -T ps $^ > $@ + +iverilog_man.pdf: iverilog_man.ps ./version.exe + $(PS2PDF) $< $@ + cp $@ iverilog_man_`./version.exe %M_%n`.pdf # For VERSION_TAG in driver/main.c, first try git-describe, then look for a # release_tag.h file in the source tree (included in snapshots and releases), diff --git a/configure.ac b/configure.ac index 8188f10f5..023753457 100644 --- a/configure.ac +++ b/configure.ac @@ -26,6 +26,7 @@ AC_CHECK_TOOL(WINDRES,windres,false) AC_CHECK_PROGS(XGPERF,gperf,none) AC_CHECK_PROGS(MAN,man,none) AC_CHECK_PROGS(PS2PDF,ps2pdf,none) +AC_CHECK_PROGS(GROFF,groff,none) AC_CHECK_PROGS(GIT,git,none) if test "$XGPERF" = "none" then diff --git a/driver/Makefile.in b/driver/Makefile.in index 586288352..77c776406 100644 --- a/driver/Makefile.in +++ b/driver/Makefile.in @@ -103,14 +103,14 @@ main.o: main.c globals.h $(srcdir)/../version_base.h ../version_tag.h Makefile cflexor.o: cflexor.c cfparse.h iverilog.man: $(srcdir)/iverilog.man.in ../version.exe - ../version.exe `head -1 $(srcdir)/iverilog.man.in`'\n' > $@ - tail -n +2 $(srcdir)/iverilog.man.in >> $@ + ../version.exe `head -1 $<`'\n' > $@ + tail -n +2 $< >> $@ -iverilog.ps: iverilog.man - $(MAN) -t ./iverilog.man > iverilog.ps +iverilog.ps: ./iverilog.man + $(MAN) -t $< > $@ iverilog.pdf: iverilog.ps - $(PS2PDF) iverilog.ps iverilog.pdf + $(PS2PDF) $< $@ ifeq (@MINGW32@,yes) ifeq ($(MAN),none) diff --git a/vvp/Makefile.in b/vvp/Makefile.in index c436ff1b2..7df910a37 100644 --- a/vvp/Makefile.in +++ b/vvp/Makefile.in @@ -183,17 +183,17 @@ parse%cc parse%h: $(srcdir)/parse%y $(YACC) --verbose -t --defines=parse.h -o parse.cc $< lexor.cc: $(srcdir)/lexor.lex - $(LEX) -s -olexor.cc $(srcdir)/lexor.lex + $(LEX) -s -o$@ $< vvp.man: $(srcdir)/vvp.man.in ../version.exe - ../version.exe `head -1 $(srcdir)/vvp.man.in`'\n' > $@ - tail -n +2 $(srcdir)/vvp.man.in >> $@ + ../version.exe `head -1 $<`'\n' > $@ + tail -n +2 $< >> $@ -vvp.ps: vvp.man - $(MAN) -t ./vvp.man > vvp.ps +vvp.ps: ./vvp.man + $(MAN) -t $< > $@ vvp.pdf: vvp.ps - $(PS2PDF) vvp.ps vvp.pdf + $(PS2PDF) $< $@ ifeq (@MINGW32@,yes) ifeq ($(MAN),none)