# HG changeset patch # User John "Elwin" Edwards # Date 1504956323 14400 # Node ID aa0eefcd7df6ce9489c965a1ef5ef326bc313974 # Parent 603e8a99c8597c3bedfbaf8ffa774e764e4e7e0f UltraRogue: build and install documentation in the Makefile. diff -r 603e8a99c859 -r aa0eefcd7df6 urogue/Makefile.in --- a/urogue/Makefile.in Tue Sep 05 21:03:26 2017 -0400 +++ b/urogue/Makefile.in Sat Sep 09 07:25:23 2017 -0400 @@ -9,6 +9,7 @@ # DISTNAME=urogue1.0.7 +PACKAGE_TARNAME=@PACKAGE_TARNAME@ HDRS = dict.h dictutil.h rogue.h OBJS = armor.o \ @@ -110,6 +111,8 @@ xcrypt.c MISC= Makefile README LICENSE.TXT history.txt TODO +DOCS = $(PROGRAM).cat +RAWDOCS = README LICENSE.TXT history.txt TODO CC = @CC@ CPPFLAGS=@DEFS@ @@ -117,6 +120,9 @@ CRLIB = @LIBS@ RM = rm -f TAR = tar +GROFF=@GROFF@ +NROFF=@NROFF@ +COLCRT=@COLCRT@ INSTALL=@INSTALL@ SCOREFILE=@SCOREFILE@ @@ -128,18 +134,33 @@ DESTDIR= prefix=@prefix@ exec_prefix=@exec_prefix@ +datarootdir=@datarootdir@ bindir=@bindir@ +docdir=@docdir@ +mandir=@mandir@ +man6dir=$(mandir)/man6 .c.o: $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $*.o $*.c +all: $(PROGRAM) docs + $(PROGRAM): $(OBJS) $(MAKEFILE) $(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(CRLIB) -o $@ clean: - rm -f $(OBJS) urogue a.out core *.map urogue.exe urogue.cat + rm -f $(OBJS) urogue a.out core *.map urogue.exe $(PROGRAM).cat + +docs: $(DOCS) -install: $(PROGRAM) +$(PROGRAM).cat: urogue.6 + if test "x$(GROFF)" != "x" ; then \ + $(GROFF) -P-c -P-b -P-u -Tascii -man urogue.6 > $(PROGRAM).cat ;\ + elif test "x$(NROFF)" != "x" && test "x$(COLCRT)" != "x" ; then \ + $(NROFF) -man urogue.6 | $(COLCRT) - > $(PROGRAM).cat ;\ + fi + +install: all touch test if test ! -f $(DESTDIR)$(SCOREFILE) ; then \ mkdir -p `dirname $(DESTDIR)$(SCOREFILE)` ; \ @@ -165,11 +186,17 @@ chmod 0775 $(DESTDIR)$(SAVEDIR) ; \ chmod 0775 $(DESTDIR)$(CHARDIR) ; \ fi + mkdir -p $(DESTDIR)$(man6dir) + $(INSTALL) -m 0644 urogue.6 $(DESTDIR)$(man6dir)/$(PROGRAM).6 + mkdir -p $(DESTDIR)$(docdir) + $(INSTALL) -m 0644 $(DOCS) $(RAWDOCS) $(DESTDIR)$(docdir) $(RM) test uninstall: $(RM) $(DESTDIR)$(bindir)/$(PROGRAM) - + $(RM) $(DESTDIR)$(man6dir)/$(PROGRAM).6 + $(RM) -r $(DESTDIR)$(docdir) + reinstall: uninstall install dist.src: diff -r 603e8a99c859 -r aa0eefcd7df6 urogue/configure.ac --- a/urogue/configure.ac Tue Sep 05 21:03:26 2017 -0400 +++ b/urogue/configure.ac Sat Sep 09 07:25:23 2017 -0400 @@ -30,10 +30,9 @@ AC_PROG_INSTALL # Programs to process the documentation -#AC_CHECK_PROG([NROFF], [nroff], [nroff],) -#AC_CHECK_PROG([GROFF], [groff], [groff],) -#AC_CHECK_PROG([COLCRT], [colcrt], [colcrt],) -#AC_CHECK_PROG([TBL], [tbl], [tbl],) +AC_CHECK_PROG([NROFF], [nroff], [nroff],) +AC_CHECK_PROG([GROFF], [groff], [groff],) +AC_CHECK_PROG([COLCRT], [colcrt], [colcrt],) AC_ARG_WITH(program-name, AC_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="urogue"] ) PROGRAM=$progname