comparison 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
comparison
equal deleted inserted replaced
90:c9c6bb34734d 91:e5ddbaf324d4
10 # 10 #
11 11
12 DISTNAME=rogue3.6.4 12 DISTNAME=rogue3.6.4
13 PROGRAM=@PROGRAM@ 13 PROGRAM=@PROGRAM@
14 14
15 SCOREFILE=@SCOREFILE@
16 LOGFILE=@LOGFILE@
17 SAVEDIR=@SAVEDIR@
18 GROUPOWNER=@GROUPOWNER@
19
20 DESTDIR=
21 prefix=@prefix@
22 exec_prefix=@exec_prefix@
23 datarootdir=@datarootdir@
24 bindir=@bindir@
25 mandir=@mandir@
26 man6dir=$(mandir)/man6
27 docdir=@docdir@
28
29
15 O=o 30 O=o
16 31
17 HDRS= rogue.h machdep.h 32 HDRS= rogue.h machdep.h config.h
18 33
19 OBJS1 = vers.$(O) armor.$(O) chase.$(O) command.$(O) daemon.$(O) daemons.$(O) \ 34 OBJS1 = vers.$(O) armor.$(O) chase.$(O) command.$(O) daemon.$(O) daemons.$(O) \
20 fight.$(O) init.$(O) io.$(O) list.$(O) main.$(O) mdport.$(O) \ 35 fight.$(O) init.$(O) io.$(O) list.$(O) main.$(O) mdport.$(O) \
21 misc.$(O) monsters.$(O) move.$(O) newlevel.$(O) options.$(O) 36 misc.$(O) monsters.$(O) move.$(O) newlevel.$(O) options.$(O)
22 OBJS2 = pack.$(O) passages.$(O) potions.$(O) rings.$(O) rip.$(O) rooms.$(O) \ 37 OBJS2 = pack.$(O) passages.$(O) potions.$(O) rings.$(O) rip.$(O) rooms.$(O) \
43 CFLAGS= $(COPTS) $(ROPTS) 58 CFLAGS= $(COPTS) $(ROPTS)
44 LIBS = -lcurses 59 LIBS = -lcurses
45 RM = rm -f 60 RM = rm -f
46 LD = $(CC) 61 LD = $(CC)
47 LDOUT = -o 62 LDOUT = -o
63 INSTALL=@INSTALL@
48 64
49 .SUFFIXES: .obj 65 .SUFFIXES: .obj
50 66
51 .c.obj: 67 .c.obj:
52 $(CC) $(CFLAGS) /c $*.c 68 $(CC) $(CFLAGS) /c $*.c
57 clean: 73 clean:
58 $(RM) $(OBJS1) 74 $(RM) $(OBJS1)
59 $(RM) $(OBJS2) 75 $(RM) $(OBJS2)
60 $(RM) core $(PROGRAM) $(PROGRAM).exe $(DISTNAME).tar $(DISTNAME).tar.gz 76 $(RM) core $(PROGRAM) $(PROGRAM).exe $(DISTNAME).tar $(DISTNAME).tar.gz
61 $(RM) $(DISTNAME).zip 77 $(RM) $(DISTNAME).zip
78
79 install: $(PROGRAM)
80 -touch test
81 -if test ! -f $(DESTDIR)$(SCOREFILE) ; \
82 then $(INSTALL) -m 0664 test $(DESTDIR)$(SCOREFILE) ; fi
83 -if test "x$(LOGFILE)" != "x" && test ! -f $(DESTDIR)$(LOGFILE) ; then \
84 $(INSTALL) -m 0664 test $(DESTDIR)$(LOGFILE) ; fi
85 -if test "x$(SAVEDIR)" != "x" && test ! -d $(DESTDIR)$(SAVEDIR) ; then \
86 mkdir -p $(DESTDIR)$(SAVEDIR) ; fi
87 -$(INSTALL) -m 0755 $(PROGRAM) $(DESTDIR)$(bindir)/$(PROGRAM)
88 -if test "x$(GROUPOWNER)" != "x" ; then \
89 chgrp $(GROUPOWNER) $(DESTDIR)$(SCOREFILE) ; \
90 chgrp $(GROUPOWNER) $(DESTDIR)$(LOGFILE) ; \
91 chgrp $(GROUPOWNER) $(DESTDIR)$(bindir)/$(PROGRAM) ; \
92 chgrp $(GROUPOWNER) $(DESTDIR)$(SAVEDIR) ; \
93 chmod 02755 $(DESTDIR)$(bindir)/$(PROGRAM) ; \
94 chmod 0464 $(DESTDIR)$(SCOREFILE) ; \
95 chmod 0464 $(DESTDIR)$(LOGFILE) ; \
96 chmod 0775 $(DESTDIR)$(SAVEDIR) ; \
97 fi
98 -if test -d $(DESTDIR)$(man6dir) ; \
99 then $(INSTALL) -m 0644 rogue.6 $(DESTDIR)$(man6dir)/$(PROGRAM).6 ; fi
100 -if test ! -d $(DESTDIR)$(man6dir) ; \
101 then $(INSTALL) -m 0644 rogue.6 $(DESTDIR)$(mandir)/$(PROGRAM).6 ; fi
102 -if test ! -d $(DESTDIR)$(docdir) ; \
103 then mkdir -p $(DESTDIR)$(docdir) ; fi
104 -$(INSTALL) -m 0644 LICENSE.TXT $(DESTDIR)$(docdir)/LICENSE.TXT
105 -$(INSTALL) -m 0644 rogue.r $(DESTDIR)$(docdir)/$(PROGRAM).r
106 -$(RM) test
107
108 uninstall:
109 -$(RM) $(DESTDIR)$(bindir)/$(PROGRAM)
110 -$(RM) $(DESTDIR)$(man6dir)/$(PROGRAM).6
111 -$(RM) $(DESTDIR)$(docdir)$(PROGRAM)/$(PROGRAM).doc
112 -$(RMDIR) $(DESTDIR)$(docdir)$(PROGRAM)
113
114 reinstall: uninstall install
62 115
63 dist.src: 116 dist.src:
64 make clean 117 make clean
65 tar cf $(DISTNAME)-src.tar $(CFILES) $(HDRS) $(MISC) $(DOCS) 118 tar cf $(DISTNAME)-src.tar $(CFILES) $(HDRS) $(MISC) $(DOCS)
66 gzip -f $(DISTNAME)-src.tar 119 gzip -f $(DISTNAME)-src.tar