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
22 VERSION
= @PACKAGE_VERSION@
23 SCREEN
= screen-
$(VERSION
)
25 DATE_FMT
= %Y-
%m-
%d
%H
:%m
:%S
26 ifdef SOURCE_DATE_EPOCH
27 BUILD_DATE
:= $(shell date
-u
-d
"@$(SOURCE_DATE_EPOCH)" "+$(DATE_FMT)" 2>/dev
/null || date
-u
-r
"$(SOURCE_DATE_EPOCH)" "+$(DATE_FMT)" 2>/dev
/null || date
-u
"+$(DATE_FMT)")
29 BUILD_DATE
:= $(shell date
"+$(DATE_FMT)")
32 SCREENENCODINGS
= $(datadir)/screen
/utf8encodings
35 CFLAGS
= @CFLAGS@
-Wall
-Wextra
-std
=c17
36 CPPFLAGS
= @CPPFLAGS@
-iquote.
-DSCREENENCODINGS
='"$(SCREENENCODINGS)"' -DBUILD_DATE
='"$(BUILD_DATE)"'
44 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
45 INSTALL_DATA
= @INSTALL_DATA@
52 acls.c ansi.c attacher.c backtick.c canvas.c comm.c \
53 display.c encoding.c fileio.c help.c input.c kmapdef.c layer.c \
54 layout.c list_display.c list_generic.c list_license.o list_window.c logfile.c mark.c \
55 misc.c process.c pty.c resize.c sched.c search.c socket.c telnet.c \
56 term.c termcap.c tty.c utmp.c viewport.c window.c winmsg.c \
57 winmsgbuf.c winmsgcond.c
60 TESTCFILES
:= $(wildcard tests
/test-
*.c
)
61 TESTBIN
:= $(TESTCFILES
:.c
=)
66 $(CC
) $(LDFLAGS
) -o
$@
$(OFILES
) $(LIBS
)
69 $(CC
) -c
$(CPPFLAGS
) $(CFLAGS
) $< -o
$@
72 for f in
$(TESTBIN
); do \
76 tests
/test-
%: tests
/test-
%.c
%.o tests
/mallocmock.o tests
/macros.h tests
/signature.h
77 $(CC
) $(CPPFLAGS
) $(CFLAGS
) $< -o
$@
$*.o tests
/mallocmock.o
79 install_bin
: screen
installdirs
80 -if
[ -f
$(DESTDIR
)$(bindir)/$(SCREEN
) ] && [ ! -f
$(DESTDIR
)$(bindir)/$(SCREEN
).old
]; \
81 then mv
$(DESTDIR
)$(bindir)/$(SCREEN
) $(DESTDIR
)$(bindir)/$(SCREEN
).old
; fi
82 $(INSTALL_PROGRAM
) screen
$(DESTDIR
)$(bindir)/$(SCREEN
)
83 -chown root
$(DESTDIR
)$(bindir)/$(SCREEN
) && chmod
4755 $(DESTDIR
)$(bindir)/$(SCREEN
)
84 # This doesn't work if $(bindir)/screen is a symlink
85 -if
[ -f
$(DESTDIR
)$(bindir)/screen
] && [ ! -f
$(DESTDIR
)$(bindir)/screen.old
]; then mv
$(DESTDIR
)$(bindir)/screen
$(DESTDIR
)$(bindir)/screen.old
; fi
86 rm -f
$(DESTDIR
)$(bindir)/screen
87 (cd
$(DESTDIR
)$(bindir) && ln
-f
-s
$(SCREEN
) screen
)
88 cp
$(srcdir)/utf8encodings
/??
$(DESTDIR
)$(SCREENENCODINGS
)
90 ###############################################################################
91 install: installdirs install_bin
92 cd doc
; $(MAKE
) install
93 -if
[ -d
$(DESTDIR
)/usr
/lib
/terminfo
]; then \
94 PATH
="$$PATH:/usr/5bin" tic
${srcdir}/terminfo
/screeninfo.src
; \
95 chmod
644 $(DESTDIR
)/usr
/lib
/terminfo
/s
/screen
*; \
97 # Better do this by hand. E.g. under RCS...
98 # cat ${srcdir}/terminfo/screencap >> /etc/termcap
99 @echo
"termcap entry (${srcdir}/terminfo/screencap) should be installed manually."
100 @echo
"You may also want to install $(srcdir)/etc/etcscreenrc in" $(ETCSCREENRC
)
103 # Path leading to ETCSCREENRC and Socketdirectory not checked.
104 $(srcdir)/etc
/mkinstalldirs
$(DESTDIR
)$(bindir) $(DESTDIR
)$(SCREENENCODINGS
)
105 cd doc
; $(MAKE
) installdirs
108 rm -f
$(DESTDIR
)$(bindir)/$(SCREEN
)
109 rm -f
$(DESTDIR
)$(bindir)/screen
110 -mv
$(DESTDIR
)$(bindir)/screen.old
$(DESTDIR
)$(bindir)/screen
111 rm -f
$(DESTDIR
)$(ETCSCREENRC
)
112 cd doc
; $(MAKE
) uninstall
114 term.h
: term.c term.sh
115 AWK
=$(AWK
) srcdir=$(srcdir) sh
$(srcdir)/term.sh
119 comm.h
: comm.c comm.sh config.h term.h
120 AWK
=$(AWK
) CC
="$(CC) $(CFLAGS)" srcdir=${srcdir} sh
$(srcdir)/comm.sh
123 cd doc
; $(MAKE
) dvi screen.
info
125 dvi info screen.
info:
129 rm -f
$(OFILES
) screen config.cache
132 rm -f term.h comm.h kmapdef.c core
134 # Delete everything from the current directory that can be
135 # reconstructed with this Makefile.
136 distclean: mostlyclean
137 rm -f
$(SCREEN
).
tar $(SCREEN
).
tar.gz
138 rm -f config.status Makefile doc
/Makefile
139 rm -f term.h comm.h kmapdef.c
141 rm -rf autom4te.cache
143 ###############################################################################
145 mdepend
: $(CFILES
) term.h
147 for i in
${CFILES} ; do \
149 echo
`echo "$$i" | sed -e 's/.c$$/.o/'`": $$i" `\
151 grep '^# .*"\./.*\.h"' |\
152 (sort -t'"' -u -k 2,2 2>/dev/null || sort -t'"' -u +1 -2) |\
153 sed -e 's/.*"\.\/\(.*\)".*/\1/'\
159 .
/config.status || .
/configure
161 depend.in
: $(CFILES
) term.h
162 cp Makefile.in Makefile.in~
163 sed
-e
'/\#\#\# Dependencies/q' < Makefile.in
> tmp_make
164 for i in
$(CFILES
); do echo
$$i; $(CPP_DEPEND
) $$i >> tmp_make
; done
165 mv tmp_make Makefile.in
167 ###############################################################################
170 screen.o
: screen.c config.h screen.h os.h ansi.h sched.h acls.h comm.h \
171 layer.h term.h image.h canvas.h display.h layout.h viewport.h window.h \
172 logfile.h winmsg.h winmsgbuf.h winmsgcond.h backtick.h \
173 fileio.h mark.h attacher.h encoding.h help.h misc.h process.h socket.h \
174 termcap.h tty.h utmp.h
175 ansi.o
: ansi.c config.h screen.h os.h ansi.h sched.h acls.h comm.h \
176 layer.h term.h image.h canvas.h display.h layout.h viewport.h window.h \
177 logfile.h winmsg.h winmsgbuf.h winmsgcond.h backtick.h encoding.h \
178 fileio.h help.h mark.h misc.h process.h resize.h
179 fileio.o
: fileio.c config.h screen.h os.h ansi.h sched.h acls.h comm.h \
180 layer.h term.h image.h canvas.h display.h layout.h viewport.h window.h \
181 logfile.h fileio.h misc.h process.h winmsgbuf.h termcap.h encoding.h
182 mark.o
: mark.c config.h screen.h os.h ansi.h sched.h acls.h comm.h \
183 layer.h term.h image.h canvas.h display.h layout.h viewport.h window.h \
184 logfile.h encoding.h fileio.h mark.h process.h winmsgbuf.h search.h
185 misc.o
: misc.c config.h screen.h os.h ansi.h sched.h acls.h comm.h \
186 layer.h term.h image.h canvas.h display.h layout.h viewport.h window.h \
188 resize.o
: resize.c config.h screen.h os.h ansi.h sched.h acls.h comm.h \
189 layer.h term.h image.h canvas.h display.h layout.h viewport.h window.h \
190 logfile.h process.h winmsgbuf.h resize.h telnet.h
191 socket.o
: socket.c config.h screen.h os.h ansi.h sched.h acls.h comm.h \
192 layer.h term.h image.h canvas.h display.h layout.h viewport.h window.h \
193 logfile.h encoding.h fileio.h list_generic.h misc.h process.h \
194 winmsgbuf.h resize.h socket.h termcap.h tty.h utmp.h
195 search.o
: search.c config.h screen.h os.h ansi.h sched.h acls.h comm.h \
196 layer.h term.h image.h canvas.h display.h layout.h viewport.h window.h \
197 logfile.h mark.h input.h
198 tty.o
: tty.c config.h screen.h os.h ansi.h sched.h acls.h comm.h layer.h \
199 term.h image.h canvas.h display.h layout.h viewport.h window.h logfile.h \
200 fileio.h misc.h pty.h telnet.h tty.h
201 term.o
: term.c term.h
202 window.o
: window.c config.h screen.h os.h ansi.h sched.h acls.h comm.h \
203 layer.h term.h image.h canvas.h display.h layout.h viewport.h window.h \
204 logfile.h winmsg.h winmsgbuf.h winmsgcond.h backtick.h fileio.h help.h \
205 input.h mark.h misc.h process.h pty.h resize.h telnet.h termcap.h tty.h \
207 utmp.o
: utmp.c config.h screen.h os.h ansi.h sched.h acls.h comm.h \
208 layer.h term.h image.h canvas.h display.h layout.h viewport.h window.h \
209 logfile.h misc.h tty.h utmp.h
210 help.o
: help.c config.h screen.h os.h ansi.h sched.h acls.h comm.h \
211 layer.h term.h image.h canvas.h display.h layout.h viewport.h window.h \
212 logfile.h misc.h list_generic.h process.h winmsgbuf.h
213 termcap.o
: termcap.c config.h screen.h os.h ansi.h sched.h acls.h comm.h \
214 layer.h term.h image.h canvas.h display.h layout.h viewport.h window.h \
215 logfile.h encoding.h misc.h process.h winmsgbuf.h resize.h termcap.h
216 input.o
: input.c config.h screen.h os.h ansi.h sched.h acls.h comm.h \
217 layer.h term.h image.h canvas.h display.h layout.h viewport.h window.h \
219 attacher.o
: attacher.c config.h screen.h os.h ansi.h sched.h acls.h \
220 comm.h layer.h term.h image.h canvas.h display.h layout.h viewport.h \
221 window.h logfile.h misc.h socket.h tty.h
222 pty.o
: pty.c config.h screen.h os.h ansi.h sched.h acls.h comm.h layer.h \
223 term.h image.h canvas.h display.h layout.h viewport.h window.h logfile.h
224 process.o
: process.c config.h screen.h os.h ansi.h sched.h acls.h comm.h \
225 layer.h term.h image.h canvas.h display.h layout.h viewport.h window.h \
226 logfile.h winmsg.h winmsgbuf.h winmsgcond.h backtick.h encoding.h \
227 fileio.h help.h input.h kmapdef.h list_generic.h mark.h misc.h process.h \
228 resize.h search.h socket.h telnet.h termcap.h tty.h utmp.h
229 display.o
: display.c config.h screen.h os.h ansi.h sched.h acls.h comm.h \
230 layer.h term.h image.h canvas.h display.h layout.h viewport.h window.h \
231 logfile.h winmsg.h winmsgbuf.h winmsgcond.h backtick.h encoding.h mark.h \
232 misc.h process.h pty.h resize.h termcap.h tty.h
233 comm.o
: comm.c config.h os.h screen.h ansi.h sched.h acls.h comm.h \
234 layer.h term.h image.h canvas.h display.h layout.h viewport.h window.h \
236 kmapdef.o
: kmapdef.c config.h
237 acls.o
: acls.c config.h screen.h os.h ansi.h sched.h acls.h comm.h \
238 layer.h term.h image.h canvas.h display.h layout.h viewport.h window.h \
239 logfile.h mark.h misc.h process.h winmsgbuf.h
240 logfile.o
: logfile.c config.h screen.h os.h ansi.h sched.h acls.h comm.h \
241 layer.h term.h image.h canvas.h display.h layout.h viewport.h window.h \
243 layer.o
: layer.c config.h screen.h os.h ansi.h sched.h acls.h comm.h \
244 layer.h term.h image.h canvas.h display.h layout.h viewport.h window.h \
245 logfile.h encoding.h mark.h tty.h
246 winmsg.o
: winmsg.c config.h screen.h os.h ansi.h sched.h acls.h comm.h \
247 layer.h term.h image.h canvas.h display.h layout.h viewport.h window.h \
248 logfile.h winmsg.h winmsgbuf.h winmsgcond.h backtick.h fileio.h \
250 winmsgbuf.o
: winmsgbuf.c winmsgbuf.h screen.h os.h ansi.h sched.h acls.h \
251 comm.h layer.h term.h image.h canvas.h display.h layout.h viewport.h \
253 winmsgcond.o
: winmsgcond.c winmsgcond.h
254 backtick.o
: backtick.c backtick.h screen.h os.h ansi.h sched.h acls.h \
255 comm.h layer.h term.h image.h canvas.h display.h layout.h viewport.h \
256 window.h logfile.h fileio.h
257 sched.o
: sched.c config.h screen.h os.h ansi.h sched.h acls.h comm.h \
258 layer.h term.h image.h canvas.h display.h layout.h viewport.h window.h \
260 telnet.o
: telnet.c config.h comm.h
261 encoding.o
: encoding.c config.h screen.h os.h ansi.h sched.h acls.h \
262 comm.h layer.h term.h image.h canvas.h display.h layout.h viewport.h \
263 window.h logfile.h encoding.h fileio.h
264 canvas.o
: canvas.c config.h screen.h os.h ansi.h sched.h acls.h comm.h \
265 layer.h term.h image.h canvas.h display.h layout.h viewport.h window.h \
266 logfile.h help.h list_generic.h resize.h
267 layout.o
: layout.c config.h screen.h os.h ansi.h sched.h acls.h comm.h \
268 layer.h term.h image.h canvas.h display.h layout.h viewport.h window.h \
269 logfile.h fileio.h misc.h process.h winmsgbuf.h resize.h
270 viewport.o
: viewport.c config.h screen.h os.h ansi.h sched.h acls.h \
271 comm.h layer.h term.h image.h canvas.h display.h layout.h viewport.h \
273 list_display.o
: list_display.c config.h screen.h os.h ansi.h sched.h \
274 acls.h comm.h layer.h term.h image.h canvas.h display.h layout.h \
275 viewport.h window.h logfile.h list_generic.h misc.h
276 list_generic.o
: list_generic.c config.h screen.h os.h ansi.h sched.h \
277 acls.h comm.h layer.h term.h image.h canvas.h display.h layout.h \
278 viewport.h window.h logfile.h input.h list_generic.h misc.h
279 list_window.o
: list_window.c config.h screen.h os.h ansi.h sched.h acls.h \
280 comm.h layer.h term.h image.h canvas.h display.h layout.h viewport.h \
281 window.h logfile.h winmsg.h winmsgbuf.h winmsgcond.h backtick.h input.h \
282 list_generic.h misc.h process.h
283 list_license.o
: list_license.c list_generic.h misc.h comm.h