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:
parent
c6f7d67623
commit
f5c2898524
7 changed files with 173 additions and 160 deletions
|
|
@ -49,8 +49,9 @@ CFILES= vers.c armor.c chase.c command.c daemon.c daemons.c fight.c \
|
|||
MISC_C=
|
||||
DOCSRC= rogue.6 rogue.r
|
||||
DOCS = $(PROGRAM).doc $(PROGRAM).cat
|
||||
MISC = Makefile $(MISC_C) LICENSE.TXT $(PROGRAM).sln $(PROGRAM).vcproj $(DOCS)\
|
||||
$(DOCSRC) rogue36.html readme36.html
|
||||
RAWDOCS = LICENSE.TXT rogue36.html readme36.html
|
||||
MISC = Makefile $(MISC_C) $(PROGRAM).sln $(PROGRAM).vcproj $(RAWDOCS) $(DOCS)\
|
||||
$(DOCSRC)
|
||||
|
||||
CC = gcc
|
||||
CPPFLAGS =@DEFS@
|
||||
|
|
@ -88,26 +89,29 @@ docs: $(DOCS)
|
|||
$(PROGRAM).doc: rogue.r
|
||||
if test "x$(GROFF)" != "x" ; then \
|
||||
$(GROFF) -P-c -P-b -P-u -t -ms -Tutf8 rogue.r > $(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.r | $(NROFF) -ms | $(COLCRT) - > $(PROGRAM).doc ;\
|
||||
fi
|
||||
|
||||
$(PROGRAM).cat: rogue.6
|
||||
if test "x$(GROFF)" != "x" ; then \
|
||||
$(GROFF) -P-c -P-b -P-u -Tascii -man rogue.6 > $(PROGRAM).cat ;\
|
||||
elif test "x$(NROFF)" != "x" -a "x$(COLCRT)" != "x" ; then \
|
||||
elif test "x$(NROFF)" != "x" && test "x$(COLCRT)" != "x" ; then \
|
||||
$(NROFF) -man rogue.6 | $(COLCRT) - > $(PROGRAM).cat ;\
|
||||
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) ; \
|
||||
|
|
@ -117,26 +121,22 @@ install: $(PROGRAM)
|
|||
chmod 0464 $(DESTDIR)$(SCOREFILE) ; \
|
||||
chmod 0464 $(DESTDIR)$(LOGFILE) ; \
|
||||
chmod 0775 $(DESTDIR)$(SAVEDIR) ; \
|
||||
fi
|
||||
-if test -d $(DESTDIR)$(man6dir) ; \
|
||||
then $(INSTALL) -m 0644 rogue.6 $(DESTDIR)$(man6dir)/$(PROGRAM).6 ; fi
|
||||
-if test ! -d $(DESTDIR)$(man6dir) ; \
|
||||
then $(INSTALL) -m 0644 rogue.6 $(DESTDIR)$(mandir)/$(PROGRAM).6 ; fi
|
||||
-if test ! -d $(DESTDIR)$(docdir) ; \
|
||||
fi
|
||||
if test ! -d $(DESTDIR)$(man6dir) && test -d $(DESTDIR)$(mandir) ; \
|
||||
then $(INSTALL) -m 0644 rogue.6 $(DESTDIR)$(mandir)/$(PROGRAM).6 ; \
|
||||
else mkdir -p $(DESTDIR)$(man6dir) ; \
|
||||
$(INSTALL) -m 0644 rogue.6 $(DESTDIR)$(man6dir)/$(PROGRAM).6 ; 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.r $(DESTDIR)$(docdir)/$(PROGRAM).r
|
||||
-$(INSTALL) -m 0644 $(PROGRAM).doc $(DESTDIR)$(docdir)/$(PROGRAM).doc
|
||||
-$(INSTALL) -m 0644 $(PROGRAM).cat $(DESTDIR)$(docdir)/$(PROGRAM).cat
|
||||
-$(RM) test
|
||||
$(INSTALL) -m 0644 rogue.r $(DESTDIR)$(docdir)/$(PROGRAM).r
|
||||
$(INSTALL) -m 0644 $(DOCS) $(RAWDOCS) $(DESTDIR)$(docdir)
|
||||
$(RM) test
|
||||
|
||||
uninstall:
|
||||
-$(RM) $(DESTDIR)$(bindir)/$(PROGRAM)
|
||||
-$(RM) $(DESTDIR)$(man6dir)/$(PROGRAM).6
|
||||
-$(RM) $(DESTDIR)$(docdir)/$(PROGRAM).r
|
||||
-$(RM) $(DESTDIR)$(docdir)/$(PROGRAM).doc
|
||||
-$(RM) $(DESTDIR)$(docdir)/$(PROGRAM).cat
|
||||
-$(RMDIR) $(DESTDIR)$(docdir)$(PROGRAM)
|
||||
$(RM) $(DESTDIR)$(bindir)/$(PROGRAM)
|
||||
$(RM) $(DESTDIR)$(man6dir)/$(PROGRAM).6
|
||||
$(RM) $(DESTDIR)$(mandir)/$(PROGRAM).6
|
||||
$(RM) -r $(DESTDIR)$(docdir)
|
||||
|
||||
reinstall: uninstall install
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue