diff 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
line wrap: on
line diff
--- a/srogue/Makefile.in	Sun Feb 21 20:47:12 2016 -0500
+++ b/srogue/Makefile.in	Fri Feb 26 17:30:30 2016 -0500
@@ -76,19 +76,22 @@
 $(PROGRAM).doc: rogue.nr
 	if test "x$(GROFF)" != "x" ; then \
 	$(GROFF) -P-c -P-b -P-u -t -mm -Tascii rogue.nr >$(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.nr | $(NROFF) -mm | $(COLCRT) - > $(PROGRAM).doc ;\
 	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) ; \
@@ -98,21 +101,18 @@
 	    chmod 0464 $(DESTDIR)$(SCOREFILE) ; \
 	    chmod 0464 $(DESTDIR)$(LOGFILE) ; \
 	    chmod 0775 $(DESTDIR)$(SAVEDIR) ; \
-         fi
-	-if test ! -d $(DESTDIR)$(docdir) ; \
+        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.nr $(DESTDIR)$(docdir)/$(PROGRAM).nr
-	-$(INSTALL) -m 0644 $(PROGRAM).doc $(DESTDIR)$(docdir)/$(PROGRAM).doc
-	-$(RM) test
+	$(INSTALL) -m 0644 LICENSE.TXT $(DESTDIR)$(docdir)/LICENSE.TXT
+	$(INSTALL) -m 0644 rogue.nr $(DESTDIR)$(docdir)/$(PROGRAM).nr
+	$(INSTALL) -m 0644 $(PROGRAM).doc $(DESTDIR)$(docdir)/$(PROGRAM).doc
+	$(RM) test
 
 uninstall:	
-	-$(RM) $(DESTDIR)$(bindir)/$(PROGRAM)
-	-$(RM) $(DESTDIR)$(docdir)/LICENSE.TXT
-	-$(RM) $(DESTDIR)$(docdir)/$(PROGRAM).nr
-	-$(RM) $(DESTDIR)$(docdir)/$(PROGRAM).doc
-	-rmdir $(DESTDIR)$(docdir)
-    
+	$(RM) $(DESTDIR)$(bindir)/$(PROGRAM)
+	$(RM) -r $(DESTDIR)$(docdir)
+
 reinstall: uninstall install
 
 count: