Mercurial > hg > early-roguelike
comparison rogue4/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 |
---|---|
115 | 115 |
116 install: $(PROGRAM) | 116 install: $(PROGRAM) |
117 -$(TOUCH) test | 117 -$(TOUCH) test |
118 -if test ! -f $(DESTDIR)$(SCOREFILE) ; \ | 118 -if test ! -f $(DESTDIR)$(SCOREFILE) ; \ |
119 then $(INSTALL) -m 0664 test $(DESTDIR)$(SCOREFILE) ; fi | 119 then $(INSTALL) -m 0664 test $(DESTDIR)$(SCOREFILE) ; fi |
120 -if test "x$(LOGFILE)" != "x" -a ! -f $(DESTDIR)$(LOGFILE) ; then \ | 120 -if test "x$(LOGFILE)" != "x" && test ! -f $(DESTDIR)$(LOGFILE) ; then \ |
121 $(INSTALL) -m 0664 test $(DESTDIR)$(LOGFILE) ; fi | 121 $(INSTALL) -m 0664 test $(DESTDIR)$(LOGFILE) ; fi |
122 -if test "x$(SAVEDIR)" != "x" -a ! -d $(DESTDIR)$(SAVEDIR) ; then \ | 122 -if test "x$(SAVEDIR)" != "x" && test ! -d $(DESTDIR)$(SAVEDIR) ; then \ |
123 $(MKDIR) -p $(DESTDIR)$(SAVEDIR) ; fi | 123 $(MKDIR) -p $(DESTDIR)$(SAVEDIR) ; fi |
124 -$(INSTALL) -m 0755 $(PROGRAM) $(DESTDIR)$(bindir)/$(PROGRAM) | 124 -$(INSTALL) -m 0755 $(PROGRAM) $(DESTDIR)$(bindir)/$(PROGRAM) |
125 -if test "x$(GROUPOWNER)" != "x" ; then \ | 125 -if test "x$(GROUPOWNER)" != "x" ; then \ |
126 $(CHGRP) $(GROUPOWNER) $(DESTDIR)$(SCOREFILE) ; \ | 126 $(CHGRP) $(GROUPOWNER) $(DESTDIR)$(SCOREFILE) ; \ |
127 $(CHGRP) $(GROUPOWNER) $(DESTDIR)$(LOGFILE) ; \ | 127 $(CHGRP) $(GROUPOWNER) $(DESTDIR)$(LOGFILE) ; \ |
138 then $(INSTALL) -m 0644 rogue.6 $(DESTDIR)$(mandir)/$(PROGRAM).6 ; fi | 138 then $(INSTALL) -m 0644 rogue.6 $(DESTDIR)$(mandir)/$(PROGRAM).6 ; fi |
139 -if test ! -d $(DESTDIR)$(docdir) ; \ | 139 -if test ! -d $(DESTDIR)$(docdir) ; \ |
140 then $(MKDIR) -p $(DESTDIR)$(docdir) ; fi | 140 then $(MKDIR) -p $(DESTDIR)$(docdir) ; fi |
141 -$(INSTALL) -m 0644 LICENSE.TXT $(DESTDIR)$(docdir)/LICENSE.TXT | 141 -$(INSTALL) -m 0644 LICENSE.TXT $(DESTDIR)$(docdir)/LICENSE.TXT |
142 -$(INSTALL) -m 0644 rogue.me $(DESTDIR)$(docdir)/$(PROGRAM).me | 142 -$(INSTALL) -m 0644 rogue.me $(DESTDIR)$(docdir)/$(PROGRAM).me |
143 -if test "x$(LOCKFILE)" != "x" -a ! -f $(DESTDIR)$(LOCKFILE) ; then \ | 143 -if test "x$(LOCKFILE)" != "x" && test ! -f $(DESTDIR)$(LOCKFILE) ; then \ |
144 $(INSTALL) -m 0666 test $(DESTDIR)$(LOCKFILE) ; \ | 144 $(INSTALL) -m 0666 test $(DESTDIR)$(LOCKFILE) ; \ |
145 $(RM) $(DESTDIR)$(LOCKFILE) ; \ | 145 $(RM) $(DESTDIR)$(LOCKFILE) ; \ |
146 fi | 146 fi |
147 -$(RM) test | 147 -$(RM) test |
148 | 148 |