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 ETCSCREENRC
= $(prefix)/etc
/screenrc
26 SCREENENCODINGS
= $(datadir)/screen
/utf8encodings
30 CPPFLAGS
= @CPPFLAGS@
-DETCSCREENRC
='"$(ETCSCREENRC)"' \
31 -DSCREENENCODINGS
='"$(SCREENENCODINGS)"'
39 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
40 INSTALL_DATA
= @INSTALL_DATA@
44 ### Chose some debug configuration options:
46 # Turn on really heavy debug output. This is written to
47 # /tmp/debug/{SCREEN,screen}.<pid>. Look at these files and quote
48 # questionable sections when sending bug-reports to the author.
50 # With shadow-pw screen would never dump core. Use this option if
51 # you still want to have a core. Use only for debugging.
57 CFILES
= screen.c ansi.c fileio.c mark.c misc.c resize.c socket.c \
58 search.c tty.c term.c window.c utmp.c loadav.c putenv.c help.c \
59 termcap.c input.c attacher.c pty.c process.c display.c comm.c \
60 kmapdef.c acls.c braille.c braille_tsi.c logfile.c layer.c \
61 sched.c teln.c nethack.c encoding.c lua.c script.c
62 OFILES
= screen.o ansi.o fileio.o mark.o misc.o resize.o socket.o \
63 search.o tty.o term.o window.o utmp.o loadav.o putenv.o help.o \
64 termcap.o input.o attacher.o pty.o process.o display.o comm.o \
65 kmapdef.o acls.o braille.o braille_tsi.o logfile.o layer.o \
66 sched.o teln.o nethack.o encoding.o lua.o script.o
71 $(CC
) $(LDFLAGS
) -o
$@
$(OFILES
) $(LIBS
)
74 $(CC
) -c
-I.
-I
$(srcdir) $(M_CFLAGS
) $(CPPFLAGS
) $(DEFS
) \
75 $(OPTIONS
) $(CFLAGS
) $<
77 install_bin
: .version screen
78 -if
[ -f
$(DESTDIR
)$(bindir)/$(SCREEN
) ] && [ ! -f
$(DESTDIR
)$(bindir)/$(SCREEN
).old
]; \
79 then mv
$(DESTDIR
)$(bindir)/$(SCREEN
) $(DESTDIR
)$(bindir)/$(SCREEN
).old
; fi
80 $(INSTALL_PROGRAM
) screen
$(DESTDIR
)$(bindir)/$(SCREEN
)
81 -chown root
$(DESTDIR
)$(bindir)/$(SCREEN
) && chmod
4755 $(DESTDIR
)$(bindir)/$(SCREEN
)
82 # This doesn't work if $(bindir)/screen is a symlink
83 -if
[ -f
$(DESTDIR
)$(bindir)/screen
] && [ ! -f
$(DESTDIR
)$(bindir)/screen.old
]; then mv
$(DESTDIR
)$(bindir)/screen
$(DESTDIR
)$(bindir)/screen.old
; fi
84 rm -f
$(DESTDIR
)$(bindir)/screen
85 (cd
$(DESTDIR
)$(bindir) && ln
-f
-s
$(SCREEN
) screen
)
86 cp
$(srcdir)/utf8encodings
/??
$(DESTDIR
)$(SCREENENCODINGS
)
88 ###############################################################################
89 install: installdirs install_bin
90 cd doc
; $(MAKE
) install
91 -if
[ -d
/usr
/lib
/terminfo
]; then \
92 PATH
="$$PATH:/usr/5bin" tic
${srcdir}/terminfo
/screeninfo.src
; \
93 chmod
644 /usr
/lib
/terminfo
/s
/screen
*; \
95 # Better do this by hand. E.g. under RCS...
96 # cat ${srcdir}/terminfo/screencap >> /etc/termcap
97 @echo
"termcap entry (${srcdir}/terminfo/screencap) should be installed manually."
98 @echo
"You may also want to install $(srcdir)/etc/etcscreenrc in" $(ETCSCREENRC
)
101 # Path leading to ETCSCREENRC and Socketdirectory not checked.
102 $(srcdir)/etc
/mkinstalldirs
$(DESTDIR
)$(bindir) $(DESTDIR
)$(SCREENENCODINGS
)
103 cd doc
; $(MAKE
) installdirs
106 rm -f
$(DESTDIR
)$(bindir)/$(SCREEN
)
107 rm -f
$(DESTDIR
)$(bindir)/screen
108 -mv
$(DESTDIR
)$(bindir)/screen.old
$(DESTDIR
)$(bindir)/screen
109 rm -f
$(DESTDIR
)$(ETCSCREENRC
)
110 cd doc
; $(MAKE
) uninstall
114 cd shadow
; ln
-s ..
/*.
[ch
] ..
/*.in ..
/*.sh ..
/configure ..
/doc ..
/terminfo ..
/etc .
115 rm -f shadow
/term.h shadow
/tty.c shadow
/comm.h shadow
/osdef.h
116 echo
"install all Makefiles and config:" > shadow
/Makefile
117 echo
" rm -f config.cache" >> shadow
/Makefile
118 echo
" sh ./configure" >> shadow
/Makefile
120 term.h
: term.c term.sh
121 AWK
=$(AWK
) srcdir=$(srcdir) sh
$(srcdir)/term.sh
126 sh
$(srcdir)/tty.sh tty.c
128 comm.h
: comm.c comm.sh config.h
129 AWK
=$(AWK
) CC
="$(CC) $(CFLAGS)" srcdir=${srcdir} sh
$(srcdir)/comm.sh
131 osdef.h
: osdef.sh config.h osdef.h.in
132 CPP
="$(CPP) $(CPPFLAGS)" srcdir=${srcdir} sh
$(srcdir)/osdef.sh
135 cd doc
; $(MAKE
) dvi screen.
info
137 dvi info screen.
info:
141 rm -f
$(OFILES
) screen config.cache osdef0.c osdef1.sed osdef2.sed
143 clean celan
: mostlyclean
144 rm -f tty.c term.h comm.h osdef.h kmapdef.c core
146 # Delete all files from the current directory that are created by
147 # configuring or building the program.
148 # building of term.h/comm.h requires awk. Keep it in the distribution
149 # we keep config.h, as this file knows where 'make dist' finds the ETCSCREENRC.
150 #distclean: mostlyclean
151 # rm -f $(SCREEN).tar $(SCREEN).tar.gz
152 # rm -f config.status Makefile
153 # rm -f osdef.h doc/Makefile
156 @echo
"This command is not even intended for maintainers to use;"
157 @echo
"it deletes files that may require special tools to rebuild."
160 # Delete everything from the current directory that can be
161 # reconstructed with this Makefile.
162 realclean: .version
mostlyclean
163 rm -f
$(SCREEN
).
tar $(SCREEN
).
tar.gz
164 rm -f config.status Makefile doc
/Makefile
165 rm -f tty.c term.h comm.h osdef.h kmapdef.c
167 echo
"install all Makefiles and config:" > Makefile
168 echo
" sh ./configure" >> Makefile
171 -ctags
*.sh
$(CFILES
) *.h
172 -etags
*.sh
$(CFILES
) *.h
174 dist: .version
$(SCREEN
).
tar.gz
176 $(SCREEN
).
tar: .version term.h comm.h tty.c kmapdef.c
180 ln acls.h ansi.h display.h extern.h logfile.h mark.h os.h \
181 layer.h patchlevel.h screen.h window.h image.h \
182 osdef.h.in term.sh tty.sh comm.sh osdef.sh braille.h \
185 ChangeLog COPYING INSTALL NEWS
* TODO
install.sh \
187 cd
dist/$(SCREEN
); mv tty.c tty.c.
dist
188 cd
dist/$(SCREEN
); mv kmapdef.c kmapdef.c.
dist
189 ln configure.in configure
dist/$(SCREEN
)
190 sed
-e
's@"/local/screens@"/tmp/screens@' -e
's@"/local@"/usr/local@g' < config.h.in
> dist/$(SCREEN
)/config.h.in
191 sed
-e
's@[ ]/local@ /usr/local@g' -e
's/^CFLAGS = -g/CFLAGS = -O/' < Makefile.in
> dist/$(SCREEN
)/Makefile.in
192 ln term.h
dist/$(SCREEN
)/term.h.
dist
193 ln comm.h
dist/$(SCREEN
)/comm.h.
dist
194 ln README
dist/$(SCREEN
)/README
195 mkdir
dist/$(SCREEN
)/terminfo
196 cd terminfo
; ln
8bits README checktc.c screencap \
197 screeninfo.src
test.txt tetris.c \
198 ..
/dist/$(SCREEN
)/terminfo
199 mkdir
dist/$(SCREEN
)/etc
200 cd etc
; ln
* ..
/dist/$(SCREEN
)/etc
201 mkdir
dist/$(SCREEN
)/utf8encodings
202 cd utf8encodings
; ln
* ..
/dist/$(SCREEN
)/utf8encodings
203 # sed -e 's/^startup/#startup/' -e 's/^autodetach/#autodetach/' < $(ETCSCREENRC) > dist/$(SCREEN)/etc/etcscreenrc
204 cp
$(HOME
)/.screenrc
dist/$(SCREEN
)/etc
/screenrc
205 mkdir
dist/$(SCREEN
)/doc
206 sed
-e
's@/local/emacs@/usr/local@g' < doc
/Makefile.in
> dist/$(SCREEN
)/doc
/Makefile.in
207 cd doc
; ln FAQ README.DOTSCREEN screen
.1 screen.texinfo fdpat.ps make.help window_to_display.ps \
208 ..
/dist/$(SCREEN
)/doc
209 cd doc
; if
test -f screen.
info; then ln screen.
info* \
210 ..
/dist/$(SCREEN
)/doc
; fi
211 cd
dist/$(SCREEN
)/doc
; ln
-s ..
/install.sh .
212 cd
dist/$(SCREEN
); ln
-s doc
/FAQ .
213 echo
"install all Makefiles and config:" > dist/$(SCREEN
)/Makefile
214 echo
" rm -f config.cache" >> dist/$(SCREEN
)/Makefile
215 echo
" sh ./configure" >> dist/$(SCREEN
)/Makefile
216 cd
dist; tar cf ..
/$(SCREEN
).
tar $(SCREEN
)
219 $(SCREEN
).
tar.gz
: $(SCREEN
).
tar
220 gzip
-nf
$(SCREEN
).
tar || gzip
-f
$(SCREEN
).
tar
222 # Perform self-tests (if any).
229 #load $(CFLAGS) screen.c ansi.c $(LIBS)
236 ###############################################################################
239 @rev
=`sed < $(srcdir)/patchlevel.h -n -e '/#define REV/s/#define REV *//p'`; \
240 vers
=`sed < $(srcdir)/patchlevel.h -n -e '/#define VERS/s/#define VERS *//p'`; \
241 pat
=`sed < $(srcdir)/patchlevel.h -n -e '/#define PATCHLEVEL/s/#define PATCHLEVEL *//p'`; \
242 if
[ "$${rev}.$${vers}.$${pat}" != "$(VERSION)" ]; then \
243 echo
"This distribution is screen-$${rev}.$${vers}.$${pat}, but"; \
244 echo
"the Makefile is from $(VERSION). Please update!"; exit
1; fi
246 ###############################################################################
248 mdepend
: $(CFILES
) term.h
250 for i in
${CFILES} ; do \
252 echo
`echo "$$i" | sed -e 's/.c$$/.o/'`": $$i" `\
254 grep '^# .*"\./.*\.h"' |\
255 (sort -t'"' -u -k 2,2 2>/dev/null || sort -t'"' -u +1 -2) |\
256 sed -e 's/.*"\.\/\(.*\)".*/\1/'\
262 .
/config.status || .
/configure
264 depend.in
: $(CFILES
) term.h
265 cp Makefile.in Makefile.in~
266 sed
-e
'/\#\#\# Dependencies/q' < Makefile.in
> tmp_make
267 for i in
$(CFILES
); do echo
$$i; $(CPP_DEPEND
) $$i >> tmp_make
; done
268 mv tmp_make Makefile.in
270 ###############################################################################
273 screen.o
: screen.c config.h screen.h os.h osdef.h ansi.h acls.h \
274 comm.h layer.h term.h image.h display.h window.h braille.h \
275 patchlevel.h logfile.h extern.h
276 ansi.o
: ansi.c config.h screen.h os.h osdef.h ansi.h acls.h \
277 comm.h layer.h term.h image.h display.h window.h braille.h extern.h \
279 fileio.o
: fileio.c config.h screen.h os.h osdef.h ansi.h acls.h \
280 comm.h layer.h term.h image.h display.h window.h extern.h
281 mark.o
: mark.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 mark.h extern.h
283 misc.o
: misc.c config.h screen.h os.h osdef.h ansi.h acls.h \
284 comm.h layer.h term.h image.h display.h window.h extern.h
285 resize.o
: resize.c config.h screen.h os.h osdef.h ansi.h acls.h \
286 comm.h layer.h term.h image.h display.h window.h extern.h
287 socket.o
: socket.c config.h screen.h os.h osdef.h ansi.h acls.h \
288 comm.h layer.h term.h image.h display.h window.h extern.h
289 search.o
: search.c config.h screen.h os.h osdef.h ansi.h acls.h \
290 comm.h layer.h term.h image.h display.h window.h mark.h extern.h
291 tty.o
: tty.c config.h screen.h os.h osdef.h ansi.h acls.h comm.h \
292 layer.h term.h image.h display.h window.h extern.h
293 term.o
: term.c term.h
294 window.o
: window.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 extern.h logfile.h
296 utmp.o
: utmp.c config.h screen.h os.h osdef.h ansi.h acls.h \
297 comm.h layer.h term.h image.h display.h window.h extern.h
298 loadav.o
: loadav.c config.h screen.h os.h osdef.h ansi.h acls.h \
299 comm.h layer.h term.h image.h display.h window.h extern.h
300 putenv.o
: putenv.c config.h
301 help.o
: help.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 termcap.o
: termcap.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 input.o
: input.c config.h screen.h os.h osdef.h ansi.h acls.h \
306 comm.h layer.h term.h image.h display.h window.h extern.h
307 attacher.o
: attacher.c config.h screen.h os.h osdef.h ansi.h \
308 acls.h comm.h layer.h term.h image.h display.h window.h extern.h
309 pty.o
: pty.c config.h screen.h os.h osdef.h ansi.h acls.h comm.h \
310 layer.h term.h image.h display.h window.h extern.h
311 process.o
: process.c config.h screen.h os.h osdef.h ansi.h acls.h \
312 comm.h layer.h term.h image.h display.h window.h extern.h logfile.h
313 display.o
: display.c config.h screen.h os.h osdef.h ansi.h acls.h \
314 comm.h layer.h term.h image.h display.h window.h extern.h braille.h
315 comm.o
: comm.c config.h acls.h comm.h
316 kmapdef.o
: kmapdef.c config.h
317 acls.o
: acls.c config.h screen.h os.h osdef.h ansi.h acls.h comm.h \
318 layer.h term.h image.h display.h window.h extern.h
319 braille.o
: braille.c config.h screen.h os.h osdef.h ansi.h acls.h \
320 comm.h layer.h term.h image.h display.h window.h extern.h braille.h
321 braille_tsi.o
: braille_tsi.c config.h screen.h os.h osdef.h ansi.h \
322 acls.h comm.h layer.h term.h image.h display.h window.h extern.h \
324 logfile.o
: logfile.c config.h screen.h os.h osdef.h ansi.h acls.h \
325 comm.h layer.h term.h image.h display.h window.h extern.h logfile.h
326 layer.o
: layer.c config.h screen.h os.h osdef.h ansi.h acls.h \
327 comm.h layer.h term.h image.h display.h window.h extern.h
328 sched.o
: sched.c config.h screen.h os.h osdef.h ansi.h acls.h \
329 comm.h layer.h term.h image.h display.h window.h extern.h logfile.h
330 teln.o
: teln.c config.h screen.h os.h osdef.h ansi.h acls.h \
331 comm.h layer.h term.h image.h display.h window.h extern.h
332 nethack.o
: nethack.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
334 encoding.o
: encoding.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