comparison rogue5/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 4960be2c8f3e
comparison
equal deleted inserted replaced
223:0e99eade579c 224:4d0f53998e8a
180 $(CC) -O -c $(SF) $*.c 180 $(CC) -O -c $(SF) $*.c
181 181
182 $(PROGRAM).doc: rogue.me 182 $(PROGRAM).doc: rogue.me
183 if test "x$(GROFF)" != "x" ; then \ 183 if test "x$(GROFF)" != "x" ; then \
184 $(GROFF) -P-c -P-b -P-u -t -me -Tutf8 rogue.me > $(PROGRAM).doc ;\ 184 $(GROFF) -P-c -P-b -P-u -t -me -Tutf8 rogue.me > $(PROGRAM).doc ;\
185 elif test "x$(NROFF)" != "x" -a "x$(TBL)" != "x" -a "x$(COLCRT)" != "x" ; then \ 185 elif test "x$(NROFF)" != "x" && test "x$(TBL)" != "x" && test "x$(COLCRT)" != "x" ; then \
186 tbl rogue.me | $(NROFF) -me | colcrt - > $(PROGRAM).doc ;\ 186 tbl rogue.me | $(NROFF) -me | colcrt - > $(PROGRAM).doc ;\
187 fi 187 fi
188 188
189 #$(PROGRAM).html: rogue.me 189 #$(PROGRAM).html: rogue.me
190 # if test "x$(GROFF)" != "x" ; then \ 190 # if test "x$(GROFF)" != "x" ; then \
192 # fi 192 # fi
193 193
194 $(PROGRAM).cat: rogue.6 194 $(PROGRAM).cat: rogue.6
195 if test "x$(GROFF)" != "x" ; then \ 195 if test "x$(GROFF)" != "x" ; then \
196 $(GROFF) -P-c -P-b -P-u -Tascii -man rogue.6 > $(PROGRAM).cat ;\ 196 $(GROFF) -P-c -P-b -P-u -Tascii -man rogue.6 > $(PROGRAM).cat ;\
197 elif test "x$(NROFF)" != "x" -a "x$(COLCRT)" != "x" ; then \ 197 elif test "x$(NROFF)" != "x" && test "x$(COLCRT)" != "x" ; then \
198 $(NROFF) -man rogue.6 | $(COLCRT) - > $(PROGRAM).cat ;\ 198 $(NROFF) -man rogue.6 | $(COLCRT) - > $(PROGRAM).cat ;\
199 fi 199 fi
200 200
201 dist: clean $(PROGRAM) 201 dist: clean $(PROGRAM)
202 tar cf $(DISTFILE).tar $(PROGRAM) LICENSE.TXT $(DOCS) 202 tar cf $(DISTFILE).tar $(PROGRAM) LICENSE.TXT $(DOCS)
203 gzip -f $(DISTFILE).tar 203 gzip -f $(DISTFILE).tar
204 204
205 install: all 205 install: all
206 -$(TOUCH) test 206 $(TOUCH) test
207 -if test ! -f $(DESTDIR)$(SCOREFILE) ; then $(INSTALL) -m 0664 test $(DESTDIR)$(SCOREFILE) ; fi 207 if test ! -f $(DESTDIR)$(SCOREFILE) ; then \
208 -if test "x$(LOGFILE)" != "x" && test ! -f $(DESTDIR)$(LOGFILE) ; then \ 208 $(MKDIR) -p `dirname $(DESTDIR)$(SCOREFILE)` ; \
209 $(INSTALL) -m 0664 test $(DESTDIR)$(LOGFILE) ; fi 209 $(INSTALL) -m 0664 test $(DESTDIR)$(SCOREFILE) ; fi
210 -if test "x$(SAVEDIR)" != "x" && test ! -d $(DESTDIR)$(SAVEDIR) ; then \ 210 if test "x$(LOGFILE)" != "x" && test ! -f $(DESTDIR)$(LOGFILE) ; then \
211 $(MKDIR) -p $(DESTDIR)$(SAVEDIR) ; fi 211 $(MKDIR) -p `dirname $(DESTDIR)$(LOGFILE)` ; \
212 -$(INSTALL) -m 0755 $(PROGRAM) $(DESTDIR)$(bindir)/$(PROGRAM) 212 $(INSTALL) -m 0664 test $(DESTDIR)$(LOGFILE) ; fi
213 if test "x$(SAVEDIR)" != "x" && test ! -d $(DESTDIR)$(SAVEDIR) ; then \
214 $(MKDIR) -p $(DESTDIR)$(SAVEDIR) ; fi
215 $(MKDIR) -p $(DESTDIR)$(bindir)
216 $(INSTALL) -m 0755 $(PROGRAM) $(DESTDIR)$(bindir)/$(PROGRAM)
213 -if test "x$(GROUPOWNER)" != "x" ; then \ 217 -if test "x$(GROUPOWNER)" != "x" ; then \
214 $(CHGRP) $(GROUPOWNER) $(DESTDIR)$(SCOREFILE) ; \ 218 $(CHGRP) $(GROUPOWNER) $(DESTDIR)$(SCOREFILE) ; \
215 $(CHGRP) $(GROUPOWNER) $(DESTDIR)$(LOGFILE) ; \ 219 $(CHGRP) $(GROUPOWNER) $(DESTDIR)$(LOGFILE) ; \
216 $(CHGRP) $(GROUPOWNER) $(DESTDIR)$(bindir)/$(PROGRAM) ; \ 220 $(CHGRP) $(GROUPOWNER) $(DESTDIR)$(bindir)/$(PROGRAM) ; \
217 $(CHGRP) $(GROUPOWNER) $(DESTDIR)$(SAVEDIR) ; \ 221 $(CHGRP) $(GROUPOWNER) $(DESTDIR)$(SAVEDIR) ; \
218 $(CHMOD) 02755 $(DESTDIR)$(bindir)/$(PROGRAM) ; \ 222 $(CHMOD) 02755 $(DESTDIR)$(bindir)/$(PROGRAM) ; \
219 $(CHMOD) 0464 $(DESTDIR)$(SCOREFILE) ; \ 223 $(CHMOD) 0464 $(DESTDIR)$(SCOREFILE) ; \
220 $(CHMOD) 0464 $(DESTDIR)$(LOGFILE) ; \ 224 $(CHMOD) 0464 $(DESTDIR)$(LOGFILE) ; \
221 $(CHMOD) 0775 $(DESTDIR)$(SAVEDIR) ; \ 225 $(CHMOD) 0775 $(DESTDIR)$(SAVEDIR) ; \
222 fi 226 fi
223 -if test -d $(DESTDIR)$(man6dir) ; then $(INSTALL) -m 0644 rogue.6 $(DESTDIR)$(man6dir)/$(PROGRAM).6 ; fi 227 if test ! -d $(DESTDIR)$(man6dir) && test -d $(DESTDIR)$(mandir) ; \
224 -if test ! -d $(DESTDIR)$(man6dir) ; then $(INSTALL) -m 0644 rogue.6 $(DESTDIR)$(mandir)/$(PROGRAM).6 ; fi 228 then $(INSTALL) -m 0644 rogue.6 $(DESTDIR)$(mandir)/$(PROGRAM).6 ; \
225 -$(INSTALL) -m 0644 $(PROGRAM).doc $(DESTDIR)$(docdir)/$(PROGRAM).doc 229 else mkdir -p $(DESTDIR)$(man6dir) ; \
226 -$(INSTALL) -m 0644 rogue.html $(DESTDIR)$(docdir)/$(PROGRAM).html 230 $(INSTALL) -m 0644 rogue.6 $(DESTDIR)$(man6dir)/$(PROGRAM).6 ; fi
227 -$(INSTALL) -m 0644 $(PROGRAM).cat $(DESTDIR)$(docdir)/$(PROGRAM).cat 231 $(MKDIR) -p $(DESTDIR)$(docdir)
228 -$(INSTALL) -m 0644 LICENSE.TXT $(DESTDIR)$(docdir)/LICENSE.TXT 232 $(INSTALL) -m 0644 $(DOCS) $(DESTDIR)$(docdir)
229 -$(INSTALL) -m 0644 rogue.me $(DESTDIR)$(docdir)/$(PROGRAM).me 233 $(INSTALL) -m 0644 rogue.html $(DESTDIR)$(docdir)/$(PROGRAM).html
230 -if test "x$(LOCKFILE)" != "x" && test ! -f $(DESTDIR)$(LOCKFILE) ; then \ 234 $(INSTALL) -m 0644 LICENSE.TXT $(DESTDIR)$(docdir)/LICENSE.TXT
235 $(INSTALL) -m 0644 rogue.me $(DESTDIR)$(docdir)/$(PROGRAM).me
236 if test "x$(LOCKFILE)" != "x" && test ! -f $(DESTDIR)$(LOCKFILE) ; then \
231 $(INSTALL) -m 0666 test $(DESTDIR)$(LOCKFILE) ; \ 237 $(INSTALL) -m 0666 test $(DESTDIR)$(LOCKFILE) ; \
232 $(RM) $(DESTDIR)$(LOCKFILE) ; \ 238 $(RM) $(DESTDIR)$(LOCKFILE) ; \
233 fi 239 fi
234 -$(RM) test 240 $(RM) test
235 241
236 uninstall: 242 uninstall:
237 -$(RM) $(DESTDIR)$(bindir)/$(PROGRAM) 243 $(RM) $(DESTDIR)$(bindir)/$(PROGRAM)
238 -$(RM) $(DESTDIR)$(man6dir)/$(PROGRAM).6 244 $(RM) $(DESTDIR)$(man6dir)/$(PROGRAM).6
239 -$(RM) $(DESTDIR)$(docdir)/$(PROGRAM).doc 245 $(RM) $(DESTDIR)$(mandir)/$(PROGRAM).6
240 -$(RM) $(DESTDIR)$(docdir)/$(PROGRAM).cat 246 $(RM) -r $(DESTDIR)$(docdir)
241 -$(RM) $(DESTDIR)$(docdir)/$(PROGRAM).me 247 if test "x$(LOCKFILE)" != "x" ; then \
242 -$(RM) $(DESTDIR)$(docdir)/$(PROGRAM).html 248 $(RM) $(DESTDIR)$(LOCKFILE) ; fi
243 -$(RM) $(DESTDIR)$(LOCKFILE)
244 -$(RMDIR) $(DESTDIR)$(docdir)$(PROGRAM)
245 249
246 reinstall: uninstall install 250 reinstall: uninstall install