Makefile.in revision 5307cd1a
1## $XTermId: Makefile.in,v 1.263 2023/04/02 17:29:25 tom Exp $
2# -----------------------------------------------------------------------------
3# this file is part of xterm
4#
5# Copyright 1997-2022,2023 by Thomas E. Dickey
6#
7#                         All Rights Reserved
8#
9# Permission is hereby granted, free of charge, to any person obtaining a
10# copy of this software and associated documentation files (the
11# "Software"), to deal in the Software without restriction, including
12# without limitation the rights to use, copy, modify, merge, publish,
13# distribute, sublicense, and/or sell copies of the Software, and to
14# permit persons to whom the Software is furnished to do so, subject to
15# the following conditions:
16#
17# The above copyright notice and this permission notice shall be included
18# in all copies or substantial portions of the Software.
19#
20# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
24# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27#
28# Except as contained in this notice, the name(s) of the above copyright
29# holders shall not be used in advertising or otherwise to promote the
30# sale, use or other dealings in this Software without prior written
31# authorization.
32# -----------------------------------------------------------------------------
33
34SHELL		= /bin/sh
35
36#### Start of system configuration section. ####
37
38srcdir		= @srcdir@
39VPATH  		= @srcdir@
40
41x		= @EXEEXT@
42o		= .@OBJEXT@
43
44CC		= @CC@
45CPP		= @CPP@
46AWK		= @AWK@
47LINK		= $(CC) $(CFLAGS)
48
49CTAGS		= @CTAGS@
50ETAGS		= @ETAGS@
51
52LN_S		= @LN_S@
53RM              = rm -f
54LINT		= @LINT@
55LINT_OPTS	= @LINT_OPTS@
56
57INSTALL		= @INSTALL@
58INSTALL_PROGRAM	= @INSTALL_PROGRAM@
59INSTALL_SCRIPT	= @INSTALL_SCRIPT@
60INSTALL_DATA	= @INSTALL_DATA@
61transform	= @program_transform_name@
62
63EXTRA_CFLAGS	= @EXTRA_CFLAGS@
64EXTRA_CPPFLAGS	= @EXTRA_CPPFLAGS@
65EXTRA_LOADFLAGS	= @IMAKE_LOADFLAGS@
66
67PIXMAPDIR_DEF	= @no_pixmapdir@-DPIXMAP_ROOTDIR=\"@PIXMAPDIR@/\"
68CPPFLAGS	= -I. -I$(srcdir) -DHAVE_CONFIG_H @CPPFLAGS@ -DDEFCLASS=\"@APP_CLASS@\" $(PIXMAPDIR_DEF) $(EXTRA_CPPFLAGS)
69CFLAGS		= @CFLAGS@ $(EXTRA_CFLAGS)
70LDFLAGS		= @LDFLAGS@ @EXTRA_LDFLAGS@
71LIBS		= @LIBS@
72
73prefix		= @prefix@
74exec_prefix	= @exec_prefix@
75datarootdir	= @datarootdir@
76datadir		= @datadir@
77
78manext		= 1
79bindir		= @bindir@
80libdir		= @libdir@
81mandir		= @mandir@/man$(manext)
82appsdir		= @APPSDIR@
83icondir		= @ICONDIR@
84pixmapdir	= @PIXMAPDIR@
85
86#### End of system configuration section. ####
87
88ICON_NAME	= @ICON_NAME@
89ICON_SYMLINK	= @ICON_SYMLINK@
90
91DESTDIR		=
92BINDIR		= $(DESTDIR)$(bindir)
93LIBDIR		= $(DESTDIR)$(libdir)
94MANDIR		= $(DESTDIR)$(mandir)
95APPSDIR		= $(DESTDIR)$(appsdir)
96
97@no_icondir@ICONDIR		= $(DESTDIR)$(icondir)
98@no_pixmapdir@PIXMAPDIR	= $(DESTDIR)$(pixmapdir)
99
100INSTALL_DIRS    = $(BINDIR) $(APPSDIR) $(ICONDIR) $(PIXMAPDIR) $(MANDIR)
101
102CLASS		= @APP_CLASS@
103EXTRAHDR	= @EXTRAHDRS@
104EXTRASRC	= @EXTRASRCS@
105EXTRAOBJ	= @EXTRAOBJS@
106
107AUTO_SOURCE	= \
108		builtin_icons.h \
109		VTparse.cin \
110		Tekparse.cin \
111		VTparse.hin \
112		Tekparse.hin
113
114          SRCS1 = button.c cachedGCs.c charproc.c charsets.c cursor.c \
115	  	  data.c doublechr.c fontutils.c input.c \
116		  linedata.c main.c menu.c misc.c \
117		  print.c ptydata.c scrollback.c \
118		  screen.c scrollbar.c tabs.c util.c version.c xstrings.c \
119		  xtermcap.c VTPrsTbl.c $(EXTRASRC)
120          OBJS1 = button$o cachedGCs$o charproc$o charsets$o cursor$o \
121	  	  data$o doublechr$o fontutils$o input$o \
122		  linedata$o main$o menu$o misc$o \
123		  print$o ptydata$o scrollback$o \
124		  screen$o scrollbar$o tabs$o util$o version$o xstrings$o \
125		  xtermcap$o VTPrsTbl$o $(EXTRAOBJ)
126          SRCS2 = resize.c version.c xstrings.c
127          OBJS2 = resize$o version$o xstrings$o
128           SRCS = $(SRCS1) $(SRCS2)
129           OBJS = $(OBJS1) $(OBJS2)
130           HDRS = VTparse.h data.h error.h fontutils.h main.h menu.h \
131                  ptyx.h version.h xstrings.h xterm.h xtermcap.h $(EXTRAHDR)
132       PROGRAMS = xterm$x resize$x
133  TEST_PROGRAMS = test_charclass$x test_ptydata$x test_wcwidth$x
134
135all :	$(PROGRAMS)
136################################################################################
137.SUFFIXES : .i .def .cin .hin .$(manext) .ms .man .txt @MAN2HTML_NOTE@ .html @GROFF_NOTE@ .ps .pdf
138
139.c$o :
140	@RULE_CC@
141	@ECHO_CC@$(CC) $(CPPFLAGS) $(CFLAGS) -c $(srcdir)/$*.c
142
143.c.i :
144	@RULE_CC@
145	@ECHO_CC@$(CPP) -C $(CPPFLAGS) $*.c >$@
146
147.def.cin :
148	@echo "making $@ from $<"
149	@$(AWK) 'BEGIN{printf "/* vile:cmode */\n";}/^CASE_/{printf "{ %d, \"%s\" },\n", n++, $$1; }' < $< >$@
150
151.def.hin :
152	@echo "making $@ from $<"
153	@$(AWK) 'BEGIN{printf "/* vile:cmode */\n";}/^CASE_/{printf "#define %s %d\n", $$1, n++}' < $< >$@
154
155.man.$(manext) :
156	$(SHELL) ./minstall "$(INSTALL_DATA)" $< $@ $(appsdir) $(CLASS) $* $* $(pixmapdir)
157
158@NROFF_NOTE@.$(manext).txt :
159@NROFF_NOTE@	$(SHELL) -c "tbl $*.$(manext) | nroff -man | col -bx" >$@
160@NROFF_NOTE@
161@NROFF_NOTE@.ms.txt :
162@NROFF_NOTE@	$(SHELL) -c "tbl $*.$(manext) | nroff -ms | col -bx" >$@
163@NROFF_NOTE@
164
165@MAN2HTML_NOTE@.$(manext).html :
166@MAN2HTML_NOTE@	./@MAN2HTML_TEMP@ $* $(manext) man >$@
167@MAN2HTML_NOTE@
168@GROFF_NOTE@.$(manext).ps :
169@GROFF_NOTE@	$(SHELL) -c "tbl $*.$(manext) | groff -man" >$@
170@GROFF_NOTE@
171@GROFF_NOTE@.$(manext).txt :
172@GROFF_NOTE@	GROFF_NO_SGR=stupid $(SHELL) -c "tbl $*.$(manext) | groff -rHY=0 -Tascii -man | col -bx" >$@
173@GROFF_NOTE@
174@MAN2HTML_NOTE@.ms.html :
175@MAN2HTML_NOTE@	./@MAN2HTML_TEMP@ $* ms ms >$@
176@MAN2HTML_NOTE@
177@GROFF_NOTE@.ms.ps :
178@GROFF_NOTE@	$(SHELL) -c "tbl $< | groff -ms" >$@
179@GROFF_NOTE@
180@GROFF_NOTE@.ms.txt :
181@GROFF_NOTE@	GROFF_NO_SGR=stupid $(SHELL) -c "tbl $< | groff -rHY=0 -Tascii -ms | col -bx" >$@
182@GROFF_NOTE@
183@GROFF_NOTE@.ps.pdf :
184@GROFF_NOTE@	ps2pdf $*.ps
185################################################################################
186
187VTPARSE_H = VTparse.h VTparse.hin
188TEKPARSE_H = Tekparse.h Tekparse.hin
189
190main$o : main.h
191misc$o : version.h
192
193$(OBJS1) : xterm.h ptyx.h fontutils.h menu.h xtermcfg.h
194main$o resize$o screen$o : xterm_io.h
195
196xterm$x : $(OBJS1)
197	@ECHO_LD@$(SHELL) $(srcdir)/plink.sh $(LINK) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS1) $(LIBS) $(EXTRA_LOADFLAGS)
198
199resize$x : $(OBJS2)
200	@ECHO_LD@$(SHELL) $(srcdir)/plink.sh $(LINK) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS2) $(LIBS)
201
202256colres.h :
203	-$(RM) $@
204	perl $(srcdir)/256colres.pl > $@
205
20688colres.h :
207	-$(RM) $@
208	perl $(srcdir)/88colres.pl > $@
209
210charproc$o : $(VTPARSE_H) main.h @CHARPROC_DEPS@
211graphics_regis$o : $(VTPARSE_H)
212graphics_sixel$o : $(VTPARSE_H)
213misc$o : $(VTPARSE_H)
214VTPrsTbl$o : $(VTPARSE_H)
215
216charproc$o \
217graphics$o \
218graphics_regis$o \
219graphics_sixel$o \
220main$o \
221misc$o \
222screen$o \
223util$o : graphics.h
224
225TekPrsTbl$o : $(TEKPARSE_H)
226Tekproc$o : $(TEKPARSE_H)
227
228misc$o : builtin_icons.h
229
230trace$o : VTparse.cin Tekparse.cin
231
232# do this to quiet gcc -Wcast-qual warnings
233builtin_icons.h :
234	@echo "#if OPT_BUILTIN_XPMS" >$@
235	@echo "#include <icons/mini.xterm.xpms>" >>$@
236	@echo "#include <icons/filled-xterm.xpms>" >>$@
237	@echo "#include <icons/xterm.xpms>" >>$@
238	@echo "#include <icons/xterm-color.xpms>" >>$@
239	@echo "#else" >>$@
240	@sed -e 's/static char \* /static const char * /' $(srcdir)/icons/mini.xterm_48x48.xpm >>$@
241	@echo "#endif" >>$@
242	@echo "made $@"
243
244################################################################################
245test_charclass$x : $(srcdir)/charclass.c
246	@ECHO_LD@$(SHELL) $(srcdir)/plink.sh $(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -DTEST_DRIVER $(srcdir)/charclass.c $(LDFLAGS) $(LIBS)
247
248################################################################################
249test_ptydata$x : $(srcdir)/ptydata.c
250	@ECHO_LD@$(SHELL) $(srcdir)/plink.sh $(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -DTEST_DRIVER $(srcdir)/ptydata.c $(LDFLAGS) $(LIBS)
251
252################################################################################
253test_wcwidth$x : $(srcdir)/wcwidth.c
254	@ECHO_LD@$(SHELL) $(srcdir)/plink.sh $(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -DTEST_DRIVER $(srcdir)/wcwidth.c $(LDFLAGS) $(LIBS)
255
256################################################################################
257actual_xterm  = `echo xterm|        sed '$(transform)'`
258actual_resize = `echo resize|       sed '$(transform)'`
259actual_uxterm = `echo uxterm|       sed '$(transform)'`
260actual_k8term = `echo koi8rxterm|   sed '$(transform)'`
261
262binary_xterm  = $(actual_xterm)$x
263binary_resize = $(actual_resize)$x
264binary_uxterm = $(actual_uxterm)
265binary_k8term = $(actual_k8term)
266
267install \
268install-bin \
269install-full :: xterm$x resize$x $(BINDIR)
270@MAY_SETUID@	$(SHELL) $(srcdir)/sinstall.sh @SINSTALL_OPTS@ "$(INSTALL_PROGRAM)" xterm$x  @XTERM_PATH@ $(BINDIR)/$(binary_xterm)
271@NOT_SETUID@	$(INSTALL_PROGRAM) xterm$x $(BINDIR)/$(binary_xterm)
272	$(INSTALL_PROGRAM) -m  755 resize$x $(BINDIR)/$(binary_resize)
273
274EDIT_SCRIPT = sed -e s,=xterm,=\$$name, -e s,XTerm,$(CLASS),
275
276InstallLink = \
277	if test @XTERM_SYMLINK@ != NONE \
278	&& test \$$source != NONE \
279	&& test \$$source != \$$target ; then \
280		cd \$$TARGET && ( \
281			$(RM) \$$source ; \
282			$(LN_S) \$$target \$$source ; \
283			echo \"... created symbolic link:\" ; \
284			ls -l \$$target \$$source ) ; \
285	fi
286
287InstallBinLink = TARGET=$(BINDIR); $(InstallLink)
288InstallManLink = TARGET=$(MANDIR); $(InstallLink)
289
290InstallScript = \
291	echo \"... installing $(BINDIR)/\$$target\"; \
292	name=$(binary_xterm); \
293	$(EDIT_SCRIPT) $(srcdir)/\$$source >\$$source.tmp; \
294	$(INSTALL_SCRIPT) -m  755 \$$source.tmp $(BINDIR)/\$$target; \
295	$(RM) \$$source.tmp
296
297install \
298install-bin \
299install-scripts \
300install-full :: $(BINDIR)
301	@$(SHELL) -c "source=\"@XTERM_SYMLINK@\"; \
302		target=\"$(binary_xterm)\"; \
303		$(InstallBinLink)"
304	@$(SHELL) -c "source=\"resize\"; \
305		target=\"$(binary_resize)\"; \
306		$(InstallBinLink)"
307	@$(SHELL) -c "source=\"uxterm\"; \
308		target=\"$(binary_uxterm)\"; \
309		$(InstallScript); \
310		$(InstallBinLink)"
311	@$(SHELL) -c "source=\"koi8rxterm\"; \
312		target=\"$(binary_k8term)\"; \
313		$(InstallScript); \
314		$(InstallBinLink)"
315
316install \
317install-man \
318install-full :: $(MANDIR)
319	@-$(SHELL) -c "for source in xterm resize uxterm koi8rxterm ; \
320		do \
321			target=\`echo \"\$$source\" | sed '@program_transform_name@'\`; \
322			$(SHELL) ./minstall \"$(INSTALL_DATA)\" \
323				$(srcdir)/\$$source.man  \
324				$(MANDIR)/\$$target.$(manext) \
325				$(appsdir) \
326				$(CLASS) \
327				\$$source \
328				\$$target \
329				$(pixmapdir); \
330		done"
331	@-$(SHELL) -c "if test @XTERM_SYMLINK@ != NONE ; then \
332		source=$(actual_xterm).$(manext); \
333		target=@XTERM_SYMLINK@.$(manext); \
334		cd $(MANDIR) && ( \
335			$(RM) \$$target ; \
336			$(LN_S) \$$source \$$target ; \
337			echo '... created symbolic link:' ; \
338			ls -l \$$source \$$target ; \
339			) \
340		fi"
341
342APP_NAMES = XTerm UXTerm KOI8RXTerm
343
344@no_appsdir@install \
345@no_appsdir@install-app \
346@no_appsdir@install-full :: $(APPSDIR)
347@no_appsdir@	@-$(SHELL) -c 'for s in $(APP_NAMES); \
348@no_appsdir@	do \
349@no_appsdir@		echo "** $$s"; \
350@no_appsdir@		d=`echo $$s | sed -e s/XTerm/$(CLASS)/`; \
351@no_appsdir@		echo installing $(APPSDIR)/$$d; \
352@no_appsdir@		sed -e s/XTerm/$(CLASS)/ $(srcdir)/$$s.ad >XTerm.tmp; \
353@no_appsdir@		$(INSTALL_DATA) XTerm.tmp $(APPSDIR)/$$d; \
354@no_appsdir@		echo installing $(APPSDIR)/$$d-color; \
355@no_appsdir@		sed -e s/XTerm/$$d/ $(srcdir)/XTerm-col.ad >XTerm.tmp; \
356@no_appsdir@		$(INSTALL_DATA) XTerm.tmp $(APPSDIR)/$$d-color; \
357@no_appsdir@	done'
358@no_appsdir@	@$(RM) XTerm.tmp
359@no_icondir@	@echo "... installed app-defaults"
360
361@no_icondir@ICON_LIST = @ICON_LIST@
362@no_icondir@ICON_THEME = @ICON_THEME@
363@no_icondir@install \
364@no_icondir@install-icon \
365@no_icondir@install-full :: $(ICONDIR)
366@no_icondir@	@ECHO_CC@ACTUAL_XTERM=$(actual_xterm) $(SHELL) -c '\
367@no_icondir@		h=$(ICONDIR)/$(ICON_THEME); \
368@no_icondir@		for n in $(ICON_LIST); \
369@no_icondir@		do \
370@no_icondir@			x=$$ACTUAL_XTERM; \
371@no_icondir@			l=`echo "$$n" | cut -f1 -d:`; \
372@no_icondir@			r=`echo "$$n" | cut -f2 -d: |sed -e "s,xterm,$$ACTUAL_XTERM,"`; \
373@no_icondir@			test -z "$$r" && continue; \
374@no_icondir@			d=$$h/`echo "$$r" | sed -e "s,/[^/]*$$,,"`; \
375@no_icondir@			test -d "$$d" || mkdir -p "$$d"; \
376@no_icondir@			echo "installing icon $$h/$$r"; \
377@no_icondir@			$(INSTALL_DATA) $$l $$h/$$r; \
378@no_icondir@			s=`echo "$$r" | sed -e '"'s,^.*\.,.,'"'`; \
379@no_icondir@			t=$(ICON_SYMLINK)$$s; \
380@no_icondir@			b=`basename $$n $$s | sed -e "s,_[1-9][0-9]*x.*,,"`; \
381@no_icondir@			if test "$(ICON_SYMLINK)" != NONE ; then \
382@no_icondir@				if test "$$r" != "$$t" ; then \
383@no_icondir@					if test "x$$b" = "x$(ICON_NAME)" ; then \
384@no_icondir@						echo "linking $$r -> $$t"; \
385@no_icondir@						( cd $$h; $(RM) $$t; $(LN_S) $$r $$t; ) \
386@no_icondir@					fi \
387@no_icondir@				fi \
388@no_icondir@			fi \
389@no_icondir@		done'
390@no_icondir@	@echo "... installed icons"
391
392@no_pixmapdir@install \
393@no_pixmapdir@install-icon \
394@no_pixmapdir@install-full :: $(PIXMAPDIR)
395@no_pixmapdir@	@ECHO_CC@ACTUAL_XTERM=$(actual_xterm) $(SHELL) -c '\
396@no_pixmapdir@		h=$(PIXMAPDIR); \
397@no_pixmapdir@		for n in $(srcdir)/icons/*xterm*_*x*.xpm; \
398@no_pixmapdir@		do \
399@no_pixmapdir@			l=`basename $$n`; \
400@no_pixmapdir@			r=`echo "$$l" | sed -e "s,xterm,$$ACTUAL_XTERM,"`; \
401@no_pixmapdir@			echo "installing pixmap $$h/$$r"; \
402@no_pixmapdir@			$(INSTALL_DATA) $(srcdir)/icons/$$l $$h/$$r; \
403@no_pixmapdir@			s=`echo "$$r" | sed -e '"'s,^.*\.,.,'"'`; \
404@no_pixmapdir@			t=$(ICON_SYMLINK)$$s; \
405@no_pixmapdir@			b=`basename $$n $$s | sed -e "s,_[1-9][0-9]*x.*,,"`; \
406@no_pixmapdir@			if test "$(ICON_SYMLINK)" != NONE ; then \
407@no_pixmapdir@				if test "x$$r" != "$$t" ; then \
408@no_pixmapdir@					if test "x$$b" = "x$(ICON_NAME)" ; then \
409@no_pixmapdir@						echo "linking $$r -> $$t"; \
410@no_pixmapdir@						( cd $$h; $(RM) $$t; $(LN_S) $$r $$t; ) \
411@no_pixmapdir@					fi \
412@no_pixmapdir@				fi \
413@no_pixmapdir@			fi \
414@no_pixmapdir@		done'
415@no_pixmapdir@	@echo "... installed icons"
416
417install ::
418	@echo 'Completed installation of executables and documentation.'
419	@echo 'Use "make install-ti" to install terminfo description.'
420
421TERMINFO_DIR = @TERMINFO_DIR@
422SET_TERMINFO = @SET_TERMINFO@
423
424@no_ticprog@install-full \
425@no_ticprog@install-ti :: $(TERMINFO_DIR)
426@no_ticprog@	@echo "Installing $(srcdir)/terminfo"
427@no_ticprog@	@$(SHELL) -c "chmod +x ./run-tic.sh"
428@no_ticprog@	@$(SHELL) -c "$(SET_TERMINFO) ./run-tic.sh $(srcdir)/terminfo"
429@no_ticprog@	@echo 'Completed installation of terminfo description.'
430
431install-full \
432install-tc ::
433	@-$(SHELL) -c "if test -f /etc/termcap ; then echo 'You must install the termcap entry manually by editing /etc/termcap'; fi"
434
435installdirs : $(INSTALL_DIRS)
436################################################################################
437
438UninstallLink = \
439	if test @XTERM_SYMLINK@ != NONE \
440	&& test \$$source != NONE \
441	&& test \$$source != \$$target \
442	&& test -h \$$TARGET/\$$source ; then \
443		echo \"... removing \$$TARGET/\$$source\"; \
444		cd \$$TARGET && \
445		$(RM) \$$source; \
446	fi
447
448UninstallBinLink = TARGET=$(BINDIR); $(UninstallLink)
449UninstallManLink = TARGET=$(MANDIR); $(UninstallLink)
450
451UninstallBinary = \
452	echo \"... removing $(BINDIR)/\$$target\"; \
453	$(RM) $(BINDIR)/\$$target
454
455uninstall \
456uninstall-bin \
457uninstall-full ::
458	@-$(SHELL) -c "source=\"@XTERM_SYMLINK@\"; \
459		target=\"$(binary_xterm)\"; \
460		$(UninstallBinLink); \
461		$(UninstallBinary)"
462	@-$(SHELL) -c "source=\"resize\"; \
463		target=\"$(binary_resize)\"; \
464		$(UninstallBinLink); \
465		$(UninstallBinary)"
466
467uninstall \
468uninstall-bin \
469uninstall-scripts \
470uninstall-full ::
471	@-$(SHELL) -c "source=\"uxterm\"; \
472		target=\"$(binary_uxterm)\"; \
473		$(UninstallBinLink); \
474		$(UninstallBinary)"
475	@-$(SHELL) -c "source=\"koi8rxterm\"; \
476		target=\"$(binary_k8term)\"; \
477		$(UninstallBinLink); \
478		$(UninstallBinary)"
479
480uninstall \
481uninstall-man \
482uninstall-full ::
483	@-$(SHELL) -c "\
484		source=@XTERM_SYMLINK@.$(manext); \
485		target=$(actual_xterm).$(manext); \
486		$(UninstallManLink)"
487	@-$(SHELL) -c "for source in \
488		$(actual_xterm).$(manext) \
489		$(actual_resize).$(manext) \
490		$(actual_uxterm).$(manext) \
491		$(actual_k8term).$(manext); \
492		do \
493			echo \"... removing $(MANDIR)/\$$source\"; \
494			$(RM) $(MANDIR)/\$$source; \
495		done"
496
497@no_appsdir@uninstall \
498@no_appsdir@uninstall-app \
499@no_appsdir@uninstall-full ::
500@no_appsdir@	-@ECHO_CC@$(SHELL) -c 'for s in $(APP_NAMES); \
501@no_appsdir@	do \
502@no_appsdir@		echo "** $$s"; \
503@no_appsdir@		d=`echo $$s | sed -e s/XTerm/$(CLASS)/`; \
504@no_appsdir@		echo uninstalling $(APPSDIR)/$$d; \
505@no_appsdir@		$(RM) $(APPSDIR)/$$d; \
506@no_appsdir@		echo uninstalling $(APPSDIR)/$$d-color; \
507@no_appsdir@		$(RM) $(APPSDIR)/$$d-color; \
508@no_appsdir@	done'
509
510@no_icondir@uninstall \
511@no_icondir@uninstall-icon \
512@no_icondir@uninstall-full ::
513@no_icondir@	-@ECHO_CC@$(SHELL) -c 'ACTUAL_XTERM=$(actual_xterm) ; \
514@no_icondir@		for n in $(ICON_LIST); \
515@no_icondir@		do \
516@no_icondir@		r=`echo "$$n" | sed -e s,\^.\*:,, -e s,xterm,$$ACTUAL_XTERM,`; \
517@no_icondir@		test -z "$$r" && continue; \
518@no_icondir@		h=$(ICONDIR)/$(ICON_THEME); \
519@no_icondir@		test -f $$h/$$r || continue; \
520@no_icondir@		echo removing $$h/$$r; \
521@no_icondir@		$(RM) $$h/$$r; \
522@no_icondir@		done'
523@no_icondir@	@echo "... removed icons"
524
525@no_pixmapdir@uninstall \
526@no_pixmapdir@uninstall-icon \
527@no_pixmapdir@uninstall-full ::
528@no_pixmapdir@	-@$(SHELL) -c 'ACTUAL_XTERM=$(actual_xterm) ; \
529@no_pixmapdir@		for n in $(srcdir)/icons/*xterm*_32x32.xpm $(srcdir)/icons/*xterm*_48x48.xpm; \
530@no_pixmapdir@		do \
531@no_pixmapdir@			l=`basename $$n`; \
532@no_pixmapdir@			r=`echo "$$l" | sed -e "s,xterm,$$ACTUAL_XTERM,"`; \
533@no_pixmapdir@			echo removing $(PIXMAPDIR)/$$r; \
534@no_pixmapdir@			$(RM) $(PIXMAPDIR)/$$r; \
535@no_pixmapdir@		done'
536@no_pixmapdir@	@echo "... removed icons"
537################################################################################
538# Desktop-utils does not provide an uninstall, and is not uniformly available.
539@desktop_utils@DESKTOP_FILES = $(srcdir)/xterm.desktop $(srcdir)/uxterm.desktop
540@desktop_utils@DESKTOP_FLAGS = @DESKTOP_FLAGS@
541@desktop_utils@install-desktop \
542@desktop_utils@install-full ::
543@desktop_utils@	ACTUAL_XTERM=$(actual_xterm) \
544@desktop_utils@	$(SHELL) -c 'for n in $(DESKTOP_FILES); \
545@desktop_utils@		do $(SHELL) df-install $$ACTUAL_XTERM $(ICON_NAME) DESTDIR="$(DESTDIR)" $(DESKTOP_FLAGS) $$n; \
546@desktop_utils@		done'
547################################################################################
548check : $(TEST_PROGRAMS)
549	@ echo "See demos in vttests/* (use vttest for system-level testing)"
550	@ $(SHELL) -c 'echo "** executing test_charclass"; \
551		./test_charclass'
552	@ $(SHELL) -c 'echo "** executing test_wcwidth"; \
553		for range in 32-126 160-0xff00 0x10000-0x11000; \
554		do echo ".. range $$range"; \
555		./test_wcwidth -s $$range; \
556		./test_wcwidth -s $$range -w; \
557	done'
558	@ $(SHELL) -c 'echo "** executing test_ptydata"; \
559		./test_ptydata -a'
560################################################################################
561mostlyclean :
562	-$(RM) *$o *.[is] XTerm[1-9]*.* Xterm.log.* XtermLog.* .pure core *~ *.bak *.BAK *.out *.tmp
563
564clean : mostlyclean
565	-$(RM) $(PROGRAMS) $(TEST_PROGRAMS) $(AUTO_SOURCE)
566
567sources : $(AUTO_SOURCE)
568
569distclean :: clean
570	-$(RM) Makefile config.status config.cache config.log xtermcfg.h
571	-$(RM) df-install minstall run-tic.sh
572
573distclean \
574docs-clean ::
575	-$(RM) *.ps *.pdf *.png
576	-$(SHELL) -c 'for p in xterm resize uxterm koi8rxterm; \
577	do \
578		$(RM) $$p.html $$p.$(manext) $$p.txt; \
579	done'
580	-$(RM) ctlseqs.html ctlseqs.$(manext)
581
582distclean ::
583	-$(RM) man2html.tmp
584
585realclean : distclean
586	-$(RM) tags TAGS
587
588maintainer-clean : realclean
589	-$(RM) 256colres.h 88colres.h
590################################################################################
591TIC=tic
592terminfo.out : terminfo		; $(TIC) -a -I -1 terminfo >$@
593termcap.out : termcap		; $(TIC) -a -C -U termcap >$@
594################################################################################
595docs-ctlseqs \
596docs :: $(srcdir)/ctlseqs.txt @MAN2HTML_NOTE@ ctlseqs.html @GROFF_NOTE@ ctlseqs.pdf ctlseqs.ps
597
598ctlseqs.html : $(srcdir)/ctlseqs.ms
599ctlseqs.pdf : ctlseqs.ps
600ctlseqs.ps : $(srcdir)/ctlseqs.ms
601ctlseqs.txt : $(srcdir)/ctlseqs.ms
602################################################################################
603docs-resize \
604docs ::  resize.txt @MAN2HTML_NOTE@ resize.html @GROFF_NOTE@ resize.pdf resize.ps
605resize.html : resize.$(manext)
606resize.pdf : resize.ps
607resize.ps : resize.$(manext)
608resize.txt : resize.$(manext)
609################################################################################
610docs-xterm \
611docs ::  xterm.txt @MAN2HTML_NOTE@ xterm.html @GROFF_NOTE@ xterm.pdf xterm.ps
612xterm.html : xterm.$(manext)
613xterm.pdf : xterm.ps
614xterm.ps : xterm.$(manext)
615xterm.txt : xterm.$(manext)
616################################################################################
617docs-uxterm \
618docs ::  uxterm.txt @MAN2HTML_NOTE@ uxterm.html @GROFF_NOTE@ uxterm.pdf uxterm.ps
619uxterm.html : uxterm.$(manext)
620uxterm.pdf : uxterm.ps
621uxterm.ps : uxterm.$(manext)
622uxterm.txt : uxterm.$(manext)
623################################################################################
624docs-koi8rxterm \
625docs ::  koi8rxterm.txt @MAN2HTML_NOTE@ koi8rxterm.html @GROFF_NOTE@ koi8rxterm.pdf koi8rxterm.ps
626koi8rxterm.html : koi8rxterm.$(manext)
627koi8rxterm.pdf : koi8rxterm.ps
628koi8rxterm.ps : koi8rxterm.$(manext)
629koi8rxterm.txt : koi8rxterm.$(manext)
630################################################################################
631lint :
632	$(LINT) $(LINT_OPTS) $(CPPFLAGS) $(SRCS1)
633	$(LINT) $(LINT_OPTS) $(CPPFLAGS) $(SRCS2)
634
635tags :
636	$(CTAGS) $(SRCS) $(HDRS)
637
638TAGS :
639	$(ETAGS) $(SRCS) $(HDRS)
640
641$(TERMINFO_DIR) $(INSTALL_DIRS) :
642	mkdir -p $@
643
644ALWAYS :
645
646depend : $(TABLES)
647	makedepend -- $(CPPFLAGS) -- $(SRCS)
648
649# DO NOT DELETE THIS LINE -- make depend depends on it.
650