1 ## $XTermId: Makefile.in,v 1.174 2010/11/24 11:21:01 tom Exp $
2 # -----------------------------------------------------------------------------
3 # this file is part of xterm
5 # Copyright 1997-2009,2010 by Thomas E. Dickey
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:
17 # The above copyright notice and this permission notice shall be included
18 # in all copies or substantial portions of the Software.
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.
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
32 # -----------------------------------------------------------------------------
36 #### Start of system configuration section. ####
47 LINK = $(CC) $(CFLAGS)
57 INSTALL_PROGRAM = @INSTALL_PROGRAM@
58 INSTALL_SCRIPT = @INSTALL_SCRIPT@
59 INSTALL_DATA = @INSTALL_DATA@
60 transform = @program_transform_name@
62 EXTRA_CFLAGS = @EXTRA_CFLAGS@
63 EXTRA_CPPFLAGS = @EXTRA_CPPFLAGS@
64 EXTRA_LOADFLAGS = @IMAKE_LOADFLAGS@
66 CPPFLAGS = -I. -I$(srcdir) -DHAVE_CONFIG_H @CPPFLAGS@ $(EXTRA_CPPFLAGS)
67 CFLAGS = @CFLAGS@ $(EXTRA_CFLAGS)
72 exec_prefix = @exec_prefix@
77 mandir = @mandir@/man$(manext)
81 #### End of system configuration section. ####
84 BINDIR = $(DESTDIR)$(bindir)
85 LIBDIR = $(DESTDIR)$(libdir)
86 MANDIR = $(DESTDIR)$(mandir)
87 APPSDIR = $(DESTDIR)$(appsdir)
88 ICONDIR = $(DESTDIR)$(icondir)
90 INSTALL_DIRS = $(BINDIR) $(APPSDIR) $(ICONDIR) $(MANDIR)
93 EXTRAHDR = @EXTRAHDRS@
94 EXTRASRC = @EXTRASRCS@
95 EXTRAOBJ = @EXTRAOBJS@
97 SRCS1 = button.c cachedGCs.c charproc.c charsets.c cursor.c \
98 data.c doublechr.c fontutils.c input.c \
99 linedata.c main.c menu.c misc.c \
100 print.c ptydata.c scrollback.c \
101 screen.c scrollbar.c tabs.c util.c xstrings.c xtermcap.c \
102 VTPrsTbl.c $(EXTRASRC)
103 OBJS1 = button$o cachedGCs$o charproc$o charsets$o cursor$o \
104 data$o doublechr$o fontutils$o input$o \
105 linedata$o main$o menu$o misc$o \
106 print$o ptydata$o scrollback$o \
107 screen$o scrollbar$o tabs$o util$o xstrings$o xtermcap$o \
108 VTPrsTbl$o $(EXTRAOBJ)
109 SRCS2 = resize.c xstrings.c
110 OBJS2 = resize$o xstrings$o
111 SRCS = $(SRCS1) $(SRCS2)
112 OBJS = $(OBJS1) $(OBJS2)
113 HDRS = VTparse.h data.h error.h main.h menu.h proto.h \
114 ptyx.h version.h xstrings.h xterm.h xtermcap.h $(EXTRAHDR)
115 PROGRAMS = xterm$x resize$x
118 ################################################################################
119 .SUFFIXES : .i .def .hin .html .$(manext) .ms .man .ps .pdf .txt
123 @ECHO_CC@$(CC) $(CPPFLAGS) $(CFLAGS) -c $(srcdir)/$*.c
127 @ECHO_CC@$(CPP) -C $(CPPFLAGS) $*.c >$@
130 grep '^CASE_' $< | $(AWK) '{printf "#define %s %d\n", $$1, n++}' >$@
133 $(SHELL) $(srcdir)/minstall.sh "$(INSTALL_DATA)" $< $@ $(appsdir)
136 GROFF_NO_SGR=stupid $(SHELL) -c "tbl $*.$(manext) | groff -Thtml -man" >$@
139 $(SHELL) -c "tbl $*.$(manext) | groff -man" >$@
142 GROFF_NO_SGR=stupid $(SHELL) -c "tbl $*.$(manext) | nroff -Tascii -man | col -bx" >$@
145 GROFF_NO_SGR=stupid $(SHELL) -c "tbl $*.ms | groff -Thtml -ms" >$@
148 $(SHELL) -c "tbl $*.ms | groff -ms" >$@
151 GROFF_NO_SGR=stupid $(SHELL) -c "tbl $*.ms | nroff -Tascii -ms | col -bx" >$@
155 ################################################################################
159 $(OBJS1) : xterm.h ptyx.h xtermcfg.h
160 main$o resize$o screen$o : xterm_io.h
163 @ECHO_LD@$(SHELL) $(srcdir)/plink.sh $(LINK) $(LDFLAGS) -o $@ $(OBJS1) $(LIBS) $(EXTRA_LOADFLAGS)
166 @ECHO_LD@$(SHELL) $(srcdir)/plink.sh $(LINK) $(LDFLAGS) -o $@ $(OBJS2) $(LIBS)
170 perl $(srcdir)/256colres.pl > $@
174 perl $(srcdir)/88colres.pl > $@
176 charproc$o : main.h @CHARPROC_DEPS@
177 ################################################################################
178 actual_xterm = `echo xterm| sed '$(transform)'`
179 actual_resize = `echo resize| sed '$(transform)'`
180 actual_uxterm = `echo uxterm| sed '$(transform)'`
181 actual_k8term = `echo koi8rxterm| sed '$(transform)'`
183 binary_xterm = $(actual_xterm)$x
184 binary_resize = $(actual_resize)$x
185 binary_uxterm = $(actual_uxterm)
186 binary_k8term = $(actual_k8term)
190 install-full :: xterm$x resize$x $(BINDIR)
191 @MAY_SETUID@ $(SHELL) $(srcdir)/sinstall.sh @SINSTALL_OPTS@ "$(INSTALL_PROGRAM)" xterm$x @XTERM_PATH@ $(BINDIR)/$(binary_xterm)
192 @NOT_SETUID@ $(INSTALL_PROGRAM) xterm$x $(BINDIR)/$(binary_xterm)
193 $(INSTALL_PROGRAM) -m 755 resize$x $(BINDIR)/$(binary_resize)
199 @$(SHELL) -c "name=\"$(binary_xterm)\"; \
200 dest=\"$(binary_uxterm)\"; \
201 echo \"... installing $(BINDIR)/\$$dest\"; \
202 if test \"\$$name\" != \"xterm\"; then \
203 sed -e \"s,=xterm,=\$$name,\" $(srcdir)/uxterm >uxterm.tmp; \
204 $(INSTALL_SCRIPT) -m 755 uxterm.tmp $(BINDIR)/\$$dest; \
207 $(INSTALL_SCRIPT) -m 755 $(srcdir)/uxterm $(BINDIR)/\$$dest; \
209 @$(SHELL) -c "name=\"$(binary_xterm)\"; \
210 dest=\"$(binary_k8term)\"; \
211 echo \"... installing $(BINDIR)/\$$dest\"; \
212 if test \"\$$name\" != \"xterm\"; then \
213 sed -e \"s,=xterm,=\$$name,\" $(srcdir)/koi8rxterm >k8term.tmp; \
214 $(INSTALL_SCRIPT) -m 755 k8term.tmp $(BINDIR)/\$$dest; \
217 $(INSTALL_SCRIPT) -m 755 $(srcdir)/koi8rxterm $(BINDIR)/\$$dest; \
219 @-$(SHELL) -c "name=\"$(binary_xterm)\"; \
220 if test @XTERM_SYMLINK@ != NONE ; then \
222 rm -f @XTERM_SYMLINK@ ; \
223 $(LN_S) \$$name @XTERM_SYMLINK@ ; \
224 echo \"... created symbolic link:\" ; \
225 ls -l \$$name @XTERM_SYMLINK@ ) ; \
230 install-full :: $(MANDIR)
231 $(SHELL) $(srcdir)/minstall.sh "$(INSTALL_DATA)" $(srcdir)/xterm.man $(MANDIR)/$(actual_xterm).$(manext) $(appsdir)
232 $(SHELL) $(srcdir)/minstall.sh "$(INSTALL_DATA)" $(srcdir)/resize.man $(MANDIR)/$(actual_resize).$(manext) $(appsdir)
233 $(SHELL) $(srcdir)/minstall.sh "$(INSTALL_DATA)" $(srcdir)/uxterm.man $(MANDIR)/$(actual_uxterm).$(manext) $(appsdir)
234 $(SHELL) $(srcdir)/minstall.sh "$(INSTALL_DATA)" $(srcdir)/koi8rxterm.man $(MANDIR)/$(actual_k8term).$(manext) $(appsdir)
235 @-$(SHELL) -c "if test @XTERM_SYMLINK@ != NONE ; then cd $(MANDIR) && rm -f @XTERM_SYMLINK@.$(manext) ; fi"
236 @-$(SHELL) -c "if test @XTERM_SYMLINK@ != NONE ; then cd $(MANDIR) && $(LN_S) $(actual_xterm).$(manext) @XTERM_SYMLINK@.$(manext) ; fi"
237 @-$(SHELL) -c "if test @XTERM_SYMLINK@ != NONE ; then cd $(MANDIR) && echo '... created symbolic link:' && ls -l $(actual_xterm).$(manext) @XTERM_SYMLINK@.$(manext) ; fi"
239 APP_NAMES = XTerm UXTerm KOI8RXTerm
241 @no_appsdir@install \
242 @no_appsdir@install-app \
243 @no_appsdir@install-full :: $(APPSDIR)
244 @no_appsdir@ @-$(SHELL) -c 'for s in $(APP_NAMES); \
246 @no_appsdir@ echo "** $$s"; \
247 @no_appsdir@ d=`echo $$s | sed -e s/XTerm/$(CLASS)/`; \
248 @no_appsdir@ echo installing $(APPSDIR)/$$d; \
249 @no_appsdir@ sed -e s/XTerm/$(CLASS)/ $(srcdir)/$$s.ad >XTerm.tmp; \
250 @no_appsdir@ $(INSTALL_DATA) XTerm.tmp $(APPSDIR)/$$d; \
251 @no_appsdir@ echo installing $(APPSDIR)/$$d-color; \
252 @no_appsdir@ sed -e s/XTerm/$$d/ $(srcdir)/XTerm-col.ad >XTerm.tmp; \
253 @no_appsdir@ $(INSTALL_DATA) XTerm.tmp $(APPSDIR)/$$d-color; \
255 @no_appsdir@ @rm -f XTerm.tmp
256 @no_icondir@ @echo "... installed app-defaults"
258 @no_icondir@install \
259 @no_icondir@install-icon \
260 @no_icondir@install-full :: $(ICONDIR)
261 @no_icondir@ @$(INSTALL_DATA) $(srcdir)/icons/xterm-color_32x32.xpm $(ICONDIR)
262 @no_icondir@ @$(INSTALL_DATA) $(srcdir)/icons/xterm-color_48x48.xpm $(ICONDIR)
263 @no_icondir@ @$(INSTALL_DATA) $(srcdir)/icons/xterm_32x32.xpm $(ICONDIR)
264 @no_icondir@ @$(INSTALL_DATA) $(srcdir)/icons/xterm_48x48.xpm $(ICONDIR)
265 @no_icondir@ @echo "... installed icons"
268 @echo 'Completed installation of executables and documentation.'
269 @echo 'Use "make install-ti" to install terminfo description.'
271 TERMINFO_DIR = @TERMINFO_DIR@
272 SET_TERMINFO = @SET_TERMINFO@
274 @no_ticprog@install-full \
275 @no_ticprog@install-ti :: $(TERMINFO_DIR)
276 @no_ticprog@ @$(SHELL) -c "$(SET_TERMINFO) $(srcdir)/run-tic.sh $(srcdir)/terminfo"
277 @no_ticprog@ @echo 'Completed installation of terminfo description.'
281 @-$(SHELL) -c "test -f /etc/termcap && echo 'You must install the termcap entry manually by editing /etc/termcap'"
283 installdirs : $(INSTALL_DIRS)
284 ################################################################################
288 -$(RM) $(BINDIR)/$(binary_xterm)
289 -$(RM) $(BINDIR)/$(binary_resize)
290 @-$(SHELL) -c "if test @XTERM_SYMLINK@ != NONE ; then cd $(BINDIR) && rm -f @XTERM_SYMLINK@; fi"
296 -$(RM) $(BINDIR)/$(binary_uxterm)
297 -$(RM) $(BINDIR)/$(binary_k8term)
302 -$(RM) $(MANDIR)/$(actual_xterm).$(manext)
303 -$(RM) $(MANDIR)/$(actual_resize).$(manext)
304 -$(RM) $(MANDIR)/$(actual_uxterm).$(manext)
305 -$(RM) $(MANDIR)/$(actual_k8term).$(manext)
306 @-$(SHELL) -c "if test @XTERM_SYMLINK@ != NONE ; then cd $(MANDIR) && rm -f @XTERM_SYMLINK@.$(manext); fi"
308 @no_appsdir@uninstall \
309 @no_appsdir@uninstall-app \
310 @no_appsdir@uninstall-full ::
311 @no_appsdir@ @-$(SHELL) -c 'for s in $(APP_NAMES); \
313 @no_appsdir@ echo "** $$s"; \
314 @no_appsdir@ d=`echo $$s | sed -e s/XTerm/$(CLASS)/`; \
315 @no_appsdir@ echo uninstalling $(APPSDIR)/$$d; \
316 @no_appsdir@ $(RM) $(APPSDIR)/$$d; \
317 @no_appsdir@ echo uninstalling $(APPSDIR)/$$d-color; \
318 @no_appsdir@ $(RM) $(APPSDIR)/$$d-color; \
321 @no_icondir@uninstall \
322 @no_icondir@uninstall-icon \
323 @no_icondir@uninstall-full ::
324 @no_icondir@ -$(RM) $(ICONDIR)/xterm-color_32x32.xpm
325 @no_icondir@ -$(RM) $(ICONDIR)/xterm_32x32.xpm
326 @no_icondir@ -$(RM) $(ICONDIR)/xterm-color_48x48.xpm
327 @no_icondir@ -$(RM) $(ICONDIR)/xterm_48x48.xpm
328 ################################################################################
329 # Desktop-utils does not provide an uninstall, and is not uniformly available.
330 @desktop_utils@DESKTOP_FLAGS = @DESKTOP_FLAGS@
331 @desktop_utils@install-desktop \
332 @desktop_utils@install-full ::
333 @desktop_utils@ desktop-file-install $(DESKTOP_FLAGS) xterm.desktop
334 @desktop_utils@ desktop-file-install $(DESKTOP_FLAGS) uxterm.desktop
335 ################################################################################
337 -$(RM) *$o *.[is] XtermLog.* .pure core *~ *.bak *.BAK *.out *.tmp
343 -$(RM) Makefile config.status config.cache config.log xtermcfg.h
347 -$(RM) *.ps *.pdf *.png
348 -$(SHELL) -c 'for p in xterm resize uxterm koi8rxterm; \
350 $(RM) $$p.html $$p.$(manext) $$p.txt; \
352 -$(RM) ctlseqs.html ctlseqs.$(manext)
354 realclean : distclean
357 maintainer-clean : realclean
358 -$(RM) 256colres.h 88colres.h
359 ################################################################################
360 terminfo.out : terminfo ; tic -a -I -1 terminfo >$@
361 termcap.out : termcap ; tic -a -C -U termcap >$@
362 ################################################################################
364 docs :: ctlseqs.html \
368 ctlseqs.html : ctlseqs.ms
369 ctlseqs.pdf : ctlseqs.ps
370 ctlseqs.ps : ctlseqs.ms
371 ctlseqs.txt : ctlseqs.ms
372 ################################################################################
374 docs :: resize.html \
378 resize.html : resize.$(manext)
379 resize.pdf : resize.ps
380 resize.ps : resize.$(manext)
381 resize.txt : resize.$(manext)
382 ################################################################################
388 xterm.html : xterm.$(manext)
390 xterm.ps : xterm.$(manext)
391 xterm.txt : xterm.$(manext)
392 ################################################################################
394 docs :: uxterm.html \
398 uxterm.html : uxterm.$(manext)
399 uxterm.pdf : uxterm.ps
400 uxterm.ps : uxterm.$(manext)
401 uxterm.txt : uxterm.$(manext)
402 ################################################################################
404 docs :: koi8rxterm.html \
408 koi8rxterm.html : koi8rxterm.$(manext)
409 koi8rxterm.pdf : koi8rxterm.ps
410 koi8rxterm.ps : koi8rxterm.$(manext)
411 koi8rxterm.txt : koi8rxterm.$(manext)
412 ################################################################################
414 $(LINT) $(CPPFLAGS) $(SRCS1)
415 $(LINT) $(CPPFLAGS) $(SRCS2)
418 $(CTAGS) $(SRCS) $(HDRS)
421 $(ETAGS) $(SRCS) $(HDRS)
423 $(TERMINFO_DIR) $(INSTALL_DIRS) :
429 makedepend -- $(CPPFLAGS) -- $(SRCS)
431 # DO NOT DELETE THIS LINE -- make depend depends on it.