2 # Makefile template for screen
4 # See machine dependant config.h for more configuration options.
12 # Where to install screen.
15 exec_prefix = @
exec_prefix@
16 datarootdir
= @datarootdir@
19 # don't forget to change mandir and infodir in doc/Makefile.
20 bindir = $(exec_prefix)/bin
23 SCREEN
= screen-
$(VERSION
)
25 GIT_REV
= "`git describe --always 2>/dev/null`"
26 DEFS
= @DEFS@
-DGIT_REV
=\"$(GIT_REV
)\"
28 ETCSCREENRC
= $(prefix)/etc
/screenrc
29 SCREENENCODINGS
= $(datadir)/screen
/utf8encodings
33 CPPFLAGS
= @CPPFLAGS@
-DETCSCREENRC
='"$(ETCSCREENRC)"' \
34 -DSCREENENCODINGS
='"$(SCREENENCODINGS)"'
42 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
43 INSTALL_DATA
= @INSTALL_DATA@
47 ### Chose some debug configuration options:
49 # Turn on really heavy debug output. This is written to
50 # /tmp/debug/{SCREEN,screen}.<pid>. Look at these files and quote
51 # questionable sections when sending bug-reports to the author.
53 # With shadow-pw screen would never dump core. Use this option if
54 # you still want to have a core. Use only for debugging.
60 CFILES
= screen.c ansi.c fileio.c mark.c misc.c resize.c socket.c \
61 search.c tty.c term.c window.c utmp.c loadav.c putenv.c help.c \
62 termcap.c input.c attacher.c pty.c process.c display.c comm.c \
63 kmapdef.c acls.c braille.c braille_tsi.c logfile.c layer.c \
64 sched.c teln.c nethack.c encoding.c canvas.c layout.c viewport.c \
65 list_display.c list_generic.c list_window.c
66 OFILES
= screen.o ansi.o fileio.o mark.o misc.o resize.o socket.o \
67 search.o tty.o term.o window.o utmp.o loadav.o putenv.o help.o \
68 termcap.o input.o attacher.o pty.o process.o display.o comm.o \
69 kmapdef.o acls.o braille.o braille_tsi.o logfile.o layer.o \
70 list_generic.o list_display.o list_window.o \
71 sched.o teln.o nethack.o encoding.o canvas.o layout.o viewport.o
76 $(CC
) $(LDFLAGS
) -o
$@
$(OFILES
) $(LIBS
)
79 $(CC
) -c
-I.
-I
$(srcdir) $(M_CFLAGS
) $(CPPFLAGS
) $(DEFS
) \
80 $(OPTIONS
) $(CFLAGS
) $<
82 install_bin
: .version screen
83 -if
[ -f
$(DESTDIR
)$(bindir)/$(SCREEN
) ] && [ ! -f
$(DESTDIR
)$(bindir)/$(SCREEN
).old
]; \
84 then mv
$(DESTDIR
)$(bindir)/$(SCREEN
) $(DESTDIR
)$(bindir)/$(SCREEN
).old
; fi
85 $(INSTALL_PROGRAM
) screen
$(DESTDIR
)$(bindir)/$(SCREEN
)
86 -chown root
$(DESTDIR
)$(bindir)/$(SCREEN
) && chmod
4755 $(DESTDIR
)$(bindir)/$(SCREEN
)
87 # This doesn't work if $(bindir)/screen is a symlink
88 -if
[ -f
$(DESTDIR
)$(bindir)/screen
] && [ ! -f
$(DESTDIR
)$(bindir)/screen.old
]; then mv
$(DESTDIR
)$(bindir)/screen
$(DESTDIR
)$(bindir)/screen.old
; fi
89 rm -f
$(DESTDIR
)$(bindir)/screen
90 (cd
$(DESTDIR
)$(bindir) && ln
-f
-s
$(SCREEN
) screen
)
91 cp
$(srcdir)/utf8encodings
/??
$(DESTDIR
)$(SCREENENCODINGS
)
93 ###############################################################################
94 install: installdirs install_bin
95 cd doc
; $(MAKE
) install
96 -if
[ -d
/usr
/lib
/terminfo
]; then \
97 PATH
="$$PATH:/usr/5bin" tic
${srcdir}/terminfo
/screeninfo.src
; \
98 chmod
644 /usr
/lib
/terminfo
/s
/screen
*; \
100 # Better do this by hand. E.g. under RCS...
101 # cat ${srcdir}/terminfo/screencap >> /etc/termcap
102 @echo
"termcap entry (${srcdir}/terminfo/screencap) should be installed manually."
103 @echo
"You may also want to install $(srcdir)/etc/etcscreenrc in" $(ETCSCREENRC
)
106 # Path leading to ETCSCREENRC and Socketdirectory not checked.
107 $(srcdir)/etc
/mkinstalldirs
$(DESTDIR
)$(bindir) $(DESTDIR
)$(SCREENENCODINGS
)
108 cd doc
; $(MAKE
) installdirs
111 rm -f
$(DESTDIR
)$(bindir)/$(SCREEN
)
112 rm -f
$(DESTDIR
)$(bindir)/screen
113 -mv
$(DESTDIR
)$(bindir)/screen.old
$(DESTDIR
)$(bindir)/screen
114 rm -f
$(DESTDIR
)$(ETCSCREENRC
)
115 cd doc
; $(MAKE
) uninstall
119 cd shadow
; ln
-s ..
/*.
[ch
] ..
/*.in ..
/*.sh ..
/configure ..
/doc ..
/terminfo ..
/etc .
120 rm -f shadow
/term.h shadow
/tty.c shadow
/comm.h shadow
/osdef.h
121 echo
"install all Makefiles and config:" > shadow
/Makefile
122 echo
" rm -f config.cache" >> shadow
/Makefile
123 echo
" sh ./configure" >> shadow
/Makefile
125 term.h
: term.c term.sh
126 AWK
=$(AWK
) srcdir=$(srcdir) sh
$(srcdir)/term.sh
131 sh
$(srcdir)/tty.sh tty.c
133 comm.h
: comm.c comm.sh config.h
134 AWK
=$(AWK
) CC
="$(CC) $(CFLAGS)" srcdir=${srcdir} sh
$(srcdir)/comm.sh
136 osdef.h
: osdef.sh config.h osdef.h.in
137 CPP
="$(CPP) $(CPPFLAGS)" srcdir=${srcdir} sh
$(srcdir)/osdef.sh
140 cd doc
; $(MAKE
) dvi screen.
info
142 dvi info screen.
info:
146 rm -f
$(OFILES
) screen config.cache osdef0.c osdef1.sed osdef2.sed
148 clean celan
: mostlyclean
149 rm -f tty.c term.h comm.h osdef.h kmapdef.c core
151 # Delete all files from the current directory that are created by
152 # configuring or building the program.
153 # building of term.h/comm.h requires awk. Keep it in the distribution
154 # we keep config.h, as this file knows where 'make dist' finds the ETCSCREENRC.
155 #distclean: mostlyclean
156 # rm -f $(SCREEN).tar $(SCREEN).tar.gz
157 # rm -f config.status Makefile
158 # rm -f osdef.h doc/Makefile
161 @echo
"This command is not even intended for maintainers to use;"
162 @echo
"it deletes files that may require special tools to rebuild."
165 # Delete everything from the current directory that can be
166 # reconstructed with this Makefile.
167 realclean: .version
mostlyclean
168 rm -f
$(SCREEN
).
tar $(SCREEN
).
tar.gz
169 rm -f config.status Makefile doc
/Makefile
170 rm -f tty.c term.h comm.h osdef.h kmapdef.c
172 echo
"install all Makefiles and config:" > Makefile
173 echo
" sh ./configure" >> Makefile
176 -ctags
*.sh
$(CFILES
) *.h
177 -etags
*.sh
$(CFILES
) *.h
179 dist: .version
$(SCREEN
).
tar.gz
181 $(SCREEN
).
tar: .version term.h comm.h tty.c kmapdef.c
185 ln acls.h ansi.h display.h extern.h logfile.h mark.h os.h \
186 layer.h patchlevel.h screen.h window.h image.h \
187 osdef.h.in term.sh tty.sh comm.sh osdef.sh braille.h \
190 ChangeLog COPYING INSTALL NEWS
* TODO
install.sh \
192 cd
dist/$(SCREEN
); mv tty.c tty.c.
dist
193 cd
dist/$(SCREEN
); mv kmapdef.c kmapdef.c.
dist
194 ln configure.in configure
dist/$(SCREEN
)
195 sed
-e
's@"/local/screens@"/tmp/screens@' -e
's@"/local@"/usr/local@g' < config.h.in
> dist/$(SCREEN
)/config.h.in
196 sed
-e
's@[ ]/local@ /usr/local@g' -e
's/^CFLAGS = -g/CFLAGS = -O/' < Makefile.in
> dist/$(SCREEN
)/Makefile.in
197 ln term.h
dist/$(SCREEN
)/term.h.
dist
198 ln comm.h
dist/$(SCREEN
)/comm.h.
dist
199 ln README
dist/$(SCREEN
)/README
200 mkdir
dist/$(SCREEN
)/terminfo
201 cd terminfo
; ln
8bits README checktc.c screencap \
202 screeninfo.src
test.txt tetris.c \
203 ..
/dist/$(SCREEN
)/terminfo
204 mkdir
dist/$(SCREEN
)/etc
205 cd etc
; ln
* ..
/dist/$(SCREEN
)/etc
206 mkdir
dist/$(SCREEN
)/utf8encodings
207 cd utf8encodings
; ln
* ..
/dist/$(SCREEN
)/utf8encodings
208 # sed -e 's/^startup/#startup/' -e 's/^autodetach/#autodetach/' < $(ETCSCREENRC) > dist/$(SCREEN)/etc/etcscreenrc
209 cp
$(HOME
)/.screenrc
dist/$(SCREEN
)/etc
/screenrc
210 mkdir
dist/$(SCREEN
)/doc
211 sed
-e
's@/local/emacs@/usr/local@g' < doc
/Makefile.in
> dist/$(SCREEN
)/doc
/Makefile.in
212 cd doc
; ln FAQ README.DOTSCREEN screen
.1 screen.texinfo fdpat.ps make.help window_to_display.ps \
213 ..
/dist/$(SCREEN
)/doc
214 cd doc
; if
test -f screen.
info; then ln screen.
info* \
215 ..
/dist/$(SCREEN
)/doc
; fi
216 cd
dist/$(SCREEN
)/doc
; ln
-s ..
/install.sh .
217 cd
dist/$(SCREEN
); ln
-s doc
/FAQ .
218 echo
"install all Makefiles and config:" > dist/$(SCREEN
)/Makefile
219 echo
" rm -f config.cache" >> dist/$(SCREEN
)/Makefile
220 echo
" sh ./configure" >> dist/$(SCREEN
)/Makefile
221 cd
dist; tar cf ..
/$(SCREEN
).
tar $(SCREEN
)
224 $(SCREEN
).
tar.gz
: $(SCREEN
).
tar
225 gzip
-nf
$(SCREEN
).
tar || gzip
-f
$(SCREEN
).
tar
227 # Perform self-tests (if any).
234 #load $(CFLAGS) screen.c ansi.c $(LIBS)
241 ###############################################################################
244 @rev
=`sed < $(srcdir)/patchlevel.h -n -e '/#define REV/s/#define REV *//p'`; \
245 vers
=`sed < $(srcdir)/patchlevel.h -n -e '/#define VERS/s/#define VERS *//p'`; \
246 pat
=`sed < $(srcdir)/patchlevel.h -n -e '/#define PATCHLEVEL/s/#define PATCHLEVEL *//p'`; \
247 if
[ "$${rev}.$${vers}.$${pat}" != "$(VERSION)" ]; then \
248 echo
"This distribution is screen-$${rev}.$${vers}.$${pat}, but"; \
249 echo
"the Makefile is from $(VERSION). Please update!"; exit
1; fi
251 ###############################################################################
253 mdepend
: $(CFILES
) term.h
255 for i in
${CFILES} ; do \
257 echo
`echo "$$i" | sed -e 's/.c$$/.o/'`": $$i" `\
259 grep '^# .*"\./.*\.h"' |\
260 (sort -t'"' -u -k 2,2 2>/dev/null || sort -t'"' -u +1 -2) |\
261 sed -e 's/.*"\.\/\(.*\)".*/\1/'\
267 .
/config.status || .
/configure
269 depend.in
: $(CFILES
) term.h
270 cp Makefile.in Makefile.in~
271 sed
-e
'/\#\#\# Dependencies/q' < Makefile.in
> tmp_make
272 for i in
$(CFILES
); do echo
$$i; $(CPP_DEPEND
) $$i >> tmp_make
; done
273 mv tmp_make Makefile.in
275 ###############################################################################
278 screen.o
: layout.h viewport.h canvas.h screen.c config.h screen.h os.h osdef.h ansi.h acls.h \
279 comm.h layer.h term.h image.h display.h window.h braille.h \
280 patchlevel.h logfile.h extern.h
281 ansi.o
: layout.h viewport.h canvas.h ansi.c config.h screen.h os.h osdef.h ansi.h acls.h \
282 comm.h layer.h term.h image.h display.h window.h braille.h extern.h \
284 fileio.o
: layout.h viewport.h canvas.h fileio.c config.h screen.h os.h osdef.h ansi.h acls.h \
285 comm.h layer.h term.h image.h display.h window.h extern.h
286 mark.o
: layout.h viewport.h canvas.h mark.c config.h screen.h os.h osdef.h ansi.h acls.h \
287 comm.h layer.h term.h image.h display.h window.h mark.h extern.h
288 misc.o
: layout.h viewport.h canvas.h misc.c config.h screen.h os.h osdef.h ansi.h acls.h \
289 comm.h layer.h term.h image.h display.h window.h extern.h
290 resize.o
: layout.h viewport.h canvas.h resize.c config.h screen.h os.h osdef.h ansi.h acls.h \
291 comm.h layer.h term.h image.h display.h window.h extern.h
292 socket.o
: layout.h viewport.h canvas.h socket.c config.h screen.h os.h osdef.h ansi.h acls.h \
293 comm.h layer.h term.h image.h display.h window.h extern.h
294 search.o
: layout.h viewport.h canvas.h search.c config.h screen.h os.h osdef.h ansi.h acls.h \
295 comm.h layer.h term.h image.h display.h window.h mark.h extern.h
296 tty.o
: layout.h viewport.h canvas.h tty.c config.h screen.h os.h osdef.h ansi.h acls.h comm.h \
297 layer.h term.h image.h display.h window.h extern.h
298 term.o
: layout.h viewport.h canvas.h term.c term.h
299 window.o
: layout.h viewport.h canvas.h window.c config.h screen.h os.h osdef.h ansi.h acls.h \
300 comm.h layer.h term.h image.h display.h window.h extern.h logfile.h
301 utmp.o
: layout.h viewport.h canvas.h utmp.c config.h screen.h os.h osdef.h ansi.h acls.h \
302 comm.h layer.h term.h image.h display.h window.h extern.h
303 loadav.o
: layout.h viewport.h canvas.h loadav.c config.h screen.h os.h osdef.h ansi.h acls.h \
304 comm.h layer.h term.h image.h display.h window.h extern.h
305 putenv.o
: layout.h viewport.h canvas.h putenv.c config.h
306 help.o
: layout.h viewport.h canvas.h help.c config.h screen.h os.h osdef.h ansi.h acls.h \
307 comm.h layer.h term.h image.h display.h window.h extern.h list_generic.h
308 termcap.o
: layout.h viewport.h canvas.h termcap.c config.h screen.h os.h osdef.h ansi.h acls.h \
309 comm.h layer.h term.h image.h display.h window.h extern.h
310 input.o
: layout.h viewport.h canvas.h input.c config.h screen.h os.h osdef.h ansi.h acls.h \
311 comm.h layer.h term.h image.h display.h window.h extern.h
312 attacher.o
: layout.h viewport.h canvas.h attacher.c config.h screen.h os.h osdef.h ansi.h \
313 acls.h comm.h layer.h term.h image.h display.h window.h extern.h
314 pty.o
: layout.h viewport.h canvas.h pty.c config.h screen.h os.h osdef.h ansi.h acls.h comm.h \
315 layer.h term.h image.h display.h window.h extern.h
316 process.o
: layout.h viewport.h canvas.h process.c config.h screen.h os.h osdef.h ansi.h acls.h \
317 comm.h layer.h term.h image.h display.h window.h extern.h logfile.h
318 display.o
: layout.h viewport.h canvas.h display.c config.h screen.h os.h osdef.h ansi.h acls.h \
319 comm.h layer.h term.h image.h display.h window.h extern.h braille.h
320 canvas.o
: layout.h viewport.h canvas.h canvas.c config.h screen.h os.h osdef.h ansi.h acls.h \
321 comm.h layer.h term.h image.h display.h window.h extern.h \
323 comm.o
: layout.h viewport.h canvas.h comm.c config.h acls.h comm.h
324 kmapdef.o
: layout.h viewport.h canvas.h kmapdef.c config.h
325 acls.o
: layout.h viewport.h canvas.h acls.c config.h screen.h os.h osdef.h ansi.h acls.h comm.h \
326 layer.h term.h image.h display.h window.h extern.h
327 braille.o
: layout.h viewport.h canvas.h braille.c config.h screen.h os.h osdef.h ansi.h acls.h \
328 comm.h layer.h term.h image.h display.h window.h extern.h braille.h
329 braille_tsi.o
: layout.h viewport.h canvas.h braille_tsi.c config.h screen.h os.h osdef.h ansi.h \
330 acls.h comm.h layer.h term.h image.h display.h window.h extern.h \
332 logfile.o
: layout.h viewport.h canvas.h logfile.c config.h screen.h os.h osdef.h ansi.h acls.h \
333 comm.h layer.h term.h image.h display.h window.h extern.h logfile.h
334 layer.o
: layout.h viewport.h canvas.h layer.c config.h screen.h os.h osdef.h ansi.h acls.h \
335 comm.h layer.h term.h image.h display.h window.h extern.h
336 sched.o
: layout.h viewport.h canvas.h sched.c config.h screen.h os.h osdef.h ansi.h acls.h \
337 comm.h layer.h term.h image.h display.h window.h extern.h logfile.h
338 teln.o
: layout.h viewport.h canvas.h teln.c config.h screen.h os.h osdef.h ansi.h acls.h \
339 comm.h layer.h term.h image.h display.h window.h extern.h
340 nethack.o
: layout.h viewport.h canvas.h nethack.c config.h screen.h os.h osdef.h ansi.h acls.h \
341 comm.h layer.h term.h image.h display.h window.h extern.h
342 encoding.o
: layout.h viewport.h canvas.h encoding.c config.h screen.h os.h osdef.h ansi.h acls.h \
343 comm.h layer.h term.h image.h display.h window.h extern.h
344 layout.o
: layout.h viewport.h canvas.h layout.c config.h screen.h os.h osdef.h ansi.h acls.h \
345 comm.h layer.h term.h image.h display.h window.h extern.h \
347 viewport.o
: layout.h viewport.h canvas.h viewport.c config.h screen.h os.h osdef.h ansi.h acls.h \
348 comm.h layer.h term.h image.h display.h window.h extern.h \
350 list_generic.o
: list_generic.h list_generic.c layer.h
351 list_display.o
: list_generic.h list_display.c layer.h
352 list_window.o
: list_generic.h list_window.c window.h layer.h