104b94745Smrg## $XTermId: Makefile.in,v 1.266 2023/12/10 19:32:38 tom Exp $
220d2c4d2Smrg# -----------------------------------------------------------------------------
320d2c4d2Smrg# this file is part of xterm
420d2c4d2Smrg#
55307cd1aSmrg# Copyright 1997-2022,2023 by Thomas E. Dickey
620d2c4d2Smrg#
720d2c4d2Smrg#                         All Rights Reserved
820d2c4d2Smrg#
920d2c4d2Smrg# Permission is hereby granted, free of charge, to any person obtaining a
1020d2c4d2Smrg# copy of this software and associated documentation files (the
1120d2c4d2Smrg# "Software"), to deal in the Software without restriction, including
1220d2c4d2Smrg# without limitation the rights to use, copy, modify, merge, publish,
1320d2c4d2Smrg# distribute, sublicense, and/or sell copies of the Software, and to
1420d2c4d2Smrg# permit persons to whom the Software is furnished to do so, subject to
1520d2c4d2Smrg# the following conditions:
1620d2c4d2Smrg#
1720d2c4d2Smrg# The above copyright notice and this permission notice shall be included
1820d2c4d2Smrg# in all copies or substantial portions of the Software.
1920d2c4d2Smrg#
2020d2c4d2Smrg# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2120d2c4d2Smrg# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2220d2c4d2Smrg# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
2320d2c4d2Smrg# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
2420d2c4d2Smrg# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
2520d2c4d2Smrg# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
2620d2c4d2Smrg# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2720d2c4d2Smrg#
2820d2c4d2Smrg# Except as contained in this notice, the name(s) of the above copyright
2920d2c4d2Smrg# holders shall not be used in advertising or otherwise to promote the
3020d2c4d2Smrg# sale, use or other dealings in this Software without prior written
3120d2c4d2Smrg# authorization.
3220d2c4d2Smrg# -----------------------------------------------------------------------------
33d522f475Smrg
34d522f475SmrgSHELL		= /bin/sh
35d522f475Smrg
36d522f475Smrg#### Start of system configuration section. ####
37d522f475Smrg
38d522f475Smrgsrcdir		= @srcdir@
39d522f475SmrgVPATH  		= @srcdir@
40d522f475Smrg
41d522f475Smrgx		= @EXEEXT@
42d522f475Smrgo		= .@OBJEXT@
43d522f475Smrg
44d522f475SmrgCC		= @CC@
45d522f475SmrgCPP		= @CPP@
46d522f475SmrgAWK		= @AWK@
47d522f475SmrgLINK		= $(CC) $(CFLAGS)
48d522f475Smrg
4920d2c4d2SmrgCTAGS		= @CTAGS@
5020d2c4d2SmrgETAGS		= @ETAGS@
5120d2c4d2Smrg
52d522f475SmrgLN_S		= @LN_S@
53d522f475SmrgRM              = rm -f
54d522f475SmrgLINT		= @LINT@
552e4f8982SmrgLINT_OPTS	= @LINT_OPTS@
56d522f475Smrg
57d522f475SmrgINSTALL		= @INSTALL@
58d522f475SmrgINSTALL_PROGRAM	= @INSTALL_PROGRAM@
59d522f475SmrgINSTALL_SCRIPT	= @INSTALL_SCRIPT@
60d522f475SmrgINSTALL_DATA	= @INSTALL_DATA@
61d522f475Smrgtransform	= @program_transform_name@
62d522f475Smrg
63d522f475SmrgEXTRA_CFLAGS	= @EXTRA_CFLAGS@
64d522f475SmrgEXTRA_CPPFLAGS	= @EXTRA_CPPFLAGS@
65d522f475SmrgEXTRA_LOADFLAGS	= @IMAKE_LOADFLAGS@
66d522f475Smrg
674419d26bSmrgPIXMAPDIR_DEF	= @no_pixmapdir@-DPIXMAP_ROOTDIR=\"@PIXMAPDIR@/\"
68f2e35a3aSmrgCPPFLAGS	= -I. -I$(srcdir) -DHAVE_CONFIG_H @CPPFLAGS@ -DDEFCLASS=\"@APP_CLASS@\" $(PIXMAPDIR_DEF) $(EXTRA_CPPFLAGS)
69d522f475SmrgCFLAGS		= @CFLAGS@ $(EXTRA_CFLAGS)
70a1f3da82SmrgLDFLAGS		= @LDFLAGS@ @EXTRA_LDFLAGS@
71d522f475SmrgLIBS		= @LIBS@
72d522f475Smrg
73d522f475Smrgprefix		= @prefix@
74d522f475Smrgexec_prefix	= @exec_prefix@
750bd37d32Smrgdatarootdir	= @datarootdir@
760bd37d32Smrgdatadir		= @datadir@
77d522f475Smrg
78d522f475Smrgmanext		= 1
79d522f475Smrgbindir		= @bindir@
80d522f475Smrglibdir		= @libdir@
81d522f475Smrgmandir		= @mandir@/man$(manext)
820bd37d32Smrgappsdir		= @APPSDIR@
830bd37d32Smrgicondir		= @ICONDIR@
840bd37d32Smrgpixmapdir	= @PIXMAPDIR@
85d522f475Smrg
86d522f475Smrg#### End of system configuration section. ####
87d522f475Smrg
880bd37d32SmrgICON_NAME	= @ICON_NAME@
890bd37d32SmrgICON_SYMLINK	= @ICON_SYMLINK@
900bd37d32Smrg
91d522f475SmrgDESTDIR		=
92d522f475SmrgBINDIR		= $(DESTDIR)$(bindir)
93d522f475SmrgLIBDIR		= $(DESTDIR)$(libdir)
94d522f475SmrgMANDIR		= $(DESTDIR)$(mandir)
95d522f475SmrgAPPSDIR		= $(DESTDIR)$(appsdir)
96d522f475Smrg
970bd37d32Smrg@no_icondir@ICONDIR		= $(DESTDIR)$(icondir)
980bd37d32Smrg@no_pixmapdir@PIXMAPDIR	= $(DESTDIR)$(pixmapdir)
990bd37d32Smrg
1000bd37d32SmrgINSTALL_DIRS    = $(BINDIR) $(APPSDIR) $(ICONDIR) $(PIXMAPDIR) $(MANDIR)
101d522f475Smrg
102e39b573cSmrgCLASS		= @APP_CLASS@
103d522f475SmrgEXTRAHDR	= @EXTRAHDRS@
104d522f475SmrgEXTRASRC	= @EXTRASRCS@
105d522f475SmrgEXTRAOBJ	= @EXTRAOBJS@
106d522f475Smrg
107f2e35a3aSmrgAUTO_SOURCE	= \
108f2e35a3aSmrg		builtin_icons.h \
109f2e35a3aSmrg		VTparse.cin \
110f2e35a3aSmrg		Tekparse.cin \
111f2e35a3aSmrg		VTparse.hin \
112f2e35a3aSmrg		Tekparse.hin
113f2e35a3aSmrg
114d522f475Smrg          SRCS1 = button.c cachedGCs.c charproc.c charsets.c cursor.c \
115d522f475Smrg	  	  data.c doublechr.c fontutils.c input.c \
116956cc18dSsnj		  linedata.c main.c menu.c misc.c \
117956cc18dSsnj		  print.c ptydata.c scrollback.c \
1180bd37d32Smrg		  screen.c scrollbar.c tabs.c util.c version.c xstrings.c \
1190bd37d32Smrg		  xtermcap.c VTPrsTbl.c $(EXTRASRC)
120d522f475Smrg          OBJS1 = button$o cachedGCs$o charproc$o charsets$o cursor$o \
121d522f475Smrg	  	  data$o doublechr$o fontutils$o input$o \
122956cc18dSsnj		  linedata$o main$o menu$o misc$o \
123956cc18dSsnj		  print$o ptydata$o scrollback$o \
1240bd37d32Smrg		  screen$o scrollbar$o tabs$o util$o version$o xstrings$o \
1250bd37d32Smrg		  xtermcap$o VTPrsTbl$o $(EXTRAOBJ)
1260bd37d32Smrg          SRCS2 = resize.c version.c xstrings.c
1270bd37d32Smrg          OBJS2 = resize$o version$o xstrings$o
128d522f475Smrg           SRCS = $(SRCS1) $(SRCS2)
129d522f475Smrg           OBJS = $(OBJS1) $(OBJS2)
130913cc679Smrg           HDRS = VTparse.h data.h error.h fontutils.h main.h menu.h \
131d522f475Smrg                  ptyx.h version.h xstrings.h xterm.h xtermcap.h $(EXTRAHDR)
132d522f475Smrg       PROGRAMS = xterm$x resize$x
133f2e35a3aSmrg  TEST_PROGRAMS = test_charclass$x test_ptydata$x test_wcwidth$x
134d522f475Smrg
135d522f475Smrgall :	$(PROGRAMS)
136d522f475Smrg################################################################################
1372e4f8982Smrg.SUFFIXES : .i .def .cin .hin .$(manext) .ms .man .txt @MAN2HTML_NOTE@ .html @GROFF_NOTE@ .ps .pdf
138d522f475Smrg
139d522f475Smrg.c$o :
14020d2c4d2Smrg	@RULE_CC@
141d522f475Smrg	@ECHO_CC@$(CC) $(CPPFLAGS) $(CFLAGS) -c $(srcdir)/$*.c
142d522f475Smrg
143d522f475Smrg.c.i :
14420d2c4d2Smrg	@RULE_CC@
145d522f475Smrg	@ECHO_CC@$(CPP) -C $(CPPFLAGS) $*.c >$@
146d522f475Smrg
1472e4f8982Smrg.def.cin :
148f2e35a3aSmrg	@echo "making $@ from $<"
149f2e35a3aSmrg	@$(AWK) 'BEGIN{printf "/* vile:cmode */\n";}/^CASE_/{printf "{ %d, \"%s\" },\n", n++, $$1; }' < $< >$@
1502e4f8982Smrg
151d522f475Smrg.def.hin :
152f2e35a3aSmrg	@echo "making $@ from $<"
153f2e35a3aSmrg	@$(AWK) 'BEGIN{printf "/* vile:cmode */\n";}/^CASE_/{printf "#define %s %d\n", $$1, n++}' < $< >$@
154d522f475Smrg
155d522f475Smrg.man.$(manext) :
15604b94745Smrg	$(SHELL) ./minstall "$(INSTALL_DATA)" $< $@ $* $*
1570bd37d32Smrg
1580bd37d32Smrg@NROFF_NOTE@.$(manext).txt :
1590bd37d32Smrg@NROFF_NOTE@	$(SHELL) -c "tbl $*.$(manext) | nroff -man | col -bx" >$@
1600bd37d32Smrg@NROFF_NOTE@
1610bd37d32Smrg@NROFF_NOTE@.ms.txt :
1620bd37d32Smrg@NROFF_NOTE@	$(SHELL) -c "tbl $*.$(manext) | nroff -ms | col -bx" >$@
1630bd37d32Smrg@NROFF_NOTE@
1640bd37d32Smrg
16501037d57Smrg@MAN2HTML_NOTE@.$(manext).html :
16601037d57Smrg@MAN2HTML_NOTE@	./@MAN2HTML_TEMP@ $* $(manext) man >$@
16701037d57Smrg@MAN2HTML_NOTE@
1680bd37d32Smrg@GROFF_NOTE@.$(manext).ps :
1690bd37d32Smrg@GROFF_NOTE@	$(SHELL) -c "tbl $*.$(manext) | groff -man" >$@
1700bd37d32Smrg@GROFF_NOTE@
1710bd37d32Smrg@GROFF_NOTE@.$(manext).txt :
172f2e35a3aSmrg@GROFF_NOTE@	GROFF_NO_SGR=stupid $(SHELL) -c "tbl $*.$(manext) | groff -rHY=0 -Tascii -man | col -bx" >$@
1730bd37d32Smrg@GROFF_NOTE@
17401037d57Smrg@MAN2HTML_NOTE@.ms.html :
17501037d57Smrg@MAN2HTML_NOTE@	./@MAN2HTML_TEMP@ $* ms ms >$@
17601037d57Smrg@MAN2HTML_NOTE@
1770bd37d32Smrg@GROFF_NOTE@.ms.ps :
1780bd37d32Smrg@GROFF_NOTE@	$(SHELL) -c "tbl $< | groff -ms" >$@
1790bd37d32Smrg@GROFF_NOTE@
1800bd37d32Smrg@GROFF_NOTE@.ms.txt :
181f2e35a3aSmrg@GROFF_NOTE@	GROFF_NO_SGR=stupid $(SHELL) -c "tbl $< | groff -rHY=0 -Tascii -ms | col -bx" >$@
1820bd37d32Smrg@GROFF_NOTE@
1830bd37d32Smrg@GROFF_NOTE@.ps.pdf :
1840bd37d32Smrg@GROFF_NOTE@	ps2pdf $*.ps
185d522f475Smrg################################################################################
1862e4f8982Smrg
1872e4f8982SmrgVTPARSE_H = VTparse.h VTparse.hin
1882e4f8982SmrgTEKPARSE_H = Tekparse.h Tekparse.hin
1892e4f8982Smrg
190d522f475Smrgmain$o : main.h
191d522f475Smrgmisc$o : version.h
192d522f475Smrg
193f2e35a3aSmrg$(OBJS1) : xterm.h ptyx.h fontutils.h menu.h xtermcfg.h
194d522f475Smrgmain$o resize$o screen$o : xterm_io.h
195d522f475Smrg
196d522f475Smrgxterm$x : $(OBJS1)
1975307cd1aSmrg	@ECHO_LD@$(SHELL) $(srcdir)/plink.sh $(LINK) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS1) $(LIBS) $(EXTRA_LOADFLAGS)
198d522f475Smrg
199d522f475Smrgresize$x : $(OBJS2)
2005307cd1aSmrg	@ECHO_LD@$(SHELL) $(srcdir)/plink.sh $(LINK) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS2) $(LIBS)
201d522f475Smrg
202d522f475Smrg256colres.h :
20301037d57Smrg	-$(RM) $@
204d522f475Smrg	perl $(srcdir)/256colres.pl > $@
205d522f475Smrg
206d522f475Smrg88colres.h :
20701037d57Smrg	-$(RM) $@
208d522f475Smrg	perl $(srcdir)/88colres.pl > $@
209d522f475Smrg
2102e4f8982Smrgcharproc$o : $(VTPARSE_H) main.h @CHARPROC_DEPS@
2114419d26bSmrggraphics_regis$o : $(VTPARSE_H)
2124419d26bSmrggraphics_sixel$o : $(VTPARSE_H)
2134419d26bSmrgmisc$o : $(VTPARSE_H)
2144419d26bSmrgVTPrsTbl$o : $(VTPARSE_H)
2154419d26bSmrg
21604b94745Smrgcharsets$o : charsets.h
21704b94745Smrg
2184419d26bSmrgcharproc$o \
2194419d26bSmrggraphics$o \
2204419d26bSmrggraphics_regis$o \
2214419d26bSmrggraphics_sixel$o \
2224419d26bSmrgmain$o \
2234419d26bSmrgmisc$o \
2244419d26bSmrgscreen$o \
2254419d26bSmrgutil$o : graphics.h
2262e4f8982Smrg
2272e4f8982SmrgTekPrsTbl$o : $(TEKPARSE_H)
2282e4f8982SmrgTekproc$o : $(TEKPARSE_H)
229e0a2b6dfSmrg
230e0a2b6dfSmrgmisc$o : builtin_icons.h
231e0a2b6dfSmrg
2322e4f8982Smrgtrace$o : VTparse.cin Tekparse.cin
2332e4f8982Smrg
2344419d26bSmrg# do this to quiet gcc -Wcast-qual warnings
235e0a2b6dfSmrgbuiltin_icons.h :
236e0a2b6dfSmrg	@echo "#if OPT_BUILTIN_XPMS" >$@
237e0a2b6dfSmrg	@echo "#include <icons/mini.xterm.xpms>" >>$@
238e0a2b6dfSmrg	@echo "#include <icons/filled-xterm.xpms>" >>$@
239e0a2b6dfSmrg	@echo "#include <icons/xterm.xpms>" >>$@
240e0a2b6dfSmrg	@echo "#include <icons/xterm-color.xpms>" >>$@
241e0a2b6dfSmrg	@echo "#else" >>$@
242e0a2b6dfSmrg	@sed -e 's/static char \* /static const char * /' $(srcdir)/icons/mini.xterm_48x48.xpm >>$@
243e0a2b6dfSmrg	@echo "#endif" >>$@
244e0a2b6dfSmrg	@echo "made $@"
245e0a2b6dfSmrg
246f2e35a3aSmrg################################################################################
247f2e35a3aSmrgtest_charclass$x : $(srcdir)/charclass.c
248f2e35a3aSmrg	@ECHO_LD@$(SHELL) $(srcdir)/plink.sh $(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -DTEST_DRIVER $(srcdir)/charclass.c $(LDFLAGS) $(LIBS)
249f2e35a3aSmrg
250f2e35a3aSmrg################################################################################
251f2e35a3aSmrgtest_ptydata$x : $(srcdir)/ptydata.c
252f2e35a3aSmrg	@ECHO_LD@$(SHELL) $(srcdir)/plink.sh $(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -DTEST_DRIVER $(srcdir)/ptydata.c $(LDFLAGS) $(LIBS)
253f2e35a3aSmrg
254f2e35a3aSmrg################################################################################
255f2e35a3aSmrgtest_wcwidth$x : $(srcdir)/wcwidth.c
256f2e35a3aSmrg	@ECHO_LD@$(SHELL) $(srcdir)/plink.sh $(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -DTEST_DRIVER $(srcdir)/wcwidth.c $(LDFLAGS) $(LIBS)
257f2e35a3aSmrg
258d522f475Smrg################################################################################
259d522f475Smrgactual_xterm  = `echo xterm|        sed '$(transform)'`
260d522f475Smrgactual_resize = `echo resize|       sed '$(transform)'`
261d522f475Smrgactual_uxterm = `echo uxterm|       sed '$(transform)'`
262d522f475Smrgactual_k8term = `echo koi8rxterm|   sed '$(transform)'`
263d522f475Smrg
264d522f475Smrgbinary_xterm  = $(actual_xterm)$x
265d522f475Smrgbinary_resize = $(actual_resize)$x
266d522f475Smrgbinary_uxterm = $(actual_uxterm)
267d522f475Smrgbinary_k8term = $(actual_k8term)
268d522f475Smrg
269d522f475Smrginstall \
270d522f475Smrginstall-bin \
271d522f475Smrginstall-full :: xterm$x resize$x $(BINDIR)
272d522f475Smrg@MAY_SETUID@	$(SHELL) $(srcdir)/sinstall.sh @SINSTALL_OPTS@ "$(INSTALL_PROGRAM)" xterm$x  @XTERM_PATH@ $(BINDIR)/$(binary_xterm)
273d522f475Smrg@NOT_SETUID@	$(INSTALL_PROGRAM) xterm$x $(BINDIR)/$(binary_xterm)
274d522f475Smrg	$(INSTALL_PROGRAM) -m  755 resize$x $(BINDIR)/$(binary_resize)
275956cc18dSsnj
276e39b573cSmrgEDIT_SCRIPT = sed -e s,=xterm,=\$$name, -e s,XTerm,$(CLASS),
277e39b573cSmrg
27801037d57SmrgInstallLink = \
27901037d57Smrg	if test @XTERM_SYMLINK@ != NONE \
28001037d57Smrg	&& test \$$source != NONE \
28101037d57Smrg	&& test \$$source != \$$target ; then \
28201037d57Smrg		cd \$$TARGET && ( \
28301037d57Smrg			$(RM) \$$source ; \
28401037d57Smrg			$(LN_S) \$$target \$$source ; \
28501037d57Smrg			echo \"... created symbolic link:\" ; \
28601037d57Smrg			ls -l \$$target \$$source ) ; \
28701037d57Smrg	fi
28801037d57Smrg
28901037d57SmrgInstallBinLink = TARGET=$(BINDIR); $(InstallLink)
29001037d57SmrgInstallManLink = TARGET=$(MANDIR); $(InstallLink)
29101037d57Smrg
29201037d57SmrgInstallScript = \
29301037d57Smrg	echo \"... installing $(BINDIR)/\$$target\"; \
29401037d57Smrg	name=$(binary_xterm); \
29501037d57Smrg	$(EDIT_SCRIPT) $(srcdir)/\$$source >\$$source.tmp; \
29601037d57Smrg	$(INSTALL_SCRIPT) -m  755 \$$source.tmp $(BINDIR)/\$$target; \
29701037d57Smrg	$(RM) \$$source.tmp
29801037d57Smrg
299956cc18dSsnjinstall \
300956cc18dSsnjinstall-bin \
301956cc18dSsnjinstall-scripts \
30201037d57Smrginstall-full :: $(BINDIR)
30301037d57Smrg	@$(SHELL) -c "source=\"@XTERM_SYMLINK@\"; \
30401037d57Smrg		target=\"$(binary_xterm)\"; \
30501037d57Smrg		$(InstallBinLink)"
30601037d57Smrg	@$(SHELL) -c "source=\"resize\"; \
30701037d57Smrg		target=\"$(binary_resize)\"; \
30801037d57Smrg		$(InstallBinLink)"
30901037d57Smrg	@$(SHELL) -c "source=\"uxterm\"; \
31001037d57Smrg		target=\"$(binary_uxterm)\"; \
31101037d57Smrg		$(InstallScript); \
31201037d57Smrg		$(InstallBinLink)"
31301037d57Smrg	@$(SHELL) -c "source=\"koi8rxterm\"; \
31401037d57Smrg		target=\"$(binary_k8term)\"; \
31501037d57Smrg		$(InstallScript); \
31601037d57Smrg		$(InstallBinLink)"
317d522f475Smrg
318d522f475Smrginstall \
319d522f475Smrginstall-man \
320d522f475Smrginstall-full :: $(MANDIR)
32101037d57Smrg	@-$(SHELL) -c "for source in xterm resize uxterm koi8rxterm ; \
3220bd37d32Smrg		do \
32301037d57Smrg			target=\`echo \"\$$source\" | sed '@program_transform_name@'\`; \
32401037d57Smrg			$(SHELL) ./minstall \"$(INSTALL_DATA)\" \
32501037d57Smrg				$(srcdir)/\$$source.man  \
32601037d57Smrg				$(MANDIR)/\$$target.$(manext) \
32701037d57Smrg				\$$source \
32804b94745Smrg				\$$target; \
3290bd37d32Smrg		done"
33001037d57Smrg	@-$(SHELL) -c "if test @XTERM_SYMLINK@ != NONE ; then \
33101037d57Smrg		source=$(actual_xterm).$(manext); \
33201037d57Smrg		target=@XTERM_SYMLINK@.$(manext); \
33301037d57Smrg		cd $(MANDIR) && ( \
33401037d57Smrg			$(RM) \$$target ; \
33501037d57Smrg			$(LN_S) \$$source \$$target ; \
33601037d57Smrg			echo '... created symbolic link:' ; \
33701037d57Smrg			ls -l \$$source \$$target ; \
33801037d57Smrg			) \
33901037d57Smrg		fi"
340d522f475Smrg
34120d2c4d2SmrgAPP_NAMES = XTerm UXTerm KOI8RXTerm
34220d2c4d2Smrg
343d522f475Smrg@no_appsdir@install \
344d522f475Smrg@no_appsdir@install-app \
345d522f475Smrg@no_appsdir@install-full :: $(APPSDIR)
34620d2c4d2Smrg@no_appsdir@	@-$(SHELL) -c 'for s in $(APP_NAMES); \
34720d2c4d2Smrg@no_appsdir@	do \
34820d2c4d2Smrg@no_appsdir@		echo "** $$s"; \
34920d2c4d2Smrg@no_appsdir@		d=`echo $$s | sed -e s/XTerm/$(CLASS)/`; \
35020d2c4d2Smrg@no_appsdir@		echo installing $(APPSDIR)/$$d; \
35120d2c4d2Smrg@no_appsdir@		sed -e s/XTerm/$(CLASS)/ $(srcdir)/$$s.ad >XTerm.tmp; \
35220d2c4d2Smrg@no_appsdir@		$(INSTALL_DATA) XTerm.tmp $(APPSDIR)/$$d; \
35320d2c4d2Smrg@no_appsdir@		echo installing $(APPSDIR)/$$d-color; \
35420d2c4d2Smrg@no_appsdir@		sed -e s/XTerm/$$d/ $(srcdir)/XTerm-col.ad >XTerm.tmp; \
35520d2c4d2Smrg@no_appsdir@		$(INSTALL_DATA) XTerm.tmp $(APPSDIR)/$$d-color; \
35620d2c4d2Smrg@no_appsdir@	done'
35701037d57Smrg@no_appsdir@	@$(RM) XTerm.tmp
358d522f475Smrg@no_icondir@	@echo "... installed app-defaults"
359d522f475Smrg
3600bd37d32Smrg@no_icondir@ICON_LIST = @ICON_LIST@
3610bd37d32Smrg@no_icondir@ICON_THEME = @ICON_THEME@
362d522f475Smrg@no_icondir@install \
363d522f475Smrg@no_icondir@install-icon \
364d522f475Smrg@no_icondir@install-full :: $(ICONDIR)
365f2e35a3aSmrg@no_icondir@	@ECHO_CC@ACTUAL_XTERM=$(actual_xterm) $(SHELL) -c '\
3660bd37d32Smrg@no_icondir@		h=$(ICONDIR)/$(ICON_THEME); \
3670bd37d32Smrg@no_icondir@		for n in $(ICON_LIST); \
3680bd37d32Smrg@no_icondir@		do \
3690bd37d32Smrg@no_icondir@			x=$$ACTUAL_XTERM; \
3700bd37d32Smrg@no_icondir@			l=`echo "$$n" | cut -f1 -d:`; \
371f2e35a3aSmrg@no_icondir@			r=`echo "$$n" | cut -f2 -d: |sed -e "s,xterm,$$ACTUAL_XTERM,"`; \
3720bd37d32Smrg@no_icondir@			test -z "$$r" && continue; \
3730bd37d32Smrg@no_icondir@			d=$$h/`echo "$$r" | sed -e "s,/[^/]*$$,,"`; \
3740bd37d32Smrg@no_icondir@			test -d "$$d" || mkdir -p "$$d"; \
3750bd37d32Smrg@no_icondir@			echo "installing icon $$h/$$r"; \
3760bd37d32Smrg@no_icondir@			$(INSTALL_DATA) $$l $$h/$$r; \
3770bd37d32Smrg@no_icondir@			s=`echo "$$r" | sed -e '"'s,^.*\.,.,'"'`; \
3780bd37d32Smrg@no_icondir@			t=$(ICON_SYMLINK)$$s; \
3790bd37d32Smrg@no_icondir@			b=`basename $$n $$s | sed -e "s,_[1-9][0-9]*x.*,,"`; \
3800bd37d32Smrg@no_icondir@			if test "$(ICON_SYMLINK)" != NONE ; then \
3810bd37d32Smrg@no_icondir@				if test "$$r" != "$$t" ; then \
3820bd37d32Smrg@no_icondir@					if test "x$$b" = "x$(ICON_NAME)" ; then \
3830bd37d32Smrg@no_icondir@						echo "linking $$r -> $$t"; \
38401037d57Smrg@no_icondir@						( cd $$h; $(RM) $$t; $(LN_S) $$r $$t; ) \
3850bd37d32Smrg@no_icondir@					fi \
3860bd37d32Smrg@no_icondir@				fi \
3870bd37d32Smrg@no_icondir@			fi \
3880bd37d32Smrg@no_icondir@		done'
389d522f475Smrg@no_icondir@	@echo "... installed icons"
390d522f475Smrg
3910bd37d32Smrg@no_pixmapdir@install \
3920bd37d32Smrg@no_pixmapdir@install-icon \
3930bd37d32Smrg@no_pixmapdir@install-full :: $(PIXMAPDIR)
394f2e35a3aSmrg@no_pixmapdir@	@ECHO_CC@ACTUAL_XTERM=$(actual_xterm) $(SHELL) -c '\
3950bd37d32Smrg@no_pixmapdir@		h=$(PIXMAPDIR); \
3965307cd1aSmrg@no_pixmapdir@		for n in $(srcdir)/icons/*xterm*_*x*.xpm; \
3970bd37d32Smrg@no_pixmapdir@		do \
3980bd37d32Smrg@no_pixmapdir@			l=`basename $$n`; \
3990bd37d32Smrg@no_pixmapdir@			r=`echo "$$l" | sed -e "s,xterm,$$ACTUAL_XTERM,"`; \
4000bd37d32Smrg@no_pixmapdir@			echo "installing pixmap $$h/$$r"; \
4010bd37d32Smrg@no_pixmapdir@			$(INSTALL_DATA) $(srcdir)/icons/$$l $$h/$$r; \
4020bd37d32Smrg@no_pixmapdir@			s=`echo "$$r" | sed -e '"'s,^.*\.,.,'"'`; \
4030bd37d32Smrg@no_pixmapdir@			t=$(ICON_SYMLINK)$$s; \
4040bd37d32Smrg@no_pixmapdir@			b=`basename $$n $$s | sed -e "s,_[1-9][0-9]*x.*,,"`; \
4050bd37d32Smrg@no_pixmapdir@			if test "$(ICON_SYMLINK)" != NONE ; then \
4060bd37d32Smrg@no_pixmapdir@				if test "x$$r" != "$$t" ; then \
4070bd37d32Smrg@no_pixmapdir@					if test "x$$b" = "x$(ICON_NAME)" ; then \
4080bd37d32Smrg@no_pixmapdir@						echo "linking $$r -> $$t"; \
40901037d57Smrg@no_pixmapdir@						( cd $$h; $(RM) $$t; $(LN_S) $$r $$t; ) \
4100bd37d32Smrg@no_pixmapdir@					fi \
4110bd37d32Smrg@no_pixmapdir@				fi \
4120bd37d32Smrg@no_pixmapdir@			fi \
4130bd37d32Smrg@no_pixmapdir@		done'
4140bd37d32Smrg@no_pixmapdir@	@echo "... installed icons"
4150bd37d32Smrg
416d522f475Smrginstall ::
417d522f475Smrg	@echo 'Completed installation of executables and documentation.'
418d522f475Smrg	@echo 'Use "make install-ti" to install terminfo description.'
419d522f475Smrg
420d522f475SmrgTERMINFO_DIR = @TERMINFO_DIR@
421d522f475SmrgSET_TERMINFO = @SET_TERMINFO@
422d522f475Smrg
42320d2c4d2Smrg@no_ticprog@install-full \
42420d2c4d2Smrg@no_ticprog@install-ti :: $(TERMINFO_DIR)
4255307cd1aSmrg@no_ticprog@	@echo "Installing $(srcdir)/terminfo"
4265307cd1aSmrg@no_ticprog@	@$(SHELL) -c "chmod +x ./run-tic.sh"
4275307cd1aSmrg@no_ticprog@	@$(SHELL) -c "$(SET_TERMINFO) ./run-tic.sh $(srcdir)/terminfo"
42820d2c4d2Smrg@no_ticprog@	@echo 'Completed installation of terminfo description.'
429d522f475Smrg
430d522f475Smrginstall-full \
431d522f475Smrginstall-tc ::
432f2e35a3aSmrg	@-$(SHELL) -c "if test -f /etc/termcap ; then echo 'You must install the termcap entry manually by editing /etc/termcap'; fi"
433d522f475Smrg
434d522f475Smrginstalldirs : $(INSTALL_DIRS)
435d522f475Smrg################################################################################
43601037d57Smrg
43701037d57SmrgUninstallLink = \
43801037d57Smrg	if test @XTERM_SYMLINK@ != NONE \
43901037d57Smrg	&& test \$$source != NONE \
44001037d57Smrg	&& test \$$source != \$$target \
44101037d57Smrg	&& test -h \$$TARGET/\$$source ; then \
44201037d57Smrg		echo \"... removing \$$TARGET/\$$source\"; \
44301037d57Smrg		cd \$$TARGET && \
44401037d57Smrg		$(RM) \$$source; \
44501037d57Smrg	fi
44601037d57Smrg
44701037d57SmrgUninstallBinLink = TARGET=$(BINDIR); $(UninstallLink)
44801037d57SmrgUninstallManLink = TARGET=$(MANDIR); $(UninstallLink)
44901037d57Smrg
45001037d57SmrgUninstallBinary = \
45101037d57Smrg	echo \"... removing $(BINDIR)/\$$target\"; \
45201037d57Smrg	$(RM) $(BINDIR)/\$$target
45301037d57Smrg
454d522f475Smrguninstall \
455d522f475Smrguninstall-bin \
456d522f475Smrguninstall-full ::
45701037d57Smrg	@-$(SHELL) -c "source=\"@XTERM_SYMLINK@\"; \
45801037d57Smrg		target=\"$(binary_xterm)\"; \
45901037d57Smrg		$(UninstallBinLink); \
46001037d57Smrg		$(UninstallBinary)"
46101037d57Smrg	@-$(SHELL) -c "source=\"resize\"; \
46201037d57Smrg		target=\"$(binary_resize)\"; \
46301037d57Smrg		$(UninstallBinLink); \
46401037d57Smrg		$(UninstallBinary)"
465956cc18dSsnj
466956cc18dSsnjuninstall \
467956cc18dSsnjuninstall-bin \
468956cc18dSsnjuninstall-scripts \
469956cc18dSsnjuninstall-full ::
47001037d57Smrg	@-$(SHELL) -c "source=\"uxterm\"; \
47101037d57Smrg		target=\"$(binary_uxterm)\"; \
47201037d57Smrg		$(UninstallBinLink); \
47301037d57Smrg		$(UninstallBinary)"
47401037d57Smrg	@-$(SHELL) -c "source=\"koi8rxterm\"; \
47501037d57Smrg		target=\"$(binary_k8term)\"; \
47601037d57Smrg		$(UninstallBinLink); \
47701037d57Smrg		$(UninstallBinary)"
478d522f475Smrg
479d522f475Smrguninstall \
480d522f475Smrguninstall-man \
481d522f475Smrguninstall-full ::
48201037d57Smrg	@-$(SHELL) -c "\
48301037d57Smrg		source=@XTERM_SYMLINK@.$(manext); \
48401037d57Smrg		target=$(actual_xterm).$(manext); \
48501037d57Smrg		$(UninstallManLink)"
48601037d57Smrg	@-$(SHELL) -c "for source in \
48701037d57Smrg		$(actual_xterm).$(manext) \
48801037d57Smrg		$(actual_resize).$(manext) \
48901037d57Smrg		$(actual_uxterm).$(manext) \
49001037d57Smrg		$(actual_k8term).$(manext); \
49101037d57Smrg		do \
49201037d57Smrg			echo \"... removing $(MANDIR)/\$$source\"; \
49301037d57Smrg			$(RM) $(MANDIR)/\$$source; \
49401037d57Smrg		done"
495d522f475Smrg
496d522f475Smrg@no_appsdir@uninstall \
497d522f475Smrg@no_appsdir@uninstall-app \
498d522f475Smrg@no_appsdir@uninstall-full ::
499f2e35a3aSmrg@no_appsdir@	-@ECHO_CC@$(SHELL) -c 'for s in $(APP_NAMES); \
50020d2c4d2Smrg@no_appsdir@	do \
50120d2c4d2Smrg@no_appsdir@		echo "** $$s"; \
50220d2c4d2Smrg@no_appsdir@		d=`echo $$s | sed -e s/XTerm/$(CLASS)/`; \
50320d2c4d2Smrg@no_appsdir@		echo uninstalling $(APPSDIR)/$$d; \
50420d2c4d2Smrg@no_appsdir@		$(RM) $(APPSDIR)/$$d; \
50520d2c4d2Smrg@no_appsdir@		echo uninstalling $(APPSDIR)/$$d-color; \
50620d2c4d2Smrg@no_appsdir@		$(RM) $(APPSDIR)/$$d-color; \
50720d2c4d2Smrg@no_appsdir@	done'
508d522f475Smrg
509d522f475Smrg@no_icondir@uninstall \
510d522f475Smrg@no_icondir@uninstall-icon \
511d522f475Smrg@no_icondir@uninstall-full ::
512f2e35a3aSmrg@no_icondir@	-@ECHO_CC@$(SHELL) -c 'ACTUAL_XTERM=$(actual_xterm) ; \
513f2e35a3aSmrg@no_icondir@		for n in $(ICON_LIST); \
5140bd37d32Smrg@no_icondir@		do \
515f2e35a3aSmrg@no_icondir@		r=`echo "$$n" | sed -e s,\^.\*:,, -e s,xterm,$$ACTUAL_XTERM,`; \
5160bd37d32Smrg@no_icondir@		test -z "$$r" && continue; \
5170bd37d32Smrg@no_icondir@		h=$(ICONDIR)/$(ICON_THEME); \
518f2e35a3aSmrg@no_icondir@		test -f $$h/$$r || continue; \
5190bd37d32Smrg@no_icondir@		echo removing $$h/$$r; \
5200bd37d32Smrg@no_icondir@		$(RM) $$h/$$r; \
5210bd37d32Smrg@no_icondir@		done'
5220bd37d32Smrg@no_icondir@	@echo "... removed icons"
5230bd37d32Smrg
5240bd37d32Smrg@no_pixmapdir@uninstall \
5250bd37d32Smrg@no_pixmapdir@uninstall-icon \
5260bd37d32Smrg@no_pixmapdir@uninstall-full ::
527f2e35a3aSmrg@no_pixmapdir@	-@$(SHELL) -c 'ACTUAL_XTERM=$(actual_xterm) ; \
528f2e35a3aSmrg@no_pixmapdir@		for n in $(srcdir)/icons/*xterm*_32x32.xpm $(srcdir)/icons/*xterm*_48x48.xpm; \
5290bd37d32Smrg@no_pixmapdir@		do \
5300bd37d32Smrg@no_pixmapdir@			l=`basename $$n`; \
5310bd37d32Smrg@no_pixmapdir@			r=`echo "$$l" | sed -e "s,xterm,$$ACTUAL_XTERM,"`; \
5320bd37d32Smrg@no_pixmapdir@			echo removing $(PIXMAPDIR)/$$r; \
5330bd37d32Smrg@no_pixmapdir@			$(RM) $(PIXMAPDIR)/$$r; \
5340bd37d32Smrg@no_pixmapdir@		done'
5350bd37d32Smrg@no_pixmapdir@	@echo "... removed icons"
536d522f475Smrg################################################################################
537d522f475Smrg# Desktop-utils does not provide an uninstall, and is not uniformly available.
5380bd37d32Smrg@desktop_utils@DESKTOP_FILES = $(srcdir)/xterm.desktop $(srcdir)/uxterm.desktop
539d522f475Smrg@desktop_utils@DESKTOP_FLAGS = @DESKTOP_FLAGS@
540d522f475Smrg@desktop_utils@install-desktop \
541d522f475Smrg@desktop_utils@install-full ::
5420bd37d32Smrg@desktop_utils@	ACTUAL_XTERM=$(actual_xterm) \
5430bd37d32Smrg@desktop_utils@	$(SHELL) -c 'for n in $(DESKTOP_FILES); \
544f2e35a3aSmrg@desktop_utils@		do $(SHELL) df-install $$ACTUAL_XTERM $(ICON_NAME) DESTDIR="$(DESTDIR)" $(DESKTOP_FLAGS) $$n; \
5450bd37d32Smrg@desktop_utils@		done'
546d522f475Smrg################################################################################
547f2e35a3aSmrgcheck : $(TEST_PROGRAMS)
548f2e35a3aSmrg	@ echo "See demos in vttests/* (use vttest for system-level testing)"
549f2e35a3aSmrg	@ $(SHELL) -c 'echo "** executing test_charclass"; \
550f2e35a3aSmrg		./test_charclass'
551f2e35a3aSmrg	@ $(SHELL) -c 'echo "** executing test_wcwidth"; \
552f2e35a3aSmrg		for range in 32-126 160-0xff00 0x10000-0x11000; \
553f2e35a3aSmrg		do echo ".. range $$range"; \
554f2e35a3aSmrg		./test_wcwidth -s $$range; \
555f2e35a3aSmrg		./test_wcwidth -s $$range -w; \
556f2e35a3aSmrg	done'
557f2e35a3aSmrg	@ $(SHELL) -c 'echo "** executing test_ptydata"; \
558f2e35a3aSmrg		./test_ptydata -a'
559f2e35a3aSmrg################################################################################
560d522f475Smrgmostlyclean :
561f2e35a3aSmrg	-$(RM) *$o *.[is] XTerm[1-9]*.* Xterm.log.* XtermLog.* .pure core *~ *.bak *.BAK *.out *.tmp
562d522f475Smrg
563d522f475Smrgclean : mostlyclean
564f2e35a3aSmrg	-$(RM) $(PROGRAMS) $(TEST_PROGRAMS) $(AUTO_SOURCE)
565f2e35a3aSmrg
566f2e35a3aSmrgsources : $(AUTO_SOURCE)
567d522f475Smrg
5686879286fSmrgdistclean :: clean
569d522f475Smrg	-$(RM) Makefile config.status config.cache config.log xtermcfg.h
5705307cd1aSmrg	-$(RM) df-install minstall run-tic.sh
5716879286fSmrg
5726879286fSmrgdistclean \
5736879286fSmrgdocs-clean ::
574d522f475Smrg	-$(RM) *.ps *.pdf *.png
57520d2c4d2Smrg	-$(SHELL) -c 'for p in xterm resize uxterm koi8rxterm; \
57620d2c4d2Smrg	do \
57720d2c4d2Smrg		$(RM) $$p.html $$p.$(manext) $$p.txt; \
57820d2c4d2Smrg	done'
579d522f475Smrg	-$(RM) ctlseqs.html ctlseqs.$(manext)
580d522f475Smrg
58101037d57Smrgdistclean ::
58201037d57Smrg	-$(RM) man2html.tmp
58301037d57Smrg
584d522f475Smrgrealclean : distclean
585d522f475Smrg	-$(RM) tags TAGS
586d522f475Smrg
587d522f475Smrgmaintainer-clean : realclean
588d522f475Smrg	-$(RM) 256colres.h 88colres.h
589d522f475Smrg################################################################################
590f2e35a3aSmrgTIC=tic
591f2e35a3aSmrgterminfo.out : terminfo		; $(TIC) -a -I -1 terminfo >$@
592f2e35a3aSmrgtermcap.out : termcap		; $(TIC) -a -C -U termcap >$@
593d522f475Smrg################################################################################
594a1f3da82Smrgdocs-ctlseqs \
59501037d57Smrgdocs :: $(srcdir)/ctlseqs.txt @MAN2HTML_NOTE@ ctlseqs.html @GROFF_NOTE@ ctlseqs.pdf ctlseqs.ps
5960bd37d32Smrg
5970bd37d32Smrgctlseqs.html : $(srcdir)/ctlseqs.ms
598d522f475Smrgctlseqs.pdf : ctlseqs.ps
5990bd37d32Smrgctlseqs.ps : $(srcdir)/ctlseqs.ms
6000bd37d32Smrgctlseqs.txt : $(srcdir)/ctlseqs.ms
601d522f475Smrg################################################################################
602a1f3da82Smrgdocs-resize \
60301037d57Smrgdocs ::  resize.txt @MAN2HTML_NOTE@ resize.html @GROFF_NOTE@ resize.pdf resize.ps
60420d2c4d2Smrgresize.html : resize.$(manext)
60520d2c4d2Smrgresize.pdf : resize.ps
60620d2c4d2Smrgresize.ps : resize.$(manext)
60720d2c4d2Smrgresize.txt : resize.$(manext)
60820d2c4d2Smrg################################################################################
609a1f3da82Smrgdocs-xterm \
61001037d57Smrgdocs ::  xterm.txt @MAN2HTML_NOTE@ xterm.html @GROFF_NOTE@ xterm.pdf xterm.ps
611d522f475Smrgxterm.html : xterm.$(manext)
612d522f475Smrgxterm.pdf : xterm.ps
613d522f475Smrgxterm.ps : xterm.$(manext)
614d522f475Smrgxterm.txt : xterm.$(manext)
615d522f475Smrg################################################################################
616a1f3da82Smrgdocs-uxterm \
61701037d57Smrgdocs ::  uxterm.txt @MAN2HTML_NOTE@ uxterm.html @GROFF_NOTE@ uxterm.pdf uxterm.ps
61820d2c4d2Smrguxterm.html : uxterm.$(manext)
61920d2c4d2Smrguxterm.pdf : uxterm.ps
62020d2c4d2Smrguxterm.ps : uxterm.$(manext)
62120d2c4d2Smrguxterm.txt : uxterm.$(manext)
62220d2c4d2Smrg################################################################################
623a1f3da82Smrgdocs-koi8rxterm \
62401037d57Smrgdocs ::  koi8rxterm.txt @MAN2HTML_NOTE@ koi8rxterm.html @GROFF_NOTE@ koi8rxterm.pdf koi8rxterm.ps
62520d2c4d2Smrgkoi8rxterm.html : koi8rxterm.$(manext)
62620d2c4d2Smrgkoi8rxterm.pdf : koi8rxterm.ps
62720d2c4d2Smrgkoi8rxterm.ps : koi8rxterm.$(manext)
62820d2c4d2Smrgkoi8rxterm.txt : koi8rxterm.$(manext)
62920d2c4d2Smrg################################################################################
630d522f475Smrglint :
6312e4f8982Smrg	$(LINT) $(LINT_OPTS) $(CPPFLAGS) $(SRCS1)
6322e4f8982Smrg	$(LINT) $(LINT_OPTS) $(CPPFLAGS) $(SRCS2)
633d522f475Smrg
634d522f475Smrgtags :
63520d2c4d2Smrg	$(CTAGS) $(SRCS) $(HDRS)
636d522f475Smrg
637d522f475SmrgTAGS :
63820d2c4d2Smrg	$(ETAGS) $(SRCS) $(HDRS)
639d522f475Smrg
640d522f475Smrg$(TERMINFO_DIR) $(INSTALL_DIRS) :
64120d2c4d2Smrg	mkdir -p $@
642d522f475Smrg
643d522f475SmrgALWAYS :
644d522f475Smrg
645d522f475Smrgdepend : $(TABLES)
646d522f475Smrg	makedepend -- $(CPPFLAGS) -- $(SRCS)
647d522f475Smrg
648d522f475Smrg# DO NOT DELETE THIS LINE -- make depend depends on it.
649