comparison rogue3/Makefile.in @ 224:4d0f53998e8a

Makefile fixes related to installation. 'make install' and 'make uninstall' should now work correctly, placing the documentation in the proper places. Any directories needed will be created.
author John "Elwin" Edwards
date Fri, 26 Feb 2016 17:30:30 -0500
parents 0e99eade579c
children 455464db5800
comparison
equal deleted inserted replaced
223:0e99eade579c 224:4d0f53998e8a
47 47
48 48
49 MISC_C= 49 MISC_C=
50 DOCSRC= rogue.6 rogue.r 50 DOCSRC= rogue.6 rogue.r
51 DOCS = $(PROGRAM).doc $(PROGRAM).cat 51 DOCS = $(PROGRAM).doc $(PROGRAM).cat
52 MISC = Makefile $(MISC_C) LICENSE.TXT $(PROGRAM).sln $(PROGRAM).vcproj $(DOCS)\ 52 RAWDOCS = LICENSE.TXT rogue36.html readme36.html
53 $(DOCSRC) rogue36.html readme36.html 53 MISC = Makefile $(MISC_C) $(PROGRAM).sln $(PROGRAM).vcproj $(RAWDOCS) $(DOCS)\
54 $(DOCSRC)
54 55
55 CC = gcc 56 CC = gcc
56 CPPFLAGS =@DEFS@ 57 CPPFLAGS =@DEFS@
57 ROPTS = 58 ROPTS =
58 COPTS = 59 COPTS =
86 docs: $(DOCS) 87 docs: $(DOCS)
87 88
88 $(PROGRAM).doc: rogue.r 89 $(PROGRAM).doc: rogue.r
89 if test "x$(GROFF)" != "x" ; then \ 90 if test "x$(GROFF)" != "x" ; then \
90 $(GROFF) -P-c -P-b -P-u -t -ms -Tutf8 rogue.r > $(PROGRAM).doc ;\ 91 $(GROFF) -P-c -P-b -P-u -t -ms -Tutf8 rogue.r > $(PROGRAM).doc ;\
91 elif test "x$(NROFF)" != "x" -a "x$(TBL)" != "x" -a "x$(COLCRT)" != "x" ; then \ 92 elif test "x$(NROFF)" != "x" && test "x$(TBL)" != "x" && test "x$(COLCRT)" != "x" ; then \
92 $(TBL) rogue.r | $(NROFF) -ms | $(COLCRT) - > $(PROGRAM).doc ;\ 93 $(TBL) rogue.r | $(NROFF) -ms | $(COLCRT) - > $(PROGRAM).doc ;\
93 fi 94 fi
94 95
95 $(PROGRAM).cat: rogue.6 96 $(PROGRAM).cat: rogue.6
96 if test "x$(GROFF)" != "x" ; then \ 97 if test "x$(GROFF)" != "x" ; then \
97 $(GROFF) -P-c -P-b -P-u -Tascii -man rogue.6 > $(PROGRAM).cat ;\ 98 $(GROFF) -P-c -P-b -P-u -Tascii -man rogue.6 > $(PROGRAM).cat ;\
98 elif test "x$(NROFF)" != "x" -a "x$(COLCRT)" != "x" ; then \ 99 elif test "x$(NROFF)" != "x" && test "x$(COLCRT)" != "x" ; then \
99 $(NROFF) -man rogue.6 | $(COLCRT) - > $(PROGRAM).cat ;\ 100 $(NROFF) -man rogue.6 | $(COLCRT) - > $(PROGRAM).cat ;\
100 fi 101 fi
101 102
102 install: $(PROGRAM) 103 install: all
103 -touch test 104 touch test
104 -if test ! -f $(DESTDIR)$(SCOREFILE) ; \ 105 if test ! -f $(DESTDIR)$(SCOREFILE) ; then \
105 then $(INSTALL) -m 0664 test $(DESTDIR)$(SCOREFILE) ; fi 106 mkdir -p `dirname $(DESTDIR)$(SCOREFILE)` ; \
106 -if test "x$(LOGFILE)" != "x" && test ! -f $(DESTDIR)$(LOGFILE) ; then \ 107 $(INSTALL) -m 0664 test $(DESTDIR)$(SCOREFILE) ; fi
107 $(INSTALL) -m 0664 test $(DESTDIR)$(LOGFILE) ; fi 108 if test "x$(LOGFILE)" != "x" && test ! -f $(DESTDIR)$(LOGFILE) ; then \
108 -if test "x$(SAVEDIR)" != "x" && test ! -d $(DESTDIR)$(SAVEDIR) ; then \ 109 mkdir -p `dirname $(DESTDIR)$(LOGFILE)` ; \
109 mkdir -p $(DESTDIR)$(SAVEDIR) ; fi 110 $(INSTALL) -m 0664 test $(DESTDIR)$(LOGFILE) ; fi
110 -$(INSTALL) -m 0755 $(PROGRAM) $(DESTDIR)$(bindir)/$(PROGRAM) 111 if test "x$(SAVEDIR)" != "x" && test ! -d $(DESTDIR)$(SAVEDIR) ; then \
112 mkdir -p $(DESTDIR)$(SAVEDIR) ; fi
113 mkdir -p $(DESTDIR)$(bindir)
114 $(INSTALL) -m 0755 $(PROGRAM) $(DESTDIR)$(bindir)/$(PROGRAM)
111 -if test "x$(GROUPOWNER)" != "x" ; then \ 115 -if test "x$(GROUPOWNER)" != "x" ; then \
112 chgrp $(GROUPOWNER) $(DESTDIR)$(SCOREFILE) ; \ 116 chgrp $(GROUPOWNER) $(DESTDIR)$(SCOREFILE) ; \
113 chgrp $(GROUPOWNER) $(DESTDIR)$(LOGFILE) ; \ 117 chgrp $(GROUPOWNER) $(DESTDIR)$(LOGFILE) ; \
114 chgrp $(GROUPOWNER) $(DESTDIR)$(bindir)/$(PROGRAM) ; \ 118 chgrp $(GROUPOWNER) $(DESTDIR)$(bindir)/$(PROGRAM) ; \
115 chgrp $(GROUPOWNER) $(DESTDIR)$(SAVEDIR) ; \ 119 chgrp $(GROUPOWNER) $(DESTDIR)$(SAVEDIR) ; \
116 chmod 02755 $(DESTDIR)$(bindir)/$(PROGRAM) ; \ 120 chmod 02755 $(DESTDIR)$(bindir)/$(PROGRAM) ; \
117 chmod 0464 $(DESTDIR)$(SCOREFILE) ; \ 121 chmod 0464 $(DESTDIR)$(SCOREFILE) ; \
118 chmod 0464 $(DESTDIR)$(LOGFILE) ; \ 122 chmod 0464 $(DESTDIR)$(LOGFILE) ; \
119 chmod 0775 $(DESTDIR)$(SAVEDIR) ; \ 123 chmod 0775 $(DESTDIR)$(SAVEDIR) ; \
120 fi 124 fi
121 -if test -d $(DESTDIR)$(man6dir) ; \ 125 if test ! -d $(DESTDIR)$(man6dir) && test -d $(DESTDIR)$(mandir) ; \
122 then $(INSTALL) -m 0644 rogue.6 $(DESTDIR)$(man6dir)/$(PROGRAM).6 ; fi 126 then $(INSTALL) -m 0644 rogue.6 $(DESTDIR)$(mandir)/$(PROGRAM).6 ; \
123 -if test ! -d $(DESTDIR)$(man6dir) ; \ 127 else mkdir -p $(DESTDIR)$(man6dir) ; \
124 then $(INSTALL) -m 0644 rogue.6 $(DESTDIR)$(mandir)/$(PROGRAM).6 ; fi 128 $(INSTALL) -m 0644 rogue.6 $(DESTDIR)$(man6dir)/$(PROGRAM).6 ; fi
125 -if test ! -d $(DESTDIR)$(docdir) ; \ 129 if test ! -d $(DESTDIR)$(docdir) ; \
126 then mkdir -p $(DESTDIR)$(docdir) ; fi 130 then mkdir -p $(DESTDIR)$(docdir) ; fi
127 -$(INSTALL) -m 0644 LICENSE.TXT $(DESTDIR)$(docdir)/LICENSE.TXT 131 $(INSTALL) -m 0644 rogue.r $(DESTDIR)$(docdir)/$(PROGRAM).r
128 -$(INSTALL) -m 0644 rogue.r $(DESTDIR)$(docdir)/$(PROGRAM).r 132 $(INSTALL) -m 0644 $(DOCS) $(RAWDOCS) $(DESTDIR)$(docdir)
129 -$(INSTALL) -m 0644 $(PROGRAM).doc $(DESTDIR)$(docdir)/$(PROGRAM).doc 133 $(RM) test
130 -$(INSTALL) -m 0644 $(PROGRAM).cat $(DESTDIR)$(docdir)/$(PROGRAM).cat
131 -$(RM) test
132 134
133 uninstall: 135 uninstall:
134 -$(RM) $(DESTDIR)$(bindir)/$(PROGRAM) 136 $(RM) $(DESTDIR)$(bindir)/$(PROGRAM)
135 -$(RM) $(DESTDIR)$(man6dir)/$(PROGRAM).6 137 $(RM) $(DESTDIR)$(man6dir)/$(PROGRAM).6
136 -$(RM) $(DESTDIR)$(docdir)/$(PROGRAM).r 138 $(RM) $(DESTDIR)$(mandir)/$(PROGRAM).6
137 -$(RM) $(DESTDIR)$(docdir)/$(PROGRAM).doc 139 $(RM) -r $(DESTDIR)$(docdir)
138 -$(RM) $(DESTDIR)$(docdir)/$(PROGRAM).cat
139 -$(RMDIR) $(DESTDIR)$(docdir)$(PROGRAM)
140 140
141 reinstall: uninstall install 141 reinstall: uninstall install
142 142
143 dist.src: 143 dist.src:
144 make clean 144 make clean