diff rogue3/Makefile.in @ 91:e5ddbaf324d4

rogue3: add install and uninstall targets to Makefile.
author John "Elwin" Edwards
date Sun, 25 Aug 2013 19:52:23 -0700
parents 07c4d4883ef2
children 53e69c17c313
line wrap: on
line diff
--- a/rogue3/Makefile.in	Sat Aug 24 14:07:16 2013 -0700
+++ b/rogue3/Makefile.in	Sun Aug 25 19:52:23 2013 -0700
@@ -12,9 +12,24 @@
 DISTNAME=rogue3.6.4
 PROGRAM=@PROGRAM@
 
+SCOREFILE=@SCOREFILE@
+LOGFILE=@LOGFILE@
+SAVEDIR=@SAVEDIR@
+GROUPOWNER=@GROUPOWNER@
+
+DESTDIR=
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+datarootdir=@datarootdir@
+bindir=@bindir@
+mandir=@mandir@
+man6dir=$(mandir)/man6
+docdir=@docdir@
+
+
 O=o
 
-HDRS= 	rogue.h machdep.h
+HDRS= 	rogue.h machdep.h config.h
 
 OBJS1 = vers.$(O) armor.$(O) chase.$(O) command.$(O) daemon.$(O) daemons.$(O) \
         fight.$(O) init.$(O) io.$(O) list.$(O) main.$(O) mdport.$(O) \
@@ -45,6 +60,7 @@
 RM    = rm -f
 LD    = $(CC)
 LDOUT = -o 
+INSTALL=@INSTALL@
 
 .SUFFIXES: .obj
 
@@ -60,6 +76,43 @@
 	$(RM) core $(PROGRAM) $(PROGRAM).exe $(DISTNAME).tar $(DISTNAME).tar.gz 
 	$(RM) $(DISTNAME).zip
 
+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)
+	-if test "x$(GROUPOWNER)" != "x" ; then \
+	    chgrp $(GROUPOWNER) $(DESTDIR)$(SCOREFILE) ; \
+	    chgrp $(GROUPOWNER) $(DESTDIR)$(LOGFILE) ; \
+	    chgrp $(GROUPOWNER) $(DESTDIR)$(bindir)/$(PROGRAM) ; \
+	    chgrp $(GROUPOWNER) $(DESTDIR)$(SAVEDIR) ; \
+	    chmod 02755 $(DESTDIR)$(bindir)/$(PROGRAM) ; \
+	    chmod 0464 $(DESTDIR)$(SCOREFILE) ; \
+	    chmod 0464 $(DESTDIR)$(LOGFILE) ; \
+	    chmod 0775 $(DESTDIR)$(SAVEDIR) ; \
+         fi
+	-if test -d $(DESTDIR)$(man6dir) ; \
+	 then $(INSTALL) -m 0644 rogue.6 $(DESTDIR)$(man6dir)/$(PROGRAM).6 ; fi
+	-if test ! -d $(DESTDIR)$(man6dir) ; \
+	 then $(INSTALL) -m 0644 rogue.6 $(DESTDIR)$(mandir)/$(PROGRAM).6 ; 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.r $(DESTDIR)$(docdir)/$(PROGRAM).r
+	-$(RM) test
+
+uninstall:	
+	-$(RM) $(DESTDIR)$(bindir)/$(PROGRAM)
+	-$(RM) $(DESTDIR)$(man6dir)/$(PROGRAM).6
+	-$(RM) $(DESTDIR)$(docdir)$(PROGRAM)/$(PROGRAM).doc
+	-$(RMDIR) $(DESTDIR)$(docdir)$(PROGRAM)
+    
+reinstall: uninstall install
+
 dist.src:
 	make clean
 	tar cf $(DISTNAME)-src.tar $(CFILES) $(HDRS) $(MISC) $(DOCS)