comparison srogue/Makefile.in @ 224:4d0f53998e8a

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.
author John "Elwin" Edwards
date Fri, 26 Feb 2016 17:30:30 -0500
parents 0e99eade579c
children 455464db5800
comparison
equal deleted inserted replaced
223:0e99eade579c 224:4d0f53998e8a
74 docs: $(DOCS) 74 docs: $(DOCS)
75 75
76 $(PROGRAM).doc: rogue.nr 76 $(PROGRAM).doc: rogue.nr
77 if test "x$(GROFF)" != "x" ; then \ 77 if test "x$(GROFF)" != "x" ; then \
78 $(GROFF) -P-c -P-b -P-u -t -mm -Tascii rogue.nr >$(PROGRAM).doc ;\ 78 $(GROFF) -P-c -P-b -P-u -t -mm -Tascii rogue.nr >$(PROGRAM).doc ;\
79 elif test "x$(NROFF)" != "x" -a "x$(TBL)" != "x" -a "x$(COLCRT)" != "x" ; then \ 79 elif test "x$(NROFF)" != "x" && test "x$(TBL)" != "x" && test "x$(COLCRT)" != "x" ; then \
80 $(TBL) rogue.nr | $(NROFF) -mm | $(COLCRT) - > $(PROGRAM).doc ;\ 80 $(TBL) rogue.nr | $(NROFF) -mm | $(COLCRT) - > $(PROGRAM).doc ;\
81 fi 81 fi
82 82
83 install: $(PROGRAM) 83 install: all
84 -touch test 84 touch test
85 -if test ! -f $(DESTDIR)$(SCOREFILE) ; \ 85 if test ! -f $(DESTDIR)$(SCOREFILE) ; then \
86 then $(INSTALL) -m 0664 test $(DESTDIR)$(SCOREFILE) ; fi 86 mkdir -p `dirname $(DESTDIR)$(SCOREFILE)` ; \
87 -if test "x$(LOGFILE)" != "x" && test ! -f $(DESTDIR)$(LOGFILE) ; then \ 87 $(INSTALL) -m 0664 test $(DESTDIR)$(SCOREFILE) ; fi
88 $(INSTALL) -m 0664 test $(DESTDIR)$(LOGFILE) ; fi 88 if test "x$(LOGFILE)" != "x" && test ! -f $(DESTDIR)$(LOGFILE) ; then \
89 -if test "x$(SAVEDIR)" != "x" && test ! -d $(DESTDIR)$(SAVEDIR) ; then \ 89 mkdir -p `dirname $(DESTDIR)$(LOGFILE)` ; \
90 mkdir -p $(DESTDIR)$(SAVEDIR) ; fi 90 $(INSTALL) -m 0664 test $(DESTDIR)$(LOGFILE) ; fi
91 -$(INSTALL) -m 0755 $(PROGRAM) $(DESTDIR)$(bindir)/$(PROGRAM) 91 if test "x$(SAVEDIR)" != "x" && test ! -d $(DESTDIR)$(SAVEDIR) ; then \
92 mkdir -p $(DESTDIR)$(SAVEDIR) ; fi
93 mkdir -p $(DESTDIR)$(bindir)
94 $(INSTALL) -m 0755 $(PROGRAM) $(DESTDIR)$(bindir)/$(PROGRAM)
92 -if test "x$(GROUPOWNER)" != "x" ; then \ 95 -if test "x$(GROUPOWNER)" != "x" ; then \
93 chgrp $(GROUPOWNER) $(DESTDIR)$(SCOREFILE) ; \ 96 chgrp $(GROUPOWNER) $(DESTDIR)$(SCOREFILE) ; \
94 chgrp $(GROUPOWNER) $(DESTDIR)$(LOGFILE) ; \ 97 chgrp $(GROUPOWNER) $(DESTDIR)$(LOGFILE) ; \
95 chgrp $(GROUPOWNER) $(DESTDIR)$(bindir)/$(PROGRAM) ; \ 98 chgrp $(GROUPOWNER) $(DESTDIR)$(bindir)/$(PROGRAM) ; \
96 chgrp $(GROUPOWNER) $(DESTDIR)$(SAVEDIR) ; \ 99 chgrp $(GROUPOWNER) $(DESTDIR)$(SAVEDIR) ; \
97 chmod 02755 $(DESTDIR)$(bindir)/$(PROGRAM) ; \ 100 chmod 02755 $(DESTDIR)$(bindir)/$(PROGRAM) ; \
98 chmod 0464 $(DESTDIR)$(SCOREFILE) ; \ 101 chmod 0464 $(DESTDIR)$(SCOREFILE) ; \
99 chmod 0464 $(DESTDIR)$(LOGFILE) ; \ 102 chmod 0464 $(DESTDIR)$(LOGFILE) ; \
100 chmod 0775 $(DESTDIR)$(SAVEDIR) ; \ 103 chmod 0775 $(DESTDIR)$(SAVEDIR) ; \
101 fi 104 fi
102 -if test ! -d $(DESTDIR)$(docdir) ; \ 105 if test ! -d $(DESTDIR)$(docdir) ; \
103 then mkdir -p $(DESTDIR)$(docdir) ; fi 106 then mkdir -p $(DESTDIR)$(docdir) ; fi
104 -$(INSTALL) -m 0644 LICENSE.TXT $(DESTDIR)$(docdir)/LICENSE.TXT 107 $(INSTALL) -m 0644 LICENSE.TXT $(DESTDIR)$(docdir)/LICENSE.TXT
105 -$(INSTALL) -m 0644 rogue.nr $(DESTDIR)$(docdir)/$(PROGRAM).nr 108 $(INSTALL) -m 0644 rogue.nr $(DESTDIR)$(docdir)/$(PROGRAM).nr
106 -$(INSTALL) -m 0644 $(PROGRAM).doc $(DESTDIR)$(docdir)/$(PROGRAM).doc 109 $(INSTALL) -m 0644 $(PROGRAM).doc $(DESTDIR)$(docdir)/$(PROGRAM).doc
107 -$(RM) test 110 $(RM) test
108 111
109 uninstall: 112 uninstall:
110 -$(RM) $(DESTDIR)$(bindir)/$(PROGRAM) 113 $(RM) $(DESTDIR)$(bindir)/$(PROGRAM)
111 -$(RM) $(DESTDIR)$(docdir)/LICENSE.TXT 114 $(RM) -r $(DESTDIR)$(docdir)
112 -$(RM) $(DESTDIR)$(docdir)/$(PROGRAM).nr 115
113 -$(RM) $(DESTDIR)$(docdir)/$(PROGRAM).doc
114 -rmdir $(DESTDIR)$(docdir)
115
116 reinstall: uninstall install 116 reinstall: uninstall install
117 117
118 count: 118 count:
119 wc -l $(HDRS) $(CFILES) 119 wc -l $(HDRS) $(CFILES)
120 120