comparison rogue5/Makefile.in @ 96:9fb343307b6b

Fix some 'test' failures when running 'make install'. When shell variables are unexpectedly empty, 'test' gets the wrong number of arguments and becomes unhappy. Logical AND should not be done with 'test EXPR1 -a EXPR2' in such cases, because 'test' logic does not short-circuit. Replace with 'test EXPR1 && test EXPR2'. Shell logic does short-circuit, and if the first test invocation fails, the second will never occur, and will never encounter missing arguments.
author John "Elwin" Edwards
date Tue, 27 Aug 2013 22:54:28 -0700
parents 8f7c082fde46
children fbc75509f4cd
comparison
equal deleted inserted replaced
95:88ab59f06dfc 96:9fb343307b6b
197 gzip -f $(DISTFILE).tar 197 gzip -f $(DISTFILE).tar
198 198
199 install: $(PROGRAM) 199 install: $(PROGRAM)
200 -$(TOUCH) test 200 -$(TOUCH) test
201 -if test ! -f $(DESTDIR)$(SCOREFILE) ; then $(INSTALL) -m 0664 test $(DESTDIR)$(SCOREFILE) ; fi 201 -if test ! -f $(DESTDIR)$(SCOREFILE) ; then $(INSTALL) -m 0664 test $(DESTDIR)$(SCOREFILE) ; fi
202 -if test "x$(LOGFILE)" != "x" -a ! -f $(DESTDIR)$(LOGFILE) ; then \ 202 -if test "x$(LOGFILE)" != "x" && test ! -f $(DESTDIR)$(LOGFILE) ; then \
203 $(INSTALL) -m 0664 test $(DESTDIR)$(LOGFILE) ; fi 203 $(INSTALL) -m 0664 test $(DESTDIR)$(LOGFILE) ; fi
204 -if test "x$(SAVEDIR)" != "x" -a ! -d $(DESTDIR)$(SAVEDIR) ; then \ 204 -if test "x$(SAVEDIR)" != "x" && test ! -d $(DESTDIR)$(SAVEDIR) ; then \
205 $(MKDIR) -p $(DESTDIR)$(SAVEDIR) ; fi 205 $(MKDIR) -p $(DESTDIR)$(SAVEDIR) ; fi
206 -$(INSTALL) -m 0755 $(PROGRAM) $(DESTDIR)$(bindir)/$(PROGRAM) 206 -$(INSTALL) -m 0755 $(PROGRAM) $(DESTDIR)$(bindir)/$(PROGRAM)
207 -if test "x$(GROUPOWNER)" != "x" ; then \ 207 -if test "x$(GROUPOWNER)" != "x" ; then \
208 $(CHGRP) $(GROUPOWNER) $(DESTDIR)$(SCOREFILE) ; \ 208 $(CHGRP) $(GROUPOWNER) $(DESTDIR)$(SCOREFILE) ; \
209 $(CHGRP) $(GROUPOWNER) $(DESTDIR)$(LOGFILE) ; \ 209 $(CHGRP) $(GROUPOWNER) $(DESTDIR)$(LOGFILE) ; \
219 -$(INSTALL) -m 0644 rogue.doc $(DESTDIR)$(docdir)/$(PROGRAM).doc 219 -$(INSTALL) -m 0644 rogue.doc $(DESTDIR)$(docdir)/$(PROGRAM).doc
220 -$(INSTALL) -m 0644 rogue.html $(DESTDIR)$(docdir)/$(PROGRAM).html 220 -$(INSTALL) -m 0644 rogue.html $(DESTDIR)$(docdir)/$(PROGRAM).html
221 -$(INSTALL) -m 0644 rogue.cat $(DESTDIR)$(docdir)/$(PROGRAM).cat 221 -$(INSTALL) -m 0644 rogue.cat $(DESTDIR)$(docdir)/$(PROGRAM).cat
222 -$(INSTALL) -m 0644 LICENSE.TXT $(DESTDIR)$(docdir)/LICENSE.TXT 222 -$(INSTALL) -m 0644 LICENSE.TXT $(DESTDIR)$(docdir)/LICENSE.TXT
223 -$(INSTALL) -m 0644 rogue.me $(DESTDIR)$(docdir)/$(PROGRAM).me 223 -$(INSTALL) -m 0644 rogue.me $(DESTDIR)$(docdir)/$(PROGRAM).me
224 -if test "x$(LOCKFILE)" != "x" -a ! -f $(DESTDIR)$(LOCKFILE) ; then \ 224 -if test "x$(LOCKFILE)" != "x" && test ! -f $(DESTDIR)$(LOCKFILE) ; then \
225 $(INSTALL) -m 0666 test $(DESTDIR)$(LOCKFILE) ; \ 225 $(INSTALL) -m 0666 test $(DESTDIR)$(LOCKFILE) ; \
226 $(RM) $(DESTDIR)$(LOCKFILE) ; \ 226 $(RM) $(DESTDIR)$(LOCKFILE) ; \
227 fi 227 fi
228 -$(RM) test 228 -$(RM) test
229 229