UltraRogue: build and install documentation in the Makefile.

This commit is contained in:
John "Elwin" Edwards 2017-09-09 07:25:23 -04:00
parent 3a9054acbf
commit b521be16e8
2 changed files with 33 additions and 7 deletions

View file

@ -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 @@ CFILES = armor.c \
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 @@ CFLAGS=
CRLIB = @LIBS@
RM = rm -f
TAR = tar
GROFF=@GROFF@
NROFF=@NROFF@
COLCRT=@COLCRT@
INSTALL=@INSTALL@
SCOREFILE=@SCOREFILE@
@ -128,18 +134,33 @@ GROUPOWNER=@GROUPOWNER@
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
install: $(PROGRAM)
docs: $(DOCS)
$(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,10 +186,16 @@ install: $(PROGRAM)
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

View file

@ -30,10 +30,9 @@ AC_CHECK_FUNCS([erasechar killchar alarm getpass memset setenv strchr nlist _spa
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