Start refactoring.
[screen-lua.git] / src / Makefile.in
blob28938b08fc108947e6ab4b0c13c0897ba6429a3e
2 # Makefile template for screen
4 # See machine dependant config.h for more configuration options.
7 srcdir = @srcdir@
8 VPATH = @srcdir@
10 DESTDIR =
12 # Where to install screen.
14 prefix = @prefix@
15 exec_prefix = @exec_prefix@
16 datarootdir = @datarootdir@
17 datadir = @datadir@
19 # don't forget to change mandir and infodir in doc/Makefile.
20 bindir = $(exec_prefix)/bin
22 VERSION = @VERSION@
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
31 CC = @CC@
32 CFLAGS = @CFLAGS@
33 CPPFLAGS = @CPPFLAGS@ -DETCSCREENRC='"$(ETCSCREENRC)"' \
34 -DSCREENENCODINGS='"$(SCREENENCODINGS)"'
35 LDFLAGS = @LDFLAGS@
36 LIBS = @LIBS@
38 CPP=@CPP@
39 CPP_DEPEND=$(CC) -MM
41 INSTALL = @INSTALL@
42 INSTALL_PROGRAM = @INSTALL_PROGRAM@
43 INSTALL_DATA = @INSTALL_DATA@
45 AWK = @AWK@
47 ### Chose some debug configuration options:
48 # -DDEBUG
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.
52 # -DDUMPSHADOW
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.
55 OPTIONS=
56 #OPTIONS= -DDEBUG
58 SHELL=/bin/sh
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
65 OFILES= screen.o ansi.o fileio.o mark.o misc.o resize.o socket.o \
66 search.o tty.o term.o window.o utmp.o loadav.o putenv.o help.o \
67 termcap.o input.o attacher.o pty.o process.o display.o comm.o \
68 kmapdef.o acls.o braille.o braille_tsi.o logfile.o layer.o \
69 sched.o teln.o nethack.o encoding.o canvas.o
71 all: screen
73 screen: $(OFILES)
74 $(CC) $(LDFLAGS) -o $@ $(OFILES) $(LIBS)
76 .c.o:
77 $(CC) -c -I. -I$(srcdir) $(M_CFLAGS) $(CPPFLAGS) $(DEFS) \
78 $(OPTIONS) $(CFLAGS) $<
80 install_bin: .version screen
81 -if [ -f $(DESTDIR)$(bindir)/$(SCREEN) ] && [ ! -f $(DESTDIR)$(bindir)/$(SCREEN).old ]; \
82 then mv $(DESTDIR)$(bindir)/$(SCREEN) $(DESTDIR)$(bindir)/$(SCREEN).old; fi
83 $(INSTALL_PROGRAM) screen $(DESTDIR)$(bindir)/$(SCREEN)
84 -chown root $(DESTDIR)$(bindir)/$(SCREEN) && chmod 4755 $(DESTDIR)$(bindir)/$(SCREEN)
85 # This doesn't work if $(bindir)/screen is a symlink
86 -if [ -f $(DESTDIR)$(bindir)/screen ] && [ ! -f $(DESTDIR)$(bindir)/screen.old ]; then mv $(DESTDIR)$(bindir)/screen $(DESTDIR)$(bindir)/screen.old; fi
87 rm -f $(DESTDIR)$(bindir)/screen
88 (cd $(DESTDIR)$(bindir) && ln -f -s $(SCREEN) screen)
89 cp $(srcdir)/utf8encodings/?? $(DESTDIR)$(SCREENENCODINGS)
91 ###############################################################################
92 install: installdirs install_bin
93 cd doc ; $(MAKE) install
94 -if [ -d /usr/lib/terminfo ]; then \
95 PATH="$$PATH:/usr/5bin" tic ${srcdir}/terminfo/screeninfo.src; \
96 chmod 644 /usr/lib/terminfo/s/screen*; \
98 # Better do this by hand. E.g. under RCS...
99 # cat ${srcdir}/terminfo/screencap >> /etc/termcap
100 @echo "termcap entry (${srcdir}/terminfo/screencap) should be installed manually."
101 @echo "You may also want to install $(srcdir)/etc/etcscreenrc in" $(ETCSCREENRC)
103 installdirs:
104 # Path leading to ETCSCREENRC and Socketdirectory not checked.
105 $(srcdir)/etc/mkinstalldirs $(DESTDIR)$(bindir) $(DESTDIR)$(SCREENENCODINGS)
106 cd doc ; $(MAKE) installdirs
108 uninstall: .version
109 rm -f $(DESTDIR)$(bindir)/$(SCREEN)
110 rm -f $(DESTDIR)$(bindir)/screen
111 -mv $(DESTDIR)$(bindir)/screen.old $(DESTDIR)$(bindir)/screen
112 rm -f $(DESTDIR)$(ETCSCREENRC)
113 cd doc; $(MAKE) uninstall
115 shadow:
116 mkdir shadow;
117 cd shadow; ln -s ../*.[ch] ../*.in ../*.sh ../configure ../doc ../terminfo ../etc .
118 rm -f shadow/term.h shadow/tty.c shadow/comm.h shadow/osdef.h
119 echo "install all Makefiles and config:" > shadow/Makefile
120 echo " rm -f config.cache" >> shadow/Makefile
121 echo " sh ./configure" >> shadow/Makefile
123 term.h: term.c term.sh
124 AWK=$(AWK) srcdir=$(srcdir) sh $(srcdir)/term.sh
126 kmapdef.c: term.h
128 tty.c: tty.sh
129 sh $(srcdir)/tty.sh tty.c
131 comm.h: comm.c comm.sh config.h
132 AWK=$(AWK) CC="$(CC) $(CFLAGS)" srcdir=${srcdir} sh $(srcdir)/comm.sh
134 osdef.h: osdef.sh config.h osdef.h.in
135 CPP="$(CPP) $(CPPFLAGS)" srcdir=${srcdir} sh $(srcdir)/osdef.sh
137 docs:
138 cd doc; $(MAKE) dvi screen.info
140 dvi info screen.info:
141 -cd doc; $(MAKE) $@
143 mostlyclean:
144 rm -f $(OFILES) screen config.cache osdef0.c osdef1.sed osdef2.sed
146 clean celan: mostlyclean
147 rm -f tty.c term.h comm.h osdef.h kmapdef.c core
149 # Delete all files from the current directory that are created by
150 # configuring or building the program.
151 # building of term.h/comm.h requires awk. Keep it in the distribution
152 # we keep config.h, as this file knows where 'make dist' finds the ETCSCREENRC.
153 #distclean: mostlyclean
154 # rm -f $(SCREEN).tar $(SCREEN).tar.gz
155 # rm -f config.status Makefile
156 # rm -f osdef.h doc/Makefile
158 maintainer-clean:
159 @echo "This command is not even intended for maintainers to use;"
160 @echo "it deletes files that may require special tools to rebuild."
163 # Delete everything from the current directory that can be
164 # reconstructed with this Makefile.
165 realclean: .version mostlyclean
166 rm -f $(SCREEN).tar $(SCREEN).tar.gz
167 rm -f config.status Makefile doc/Makefile
168 rm -f tty.c term.h comm.h osdef.h kmapdef.c
169 rm -f config.h
170 echo "install all Makefiles and config:" > Makefile
171 echo " sh ./configure" >> Makefile
173 tags TAGS: $(CFILES)
174 -ctags *.sh $(CFILES) *.h
175 -etags *.sh $(CFILES) *.h
177 dist: .version $(SCREEN).tar.gz
179 $(SCREEN).tar: .version term.h comm.h tty.c kmapdef.c
180 -rm -rf dist
181 mkdir dist
182 mkdir dist/$(SCREEN)
183 ln acls.h ansi.h display.h extern.h logfile.h mark.h os.h \
184 layer.h patchlevel.h screen.h window.h image.h \
185 osdef.h.in term.sh tty.sh comm.sh osdef.sh braille.h \
186 sched.h \
187 $(CFILES) \
188 ChangeLog COPYING INSTALL NEWS* TODO install.sh \
189 dist/$(SCREEN)
190 cd dist/$(SCREEN); mv tty.c tty.c.dist
191 cd dist/$(SCREEN); mv kmapdef.c kmapdef.c.dist
192 ln configure.in configure dist/$(SCREEN)
193 sed -e 's@"/local/screens@"/tmp/screens@' -e 's@"/local@"/usr/local@g' < config.h.in > dist/$(SCREEN)/config.h.in
194 sed -e 's@[ ]/local@ /usr/local@g' -e 's/^CFLAGS = -g/CFLAGS = -O/' < Makefile.in > dist/$(SCREEN)/Makefile.in
195 ln term.h dist/$(SCREEN)/term.h.dist
196 ln comm.h dist/$(SCREEN)/comm.h.dist
197 ln README dist/$(SCREEN)/README
198 mkdir dist/$(SCREEN)/terminfo
199 cd terminfo; ln 8bits README checktc.c screencap \
200 screeninfo.src test.txt tetris.c \
201 ../dist/$(SCREEN)/terminfo
202 mkdir dist/$(SCREEN)/etc
203 cd etc; ln * ../dist/$(SCREEN)/etc
204 mkdir dist/$(SCREEN)/utf8encodings
205 cd utf8encodings; ln * ../dist/$(SCREEN)/utf8encodings
206 # sed -e 's/^startup/#startup/' -e 's/^autodetach/#autodetach/' < $(ETCSCREENRC) > dist/$(SCREEN)/etc/etcscreenrc
207 cp $(HOME)/.screenrc dist/$(SCREEN)/etc/screenrc
208 mkdir dist/$(SCREEN)/doc
209 sed -e 's@/local/emacs@/usr/local@g' < doc/Makefile.in > dist/$(SCREEN)/doc/Makefile.in
210 cd doc; ln FAQ README.DOTSCREEN screen.1 screen.texinfo fdpat.ps make.help window_to_display.ps \
211 ../dist/$(SCREEN)/doc
212 cd doc; if test -f screen.info; then ln screen.info* \
213 ../dist/$(SCREEN)/doc; fi
214 cd dist/$(SCREEN)/doc; ln -s ../install.sh .
215 cd dist/$(SCREEN); ln -s doc/FAQ .
216 echo "install all Makefiles and config:" > dist/$(SCREEN)/Makefile
217 echo " rm -f config.cache" >> dist/$(SCREEN)/Makefile
218 echo " sh ./configure" >> dist/$(SCREEN)/Makefile
219 cd dist; tar cf ../$(SCREEN).tar $(SCREEN)
220 rm -rf dist
222 $(SCREEN).tar.gz: $(SCREEN).tar
223 gzip -nf $(SCREEN).tar || gzip -f $(SCREEN).tar
225 # Perform self-tests (if any).
226 check:
228 lint:
229 lint -I. $(CFILES)
231 saber:
232 #load $(CFLAGS) screen.c ansi.c $(LIBS)
234 config:
235 rm -f config.cache
236 sh ./configure
239 ###############################################################################
241 .version:
242 @rev=`sed < $(srcdir)/patchlevel.h -n -e '/#define REV/s/#define REV *//p'`; \
243 vers=`sed < $(srcdir)/patchlevel.h -n -e '/#define VERS/s/#define VERS *//p'`; \
244 pat=`sed < $(srcdir)/patchlevel.h -n -e '/#define PATCHLEVEL/s/#define PATCHLEVEL *//p'`; \
245 if [ "$${rev}.$${vers}.$${pat}" != "$(VERSION)" ]; then \
246 echo "This distribution is screen-$${rev}.$${vers}.$${pat}, but"; \
247 echo "the Makefile is from $(VERSION). Please update!"; exit 1; fi
249 ###############################################################################
251 mdepend: $(CFILES) term.h
252 @rm -f DEPEND ; \
253 for i in ${CFILES} ; do \
254 echo "$$i" ; \
255 echo `echo "$$i" | sed -e 's/.c$$/.o/'`": $$i" `\
256 cc -E $$i |\
257 grep '^# .*"\./.*\.h"' |\
258 (sort -t'"' -u -k 2,2 2>/dev/null || sort -t'"' -u +1 -2) |\
259 sed -e 's/.*"\.\/\(.*\)".*/\1/'\
260 ` >> DEPEND ; \
261 done
264 depend: depend.in
265 ./config.status || ./configure
267 depend.in: $(CFILES) term.h
268 cp Makefile.in Makefile.in~
269 sed -e '/\#\#\# Dependencies/q' < Makefile.in > tmp_make
270 for i in $(CFILES); do echo $$i; $(CPP_DEPEND) $$i >> tmp_make; done
271 mv tmp_make Makefile.in
273 ###############################################################################
275 ### Dependencies:
276 screen.o: canvas.h screen.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 \
278 patchlevel.h logfile.h extern.h
279 ansi.o: canvas.h ansi.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 braille.h extern.h \
281 logfile.h
282 fileio.o: canvas.h fileio.c config.h screen.h os.h osdef.h ansi.h acls.h \
283 comm.h layer.h term.h image.h display.h window.h extern.h
284 mark.o: canvas.h mark.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 mark.h extern.h
286 misc.o: canvas.h misc.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 extern.h
288 resize.o: canvas.h resize.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 socket.o: canvas.h socket.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 search.o: canvas.h search.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 mark.h extern.h
294 tty.o: canvas.h tty.c config.h screen.h os.h osdef.h ansi.h acls.h comm.h \
295 layer.h term.h image.h display.h window.h extern.h
296 term.o: canvas.h term.c term.h
297 window.o: canvas.h window.c config.h screen.h os.h osdef.h ansi.h acls.h \
298 comm.h layer.h term.h image.h display.h window.h extern.h logfile.h
299 utmp.o: canvas.h utmp.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
301 loadav.o: canvas.h loadav.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 putenv.o: canvas.h putenv.c config.h
304 help.o: canvas.h help.c config.h screen.h os.h osdef.h ansi.h acls.h \
305 comm.h layer.h term.h image.h display.h window.h extern.h
306 termcap.o: canvas.h termcap.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
308 input.o: canvas.h input.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 attacher.o: canvas.h attacher.c config.h screen.h os.h osdef.h ansi.h \
311 acls.h comm.h layer.h term.h image.h display.h window.h extern.h
312 pty.o: canvas.h pty.c config.h screen.h os.h osdef.h ansi.h acls.h comm.h \
313 layer.h term.h image.h display.h window.h extern.h
314 process.o: canvas.h process.c config.h screen.h os.h osdef.h ansi.h acls.h \
315 comm.h layer.h term.h image.h display.h window.h extern.h logfile.h
316 display.o: canvas.h display.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 braille.h
318 canvas.o: canvas.h canvas.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 \
320 braille.h
321 comm.o: canvas.h comm.c config.h acls.h comm.h
322 kmapdef.o: canvas.h kmapdef.c config.h
323 acls.o: canvas.h acls.c config.h screen.h os.h osdef.h ansi.h acls.h comm.h \
324 layer.h term.h image.h display.h window.h extern.h
325 braille.o: canvas.h braille.c config.h screen.h os.h osdef.h ansi.h acls.h \
326 comm.h layer.h term.h image.h display.h window.h extern.h braille.h
327 braille_tsi.o: canvas.h braille_tsi.c config.h screen.h os.h osdef.h ansi.h \
328 acls.h comm.h layer.h term.h image.h display.h window.h extern.h \
329 braille.h
330 logfile.o: canvas.h logfile.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 logfile.h
332 layer.o: canvas.h layer.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 sched.o: canvas.h sched.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 logfile.h
336 teln.o: canvas.h teln.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
338 nethack.o: canvas.h nethack.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 encoding.o: canvas.h encoding.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