xref: /freebsd/contrib/ncurses/progs/Makefile.in (revision 39beb93c3f8bdbf72a61fda42300b5ebed7390c8)
1# $Id: Makefile.in,v 1.79 2008/09/07 13:58:55 tom Exp $
2##############################################################################
3# Copyright (c) 1998-2006,2007 Free Software Foundation, Inc.                #
4#                                                                            #
5# Permission is hereby granted, free of charge, to any person obtaining a    #
6# copy of this software and associated documentation files (the "Software"), #
7# to deal in the Software without restriction, including without limitation  #
8# the rights to use, copy, modify, merge, publish, distribute, distribute    #
9# with modifications, sublicense, and/or sell copies of the Software, and to #
10# permit persons to whom the Software is furnished to do so, subject to the  #
11# following conditions:                                                      #
12#                                                                            #
13# The above copyright notice and this permission notice shall be included in #
14# all copies or substantial portions of the Software.                        #
15#                                                                            #
16# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
17# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,   #
18# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL    #
19# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER      #
20# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING    #
21# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER        #
22# DEALINGS IN THE SOFTWARE.                                                  #
23#                                                                            #
24# Except as contained in this notice, the name(s) of the above copyright     #
25# holders shall not be used in advertising or otherwise to promote the sale, #
26# use or other dealings in this Software without prior written               #
27# authorization.                                                             #
28##############################################################################
29#
30# Author: Thomas E. Dickey 1996-on
31#
32# Makefile for ncurses source code.
33#
34# This makes the ncurses utility programs.
35#
36# The variable 'srcdir' refers to the source-distribution, and can be set with
37# the configure script by "--srcdir=DIR".
38#
39# The rules are organized to produce the libraries for the configured models,
40# and the programs with the configured default model.
41
42# turn off _all_ suffix rules; we'll generate our own
43.SUFFIXES:
44
45SHELL		= /bin/sh
46THIS		= Makefile
47
48CF_MFLAGS 	= @cf_cv_makeflags@
49@SET_MAKE@
50
51x		= @EXEEXT@
52o		= .@OBJEXT@
53
54MODEL		= ../@DFT_OBJ_SUBDIR@
55DESTDIR		= @DESTDIR@
56top_srcdir	= @top_srcdir@
57srcdir		= @srcdir@
58prefix		= @prefix@
59exec_prefix	= @exec_prefix@
60bindir		= @bindir@
61libdir		= @libdir@
62includedir	= @includedir@
63datadir		= @datadir@
64
65LIBTOOL		= @LIBTOOL@
66LIBTOOL_CLEAN	= @LIB_CLEAN@
67LIBTOOL_COMPILE	= @LIB_COMPILE@
68LIBTOOL_LINK	= @LIB_LINK@
69LIBTOOL_INSTALL	= @LIB_INSTALL@
70LIBTOOL_UNINSTALL = @LIB_UNINSTALL@
71
72INSTALL		= @INSTALL@
73INSTALL_PROG	= @INSTALL_PROGRAM@
74transform	= @program_transform_name@
75
76AWK		= @AWK@
77LN_S		= @LN_S@
78
79CC		= @CC@
80CPP		= @CPP@
81CFLAGS		= @CFLAGS@
82
83INCDIR		= $(top_srcdir)/include
84CPPFLAGS	= -I../progs -I$(srcdir) -DHAVE_CONFIG_H @CPPFLAGS@
85
86CCFLAGS		= $(CPPFLAGS) $(CFLAGS)
87
88CFLAGS_LIBTOOL	= $(CCFLAGS)
89CFLAGS_NORMAL	= $(CCFLAGS)
90CFLAGS_DEBUG	= $(CCFLAGS) @CC_G_OPT@ -DTRACE
91CFLAGS_PROFILE	= $(CCFLAGS) -pg
92CFLAGS_SHARED	= $(CCFLAGS) @CC_SHARED_OPTS@
93
94CFLAGS_DEFAULT	= $(CFLAGS_@DFT_UPR_MODEL@)
95
96REL_VERSION	= @cf_cv_rel_version@
97ABI_VERSION	= @cf_cv_abi_version@
98LOCAL_LIBDIR	= @top_builddir@/lib
99
100LD		= @LD@
101LINK		= @LINK_PROGS@ $(LIBTOOL_LINK)
102LDFLAGS		= @EXTRA_LDFLAGS@ @LDFLAGS@
103
104LDFLAGS_LIBTOOL	= $(LDFLAGS) $(CFLAGS_LIBTOOL)
105LDFLAGS_NORMAL	= $(LDFLAGS) $(CFLAGS_NORMAL)
106LDFLAGS_DEBUG	= $(LDFLAGS) $(CFLAGS_DEBUG)
107LDFLAGS_PROFILE	= $(LDFLAGS) $(CFLAGS_PROFILE)
108LDFLAGS_SHARED	= $(LDFLAGS) $(CFLAGS_SHARED) @LD_SHARED_OPTS@
109
110LDFLAGS_DEFAULT	= $(LDFLAGS_@DFT_UPR_MODEL@)
111
112LIBS_TIC	= @LDFLAGS_STATIC@ @TICS_ARGS@ @TINFO_ARGS@ @LDFLAGS_SHARED@ @LD_MODEL@ @LIBS@
113LDFLAGS_TIC	= $(LDFLAGS_@DFT_UPR_MODEL@) $(LIBS_TIC)
114
115LIBS_TINFO	= @LDFLAGS_STATIC@ @TINFO_ARGS@ @LDFLAGS_SHARED@ @LD_MODEL@ @LIBS@
116LDFLAGS_TINFO	= $(LDFLAGS_@DFT_UPR_MODEL@) $(LIBS_TINFO)
117
118LINT		= @LINT@
119LINT_OPTS	= @LINT_OPTS@
120LINT_LIBS	= -lncurses @LIBS@
121
122AUTO_SRC = \
123	termsort.c \
124	transform.h
125
126# tic relies on direct access to the terminfo database
127GET_PROGS = infocmp$x clear$x tput$x tset$x toe$x
128PUT_PROGS = @MAKE_TERMINFO@ tic$x
129PROGS = $(PUT_PROGS) $(GET_PROGS)
130
131# Default library, for linking applications
132DEPS_CURSES = ../lib/@LIB_PREFIX@ncurses@DFT_DEP_SUFFIX@
133
134HEADER_DEPS	= \
135	../include/curses.h \
136	$(INCDIR)/term_entry.h \
137	$(INCDIR)/tic.h \
138	$(INCDIR)/nc_alloc.h
139
140################################################################################
141all:		$(AUTO_SRC) $(PROGS)
142
143sources:	$(AUTO_SRC)
144
145install: 	$(AUTO_SRC) install.progs
146uninstall: uninstall.progs
147
148# this line simplifies the configure-script
149libs \
150install.libs \
151uninstall.libs:
152
153TRANSFORM = sed 's/$x$$//'|sed '$(transform)'|sed 's/$$/$x/'
154
155# transformed names for installing files
156actual_captoinfo = `echo captoinfo$x| $(TRANSFORM)`
157actual_clear     = `echo clear$x|     $(TRANSFORM)`
158actual_infocmp   = `echo infocmp$x|   $(TRANSFORM)`
159actual_infotocap = `echo infotocap$x| $(TRANSFORM)`
160actual_init      = `echo init$x|      $(TRANSFORM)`
161actual_reset     = `echo reset$x|     $(TRANSFORM)`
162actual_tic       = `echo tic$x|       $(TRANSFORM)`
163actual_toe       = `echo toe$x|       $(TRANSFORM)`
164actual_tput      = `echo tput$x|      $(TRANSFORM)`
165actual_tset      = `echo tset$x|      $(TRANSFORM)`
166
167# transformed names for comparing at runtime
168define_captoinfo = `echo captoinfo|   $(TRANSFORM)`
169define_infotocap = `echo infotocap|   $(TRANSFORM)`
170define_init      = `echo init|        $(TRANSFORM)`
171define_reset     = `echo reset|       $(TRANSFORM)`
172
173transform.h :
174	echo "#define PROG_CAPTOINFO \"$(define_captoinfo)\"" >$@
175	echo "#define PROG_INFOTOCAP \"$(define_infotocap)\"" >>$@
176	echo "#define PROG_RESET     \"$(define_reset)\""     >>$@
177	echo "#define PROG_INIT      \"$(define_init)\""      >>$@
178
179install.progs: $(AUTO_SRC) $(PROGS) $(DESTDIR)$(bindir)
180@MAKE_TERMINFO@	$(LIBTOOL_INSTALL) $(INSTALL_PROG) tic$x     $(DESTDIR)$(bindir)/$(actual_tic)
181@MAKE_TERMINFO@	$(LIBTOOL_INSTALL) $(INSTALL_PROG) toe$x     $(DESTDIR)$(bindir)/$(actual_toe)
182@MAKE_TERMINFO@	@echo "linking $(actual_infotocap) to $(actual_tic)"
183@MAKE_TERMINFO@	-@rm -f $(DESTDIR)$(bindir)/$(actual_infotocap)
184@MAKE_TERMINFO@	(cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tic) $(actual_infotocap))
185@MAKE_TERMINFO@	@echo "linking $(actual_captoinfo) to $(actual_tic)"
186@MAKE_TERMINFO@	-@rm -f $(DESTDIR)$(bindir)/$(actual_captoinfo)
187@MAKE_TERMINFO@	(cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tic) $(actual_captoinfo))
188	$(LIBTOOL_INSTALL) $(INSTALL_PROG) infocmp$x $(DESTDIR)$(bindir)/$(actual_infocmp)
189	$(LIBTOOL_INSTALL) $(INSTALL_PROG) clear$x   $(DESTDIR)$(bindir)/$(actual_clear)
190	$(LIBTOOL_INSTALL) $(INSTALL_PROG) tput$x    $(DESTDIR)$(bindir)/$(actual_tput)
191	$(LIBTOOL_INSTALL) $(INSTALL_PROG) tset$x    $(DESTDIR)$(bindir)/$(actual_tset)
192	@echo "linking $(actual_reset) to $(actual_tset)"
193	-@rm -f $(DESTDIR)$(bindir)/$(actual_reset)
194	(cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tset) $(actual_reset))
195
196uninstall.progs:
197@MAKE_TERMINFO@	-@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_tic)
198@MAKE_TERMINFO@	-@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_toe)
199@MAKE_TERMINFO@	-@rm -f $(DESTDIR)$(bindir)/$(actual_captoinfo)
200@MAKE_TERMINFO@	-@rm -f $(DESTDIR)$(bindir)/$(actual_infotocap)
201	-@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_infocmp)
202	-@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_clear)
203	-@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_tput)
204	-@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_tset)
205	-@rm -f $(DESTDIR)$(bindir)/$(actual_reset)
206
207$(DESTDIR)$(bindir) :
208	sh $(srcdir)/../mkdirs.sh $@
209
210#
211# Utilities normally built by make all start here
212#
213
214DEPS_TIC = \
215	$(MODEL)/tic$o \
216	$(MODEL)/dump_entry$o
217
218tic$x: $(DEPS_TIC) $(DEPS_CURSES) transform.h
219	@ECHO_LINK@ $(LINK) $(DEPS_TIC) $(LDFLAGS_TIC) -o $@
220
221DEPS_TOE = \
222	$(MODEL)/toe$o
223
224toe$x: $(DEPS_TOE) $(DEPS_CURSES)
225	@ECHO_LINK@ $(LINK) $(DEPS_TOE) $(LDFLAGS_TIC) -o $@
226
227DEPS_CLEAR = \
228	$(MODEL)/clear$o
229
230clear$x: $(DEPS_CLEAR) $(DEPS_CURSES)
231	@ECHO_LINK@ $(LINK) $(DEPS_CLEAR) $(LDFLAGS_TINFO) -o $@
232
233DEPS_TPUT = \
234	$(MODEL)/tput$o
235
236tput$x: $(DEPS_TPUT) $(DEPS_CURSES) transform.h
237	@ECHO_LINK@ $(LINK) $(DEPS_TPUT) $(LDFLAGS_TINFO) -o $@
238
239DEPS_INFOCMP = \
240	$(MODEL)/infocmp$o \
241	$(MODEL)/dump_entry$o
242
243infocmp$x: $(DEPS_INFOCMP) $(DEPS_CURSES)
244	@ECHO_LINK@ $(LINK) $(DEPS_INFOCMP) $(LDFLAGS_TIC) -o $@
245
246DEPS_TSET = \
247	$(MODEL)/tset$o
248
249tset$x: $(DEPS_TSET) $(DEPS_CURSES) transform.h
250	@ECHO_LINK@ $(LINK) $(DEPS_TSET) $(LDFLAGS_TINFO) -o $@
251
252termsort.c: $(srcdir)/MKtermsort.sh
253	sh $(srcdir)/MKtermsort.sh $(AWK) $(srcdir)/../include/@TERMINFO_CAPS@ >$@
254
255#
256# Utility productions start here
257#
258
259tags:
260	ctags *.[ch]
261
262@MAKE_UPPER_TAGS@TAGS:
263@MAKE_UPPER_TAGS@	etags *.[ch]
264
265mostlyclean ::
266	-rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace
267
268clean :: mostlyclean
269	-sh -c "if test -n '$x' ; then $(MAKE) clean x=''; fi"
270	-rm -f $(AUTO_SRC)
271	-rm -f $(PROGS)
272	-rm -rf .libs
273
274distclean :: clean
275	-rm -f Makefile
276
277realclean :: distclean
278
279# These rules are used to allow "make -n" to work on a clean directory-tree
280../include/hashsize.h \
281../include/parametrized.h \
282../include/term.h :
283	cd ../include; $(MAKE) $(CF_MFLAGS)
284$(DEPS_CURSES) :
285	cd ../ncurses; $(MAKE) $(CF_MFLAGS)
286
287lint:
288@MAKE_TERMINFO@	$(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tic.c     $(srcdir)/dump_entry.c $(LINT_LIBS)
289@MAKE_TERMINFO@	$(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/toe.c     $(srcdir)/dump_entry.c $(LINT_LIBS)
290	$(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/clear.c                          $(LINT_LIBS)
291	$(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/infocmp.c $(srcdir)/dump_entry.c $(LINT_LIBS)
292	$(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tput.c                           $(LINT_LIBS)
293	$(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tset.c    $(srcdir)/dump_entry.c $(LINT_LIBS)
294
295###############################################################################
296# The remainder of this file is automatically generated during configuration
297###############################################################################
298