changeset 274:603e8a99c859

UltraRogue: add install and uninstall targets to the Makefile.
author John "Elwin" Edwards
date Tue, 05 Sep 2017 21:03:26 -0400
parents 51ddbe7b992d
children aa0eefcd7df6
files urogue/Makefile.in
diffstat 1 files changed, 45 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/urogue/Makefile.in	Mon Sep 04 21:08:09 2017 -0400
+++ b/urogue/Makefile.in	Tue Sep 05 21:03:26 2017 -0400
@@ -117,6 +117,18 @@
 CRLIB = @LIBS@
 RM    = rm -f
 TAR   = tar
+INSTALL=@INSTALL@
+
+SCOREFILE=@SCOREFILE@
+LOGFILE=@LOGFILE@
+SAVEDIR=@SAVEDIR@
+CHARDIR=@CHARDIR@
+GROUPOWNER=@GROUPOWNER@
+
+DESTDIR=
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+bindir=@bindir@
 
 .c.o:
 	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $*.o $*.c
@@ -127,6 +139,39 @@
 clean:		
 	rm -f $(OBJS) urogue a.out core *.map urogue.exe urogue.cat 
 
+install: $(PROGRAM)
+	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
+	if test "x$(CHARDIR)" != "x" && test ! -d $(DESTDIR)$(CHARDIR) ; then \
+	    mkdir -p $(DESTDIR)$(CHARDIR) ; 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) ; \
+	    chgrp $(GROUPOWNER) $(DESTDIR)$(bindir)/$(PROGRAM) ; \
+	    chgrp $(GROUPOWNER) $(DESTDIR)$(SAVEDIR) ; \
+	    chgrp $(GROUPOWNER) $(DESTDIR)$(CHARDIR) ; \
+	    chmod 02755 $(DESTDIR)$(bindir)/$(PROGRAM) ; \
+	    chmod 0464 $(DESTDIR)$(SCOREFILE) ; \
+	    chmod 0464 $(DESTDIR)$(LOGFILE) ; \
+	    chmod 0775 $(DESTDIR)$(SAVEDIR) ; \
+	    chmod 0775 $(DESTDIR)$(CHARDIR) ; \
+        fi
+	$(RM) test
+
+uninstall:	
+	$(RM) $(DESTDIR)$(bindir)/$(PROGRAM)
+    
+reinstall: uninstall install
+
 dist.src:
 	make clean
 	tar cf $(DISTNAME)-src.tar $(CFILES) $(HDRS) $(MISC)