Mercurial > hg > early-roguelike
changeset 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 | 5238b835d661 |
children | 44a0fce4b168 |
files | arogue7/Makefile.in xrogue/Makefile.in |
diffstat | 2 files changed, 82 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/arogue7/Makefile.in Thu Jun 04 14:48:25 2015 -0400 +++ b/arogue7/Makefile.in Thu Jun 04 17:08:40 2015 -0400 @@ -19,12 +19,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,7 +56,8 @@ trader.c util.c weapons.c wear.c wizard.c xcrypt.c MISC_C= DOCSRC= aguide.mm -DOCS = $(PROGRAM).doc $(PROGRAM).html +#DOCS = $(PROGRAM).doc $(PROGRAM).html +DOCS = arogue77.doc arogue77.html MISC = Makefile $(MISC_C) LICENSE.TXT $(PROGRAM).sln $(PROGRAM).vcproj $(DOCS)\ $(DOCSRC) @@ -59,6 +68,7 @@ CFLAGS= $(COPTS) $(ROPTS) LIBS = @LIBS@ RM = rm -f +INSTALL=@INSTALL@ .SUFFIXES: .obj @@ -68,6 +78,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 $(DOCS) $(DESTDIR)$(docdir) + -$(RM) test + +uninstall: + -$(RM) $(DESTDIR)$(bindir)/$(PROGRAM) + -$(RM) -r $(DESTDIR)$(docdir) + +reinstall: uninstall install + clean: $(RM) $(OBJS1) $(RM) $(OBJS2)
--- 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)