Makefile fixes related to installation.

'make install' and 'make uninstall' should now work correctly, placing
the documentation in the proper places.  Any directories needed will be
created.
This commit is contained in:
John "Elwin" Edwards 2016-02-26 17:30:30 -05:00
parent c6f7d67623
commit f5c2898524
7 changed files with 173 additions and 160 deletions

View file

@ -76,19 +76,22 @@ docs: $(DOCS)
$(PROGRAM).doc: rogue.nr
if test "x$(GROFF)" != "x" ; then \
$(GROFF) -P-c -P-b -P-u -t -mm -Tascii rogue.nr >$(PROGRAM).doc ;\
elif test "x$(NROFF)" != "x" -a "x$(TBL)" != "x" -a "x$(COLCRT)" != "x" ; then \
elif test "x$(NROFF)" != "x" && test "x$(TBL)" != "x" && test "x$(COLCRT)" != "x" ; then \
$(TBL) rogue.nr | $(NROFF) -mm | $(COLCRT) - > $(PROGRAM).doc ;\
fi
install: $(PROGRAM)
-touch test
-if test ! -f $(DESTDIR)$(SCOREFILE) ; \
then $(INSTALL) -m 0664 test $(DESTDIR)$(SCOREFILE) ; fi
-if test "x$(LOGFILE)" != "x" && test ! -f $(DESTDIR)$(LOGFILE) ; then \
$(INSTALL) -m 0664 test $(DESTDIR)$(LOGFILE) ; fi
-if test "x$(SAVEDIR)" != "x" && test ! -d $(DESTDIR)$(SAVEDIR) ; then \
mkdir -p $(DESTDIR)$(SAVEDIR) ; fi
-$(INSTALL) -m 0755 $(PROGRAM) $(DESTDIR)$(bindir)/$(PROGRAM)
install: all
touch test
if test ! -f $(DESTDIR)$(SCOREFILE) ; then \
mkdir -p `dirname $(DESTDIR)$(SCOREFILE)` ; \
$(INSTALL) -m 0664 test $(DESTDIR)$(SCOREFILE) ; fi
if test "x$(LOGFILE)" != "x" && test ! -f $(DESTDIR)$(LOGFILE) ; then \
mkdir -p `dirname $(DESTDIR)$(LOGFILE)` ; \
$(INSTALL) -m 0664 test $(DESTDIR)$(LOGFILE) ; fi
if test "x$(SAVEDIR)" != "x" && test ! -d $(DESTDIR)$(SAVEDIR) ; then \
mkdir -p $(DESTDIR)$(SAVEDIR) ; fi
mkdir -p $(DESTDIR)$(bindir)
$(INSTALL) -m 0755 $(PROGRAM) $(DESTDIR)$(bindir)/$(PROGRAM)
-if test "x$(GROUPOWNER)" != "x" ; then \
chgrp $(GROUPOWNER) $(DESTDIR)$(SCOREFILE) ; \
chgrp $(GROUPOWNER) $(DESTDIR)$(LOGFILE) ; \
@ -98,21 +101,18 @@ install: $(PROGRAM)
chmod 0464 $(DESTDIR)$(SCOREFILE) ; \
chmod 0464 $(DESTDIR)$(LOGFILE) ; \
chmod 0775 $(DESTDIR)$(SAVEDIR) ; \
fi
-if test ! -d $(DESTDIR)$(docdir) ; \
fi
if test ! -d $(DESTDIR)$(docdir) ; \
then mkdir -p $(DESTDIR)$(docdir) ; fi
-$(INSTALL) -m 0644 LICENSE.TXT $(DESTDIR)$(docdir)/LICENSE.TXT
-$(INSTALL) -m 0644 rogue.nr $(DESTDIR)$(docdir)/$(PROGRAM).nr
-$(INSTALL) -m 0644 $(PROGRAM).doc $(DESTDIR)$(docdir)/$(PROGRAM).doc
-$(RM) test
$(INSTALL) -m 0644 LICENSE.TXT $(DESTDIR)$(docdir)/LICENSE.TXT
$(INSTALL) -m 0644 rogue.nr $(DESTDIR)$(docdir)/$(PROGRAM).nr
$(INSTALL) -m 0644 $(PROGRAM).doc $(DESTDIR)$(docdir)/$(PROGRAM).doc
$(RM) test
uninstall:
-$(RM) $(DESTDIR)$(bindir)/$(PROGRAM)
-$(RM) $(DESTDIR)$(docdir)/LICENSE.TXT
-$(RM) $(DESTDIR)$(docdir)/$(PROGRAM).nr
-$(RM) $(DESTDIR)$(docdir)/$(PROGRAM).doc
-rmdir $(DESTDIR)$(docdir)
$(RM) $(DESTDIR)$(bindir)/$(PROGRAM)
$(RM) -r $(DESTDIR)$(docdir)
reinstall: uninstall install
count: