xref: /freebsd/contrib/ncurses/progs/Makefile.in (revision c98323078dede7579020518ec84cdcb478e5c142)
1# $Id: Makefile.in,v 1.56 2001/12/08 18:48:01 tom Exp $
2##############################################################################
3# Copyright (c) 1998,1999,2000,2001 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 <dickey@clark.net> 1996,1997
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@
50x		= @PROG_EXT@
51
52MODEL		= ../@DFT_OBJ_SUBDIR@
53DESTDIR		= @DESTDIR@
54srcdir		= @srcdir@
55prefix		= @prefix@
56exec_prefix	= @exec_prefix@
57bindir		= @bindir@
58libdir		= @libdir@
59includedir	= @includedir@
60datadir		= @datadir@
61
62LIBTOOL		= @LIBTOOL@
63
64INSTALL		= @INSTALL@
65INSTALL_PROGRAM	= @INSTALL_PROGRAM@
66transform	= @program_transform_name@
67
68AWK		= @AWK@
69LN_S		= @LN_S@
70
71CC		= @CC@
72CPP		= @CPP@
73CFLAGS		= @CFLAGS@
74
75INCDIR		= $(srcdir)/../include
76CPPFLAGS	= -I../progs -I$(srcdir) @CPPFLAGS@ \
77		  -DHAVE_CONFIG_H
78
79CCFLAGS		= $(CPPFLAGS) $(CFLAGS)
80
81CFLAGS_LIBTOOL	= $(CCFLAGS)
82CFLAGS_NORMAL	= $(CCFLAGS)
83CFLAGS_DEBUG	= $(CCFLAGS) @CC_G_OPT@ -DTRACE
84CFLAGS_PROFILE	= $(CCFLAGS) -pg
85CFLAGS_SHARED	= $(CCFLAGS) @CC_SHARED_OPTS@
86
87CFLAGS_DEFAULT	= $(CFLAGS_@DFT_UPR_MODEL@)
88
89LD		= @LD@
90LINK		= @LINK_PROGS@ $(LIBTOOL) $(CC)
91LDFLAGS		= @EXTRA_LDFLAGS@ \
92		@PROG_ARGS@ @LDFLAGS@ @LD_MODEL@ @LIBS@ @EXTRA_LIBS@
93
94LDFLAGS_LIBTOOL	= $(LDFLAGS)
95LDFLAGS_NORMAL	= $(LDFLAGS)
96LDFLAGS_DEBUG	= $(LDFLAGS) @CC_G_OPT@
97LDFLAGS_PROFILE	= $(LDFLAGS) -pg
98LDFLAGS_SHARED	= $(LDFLAGS) @LD_SHARED_OPTS@
99
100LDFLAGS_DEFAULT	= $(LDFLAGS_@DFT_UPR_MODEL@)
101
102LINT		= @LINT@
103LINT_OPTS	= @LINT_OPTS@
104LINT_LIBS	= -lncurses @LIBS@
105
106AUTO_SRC = \
107	termsort.c \
108	transform.h
109
110# tic and toe rely on direct access to the terminfo database
111GET_PROGS = infocmp$x clear$x tput$x tset$x
112PUT_PROGS = @MAKE_TERMINFO@ tic$x toe$x
113PROGS = $(PUT_PROGS) $(GET_PROGS)
114
115TESTPROGS = mvcur$x tctest$x hardscroll$x hashmap$x
116
117# Default library, for linking applications
118DEPS_CURSES = ../lib/@LIB_PREFIX@ncurses@DFT_DEP_SUFFIX@
119
120################################################################################
121all:		$(AUTO_SRC) $(PROGS)
122
123sources:	$(AUTO_SRC)
124
125install: 	$(AUTO_SRC) install.progs
126uninstall: uninstall.progs
127
128# this line simplifies the configure-script
129libs \
130install.libs \
131uninstall.libs:
132
133TRANSFORM = sed 's/$x$$//'|sed '$(transform)'|sed 's/$$/$x/'
134
135actual_captoinfo = `echo captoinfo$x| $(TRANSFORM)`
136actual_clear     = `echo clear$x|     $(TRANSFORM)`
137actual_infocmp   = `echo infocmp$x|   $(TRANSFORM)`
138actual_infotocap = `echo infotocap$x| $(TRANSFORM)`
139actual_init      = `echo init$x|      $(TRANSFORM)`
140actual_reset     = `echo reset$x|     $(TRANSFORM)`
141actual_tic       = `echo tic$x|       $(TRANSFORM)`
142actual_toe       = `echo toe$x|       $(TRANSFORM)`
143actual_tput      = `echo tput$x|      $(TRANSFORM)`
144actual_tset      = `echo tset$x|      $(TRANSFORM)`
145
146transform.h :
147	echo "#define PROG_CAPTOINFO \"$(actual_captoinfo)\"" >$@
148	echo "#define PROG_INFOTOCAP \"$(actual_infotocap)\"" >>$@
149	echo "#define PROG_RESET     \"$(actual_reset)\""     >>$@
150	echo "#define PROG_INIT      \"$(actual_init)\""      >>$@
151
152install.progs: $(AUTO_SRC) $(PROGS) $(DESTDIR)$(bindir)
153@MAKE_TERMINFO@	$(LIBTOOL) $(INSTALL_PROGRAM) tic$x     $(DESTDIR)$(bindir)/$(actual_tic)
154@MAKE_TERMINFO@	$(LIBTOOL) $(INSTALL_PROGRAM) toe$x     $(DESTDIR)$(bindir)/$(actual_toe)
155@MAKE_TERMINFO@	@echo "linking $(actual_infotocap) to $(actual_tic)"
156@MAKE_TERMINFO@	-@rm -f $(DESTDIR)$(bindir)/$(actual_infotocap)
157@MAKE_TERMINFO@	(cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tic) $(actual_infotocap))
158@MAKE_TERMINFO@	@echo "linking $(actual_captoinfo) to $(actual_tic)"
159@MAKE_TERMINFO@	-@rm -f $(DESTDIR)$(bindir)/$(actual_captoinfo)
160@MAKE_TERMINFO@	(cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tic) $(actual_captoinfo))
161	$(LIBTOOL) $(INSTALL_PROGRAM) infocmp$x $(DESTDIR)$(bindir)/$(actual_infocmp)
162	$(LIBTOOL) $(INSTALL_PROGRAM) clear$x   $(DESTDIR)$(bindir)/$(actual_clear)
163	$(LIBTOOL) $(INSTALL_PROGRAM) tput$x    $(DESTDIR)$(bindir)/$(actual_tput)
164	$(LIBTOOL) $(INSTALL_PROGRAM) tset$x    $(DESTDIR)$(bindir)/$(actual_tset)
165	@echo "linking $(actual_reset) to $(actual_tset)"
166	-@rm -f $(DESTDIR)$(bindir)/$(actual_reset)
167	(cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tset) $(actual_reset))
168
169uninstall.progs:
170@MAKE_TERMINFO@	-@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/$(actual_tic)
171@MAKE_TERMINFO@	-@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/$(actual_toe)
172@MAKE_TERMINFO@	-@rm -f $(DESTDIR)$(bindir)/$(actual_captoinfo)
173@MAKE_TERMINFO@	-@rm -f $(DESTDIR)$(bindir)/$(actual_infotocap)
174	-@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/$(actual_infocmp)
175	-@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/$(actual_clear)
176	-@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/$(actual_tput)
177	-@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/$(actual_tset)
178	-@rm -f $(DESTDIR)$(bindir)/$(actual_reset)
179
180$(DESTDIR)$(bindir) :
181	sh $(srcdir)/../mkinstalldirs $@
182
183#
184# Utilities normally built by make all start here
185#
186
187DEPS_TIC = \
188	$(MODEL)/tic.o \
189	$(MODEL)/dump_entry.o
190
191tic$x: $(DEPS_TIC) $(DEPS_CURSES) transform.h
192	@ECHO_LINK@ $(LINK) $(DEPS_TIC) $(LDFLAGS_DEFAULT) -o $@
193
194DEPS_TOE = \
195	$(MODEL)/toe.o \
196	$(MODEL)/dump_entry.o
197
198toe$x: $(DEPS_TOE) $(DEPS_CURSES)
199	@ECHO_LINK@ $(LINK) $(DEPS_TOE) $(LDFLAGS_DEFAULT) -o $@
200
201DEPS_CLEAR = \
202	$(MODEL)/clear.o
203
204clear$x: $(DEPS_CLEAR) $(DEPS_CURSES)
205	@ECHO_LINK@ $(LINK) $(DEPS_CLEAR) $(LDFLAGS_DEFAULT) -o $@
206
207DEPS_TPUT = \
208	$(MODEL)/tput.o
209
210tput$x: $(DEPS_TPUT) $(DEPS_CURSES) transform.h
211	@ECHO_LINK@ $(LINK) $(DEPS_TPUT) $(LDFLAGS_DEFAULT) -o $@
212
213DEPS_INFOCMP = \
214	$(MODEL)/infocmp.o \
215	$(MODEL)/dump_entry.o
216
217infocmp$x: $(DEPS_INFOCMP) $(DEPS_CURSES)
218	@ECHO_LINK@ $(LINK) $(DEPS_INFOCMP) $(LDFLAGS_DEFAULT) -o $@
219
220DEPS_TSET = \
221	$(MODEL)/tset.o \
222	$(MODEL)/dump_entry.o
223
224tset$x: $(DEPS_TSET) $(DEPS_CURSES) transform.h
225	@ECHO_LINK@ $(LINK) $(DEPS_TSET) $(LDFLAGS_DEFAULT) -o $@
226
227termsort.c: $(srcdir)/MKtermsort.sh
228	sh -c "$(srcdir)/MKtermsort.sh $(AWK) $(srcdir)/../include/@TERMINFO_CAPS@" >$@
229
230#
231# Utility productions start here
232#
233
234tags:
235	ctags *.[ch]
236
237@MAKE_UPPER_TAGS@TAGS:
238@MAKE_UPPER_TAGS@	etags *.[ch]
239
240mostlyclean ::
241	-rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace
242	-rm -f $(TESTPROGS)
243
244clean :: mostlyclean
245	-rm -f $(AUTO_SRC)
246	-rm -f $(PROGS)
247	-rm -rf .libs
248
249distclean :: clean
250	-rm -f Makefile
251
252realclean :: distclean
253
254# These rules are used to allow "make -n" to work on a clean directory-tree
255../include/hashsize.h \
256../include/parametrized.h \
257../include/term.h :
258	cd ../include; $(MAKE) $(CF_MFLAGS)
259$(DEPS_CURSES) :
260	cd ../ncurses; $(MAKE) $(CF_MFLAGS)
261
262lint:
263@MAKE_TERMINFO@	$(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tic.c     $(srcdir)/dump_entry.c $(LINT_LIBS)
264@MAKE_TERMINFO@	$(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/toe.c     $(srcdir)/dump_entry.c $(LINT_LIBS)
265	$(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/clear.c                          $(LINT_LIBS)
266	$(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/infocmp.c $(srcdir)/dump_entry.c $(LINT_LIBS)
267	$(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tput.c                           $(LINT_LIBS)
268	$(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tset.c    $(srcdir)/dump_entry.c $(LINT_LIBS)
269
270###############################################################################
271# The remainder of this file is automatically generated during configuration
272###############################################################################
273