diff xrogue/Makefile.in @ 158:2515e03b2f09

arogue7, xrogue: add 'install' targets to Makefiles. 'make install' and 'make uninstall' should now work as expected.
author John "Elwin" Edwards
date Thu, 04 Jun 2015 17:08:40 -0400
parents 3e1146666ae5
children 2d221d574280
line wrap: on
line diff
--- a/xrogue/Makefile.in	Thu Jun 04 14:48:25 2015 -0400
+++ b/xrogue/Makefile.in	Thu Jun 04 17:08:40 2015 -0400
@@ -14,12 +14,20 @@
 
 DISTNAME=@PACKAGE_TARNAME@@PACKAGE_VERSION@
 PROGRAM=@PROGRAM@
+PACKAGE_TARNAME=@PACKAGE_TARNAME@-@PACKAGE_VERSION@
 
 SAVEDIR=@SAVEDIR@
 SCOREFILE=@SCOREFILE@
 LOGFILE=@LOGFILE@
 GROUPOWNER=@GROUPOWNER@
 
+DESTDIR=
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+datarootdir=@datarootdir@
+bindir=@bindir@
+docdir=@docdir@
+
 O=o
 
 HDRS  =	rogue.h mach_dep.h network.h
@@ -48,6 +56,7 @@
 LIBS  = @LIBS@
 RM    = rm -f
 TAR   = tar 
+INSTALL=@INSTALL@
 .SUFFIXES: .obj
 
 .c.obj:
@@ -56,6 +65,37 @@
 $(PROGRAM): $(HDRS) $(OBJS)
 	$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
 
+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)$(docdir) ; \
+	    then mkdir -p $(DESTDIR)$(docdir) ; fi
+	-$(INSTALL) -m 0644 LICENSE.TXT $(DESTDIR)$(docdir)/LICENSE.TXT
+	-$(INSTALL) -m 0644 README.TXT $(DESTDIR)$(docdir)
+	-$(RM) test
+
+uninstall:	
+	-$(RM) $(DESTDIR)$(bindir)/$(PROGRAM)
+	-$(RM) -r $(DESTDIR)$(docdir)
+    
+reinstall: uninstall install
+
 clean:
 	$(RM) $(OBJS1)
 	$(RM) $(OBJS2)