changeset 91:e5ddbaf324d4

rogue3: add install and uninstall targets to Makefile.
author John "Elwin" Edwards
date Sun, 25 Aug 2013 19:52:23 -0700
parents c9c6bb34734d
children 53e69c17c313
files rogue3/Makefile.in rogue3/configure.ac
diffstat 2 files changed, 54 insertions(+), 21 deletions(-) [+]
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)
--- a/rogue3/configure.ac	Sat Aug 24 14:07:16 2013 -0700
+++ b/rogue3/configure.ac	Sun Aug 25 19:52:23 2013 -0700
@@ -129,26 +129,6 @@
 
 AC_SUBST(SAVEDIR)
 
-AC_ARG_ENABLE([destdir],[AC_HELP_STRING([--enable-destdir=DESTDIR], [chroot to install into])],[],[])
-AC_MSG_CHECKING([for chrooted install])
-if test "x$enable_destdir" = "xno" ; then
-DESTDIR=
-elif test "x$enable_destdir" = "xyes" ; then
-DESTDIR=
-elif test "x$enable_destdir" = "x" ; then
-DESTDIR=
-else
-DESTDIR=$enable_destdir
-fi
-
-if test "x$DESTDIR" != "x" ; then
-AC_MSG_RESULT([$DESTDIR])
-else
-AC_MSG_RESULT([disabled])
-fi
-
-AC_SUBST(DESTDIR)
-
 AC_ARG_ENABLE([wizardmode],[AC_HELP_STRING([--enable-wizardmode], [enable availability of wizard mode @<:@default=no@:>@])],[],[])
 AC_MSG_CHECKING([if wizard mode is enabled])
 if test "x$enable_wizardmode" = "xno" ; then