xref: /freebsd/contrib/ncurses/progs/Makefile.in (revision 5521ff5a4d1929056e7ffc982fac3341ca54df7c)
1# $Id: Makefile.in,v 1.52 2001/03/24 19:53:31 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
110PROGS = tic$x toe$x infocmp$x clear$x tput$x tset$x
111
112TESTPROGS = mvcur$x tctest$x hardscroll$x hashmap$x
113
114# Default library, for linking applications
115DEPS_CURSES = ../lib/@LIB_PREFIX@ncurses@DFT_DEP_SUFFIX@
116
117################################################################################
118all:		$(AUTO_SRC) $(PROGS)
119
120sources:	$(AUTO_SRC)
121
122install: 	$(AUTO_SRC) install.progs
123uninstall: uninstall.progs
124
125# this line simplifies the configure-script
126libs \
127install.libs \
128uninstall.libs:
129
130TRANSFORM = sed 's/$x$$//'|sed '$(transform)'|sed 's/$$/$x/'
131
132actual_captoinfo = `echo captoinfo$x| $(TRANSFORM)`
133actual_clear     = `echo clear$x|     $(TRANSFORM)`
134actual_infocmp   = `echo infocmp$x|   $(TRANSFORM)`
135actual_infotocap = `echo infotocap$x| $(TRANSFORM)`
136actual_init      = `echo init$x|      $(TRANSFORM)`
137actual_reset     = `echo reset$x|     $(TRANSFORM)`
138actual_tic       = `echo tic$x|       $(TRANSFORM)`
139actual_toe       = `echo toe$x|       $(TRANSFORM)`
140actual_tput      = `echo tput$x|      $(TRANSFORM)`
141actual_tset      = `echo tset$x|      $(TRANSFORM)`
142
143transform.h :
144	echo "#define PROG_CAPTOINFO \"$(actual_captoinfo)\"" >$@
145	echo "#define PROG_INFOTOCAP \"$(actual_infotocap)\"" >>$@
146	echo "#define PROG_RESET     \"$(actual_reset)\""     >>$@
147	echo "#define PROG_INIT      \"$(actual_init)\""      >>$@
148
149install.progs: $(AUTO_SRC) $(PROGS) $(DESTDIR)$(bindir)
150	$(LIBTOOL) $(INSTALL_PROGRAM) tic$x     $(DESTDIR)$(bindir)/$(actual_tic)
151	$(LIBTOOL) $(INSTALL_PROGRAM) toe$x     $(DESTDIR)$(bindir)/$(actual_toe)
152	$(LIBTOOL) $(INSTALL_PROGRAM) infocmp$x $(DESTDIR)$(bindir)/$(actual_infocmp)
153	$(LIBTOOL) $(INSTALL_PROGRAM) clear$x   $(DESTDIR)$(bindir)/$(actual_clear)
154	$(LIBTOOL) $(INSTALL_PROGRAM) tput$x    $(DESTDIR)$(bindir)/$(actual_tput)
155	$(LIBTOOL) $(INSTALL_PROGRAM) tset$x    $(DESTDIR)$(bindir)/$(actual_tset)
156	@echo "linking $(actual_captoinfo) to $(actual_tic)"
157	-@rm -f $(DESTDIR)$(bindir)/$(actual_captoinfo)
158	(cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tic) $(actual_captoinfo))
159	@echo "linking $(actual_infotocap) to $(actual_tic)"
160	-@rm -f $(DESTDIR)$(bindir)/$(actual_infotocap)
161	(cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tic) $(actual_infotocap))
162	@echo "linking $(actual_reset) to $(actual_tset)"
163	-@rm -f $(DESTDIR)$(bindir)/$(actual_reset)
164	(cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tset) $(actual_reset))
165
166uninstall.progs:
167	-@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/$(actual_tic)
168	-@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/$(actual_toe)
169	-@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/$(actual_infocmp)
170	-@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/$(actual_clear)
171	-@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/$(actual_tput)
172	-@$(LIBTOOL) rm -f $(DESTDIR)$(bindir)/$(actual_tset)
173	-@rm -f $(DESTDIR)$(bindir)/$(actual_captoinfo)
174	-@rm -f $(DESTDIR)$(bindir)/$(actual_infotocap)
175	-@rm -f $(DESTDIR)$(bindir)/$(actual_reset)
176
177$(DESTDIR)$(bindir) :
178	$(srcdir)/../mkinstalldirs $@
179
180#
181# Utilities normally built by make all start here
182#
183
184DEPS_TIC = \
185	$(MODEL)/tic.o \
186	$(MODEL)/dump_entry.o
187
188tic$x: $(DEPS_TIC) $(DEPS_CURSES) transform.h
189	@ECHO_LINK@ $(LINK) $(DEPS_TIC) $(LDFLAGS_DEFAULT) -o $@
190
191DEPS_TOE = \
192	$(MODEL)/toe.o \
193	$(MODEL)/dump_entry.o
194
195toe$x: $(DEPS_TOE) $(DEPS_CURSES)
196	@ECHO_LINK@ $(LINK) $(DEPS_TOE) $(LDFLAGS_DEFAULT) -o $@
197
198DEPS_CLEAR = \
199	$(MODEL)/clear.o
200
201clear$x: $(DEPS_CLEAR) $(DEPS_CURSES)
202	@ECHO_LINK@ $(LINK) $(DEPS_CLEAR) $(LDFLAGS_DEFAULT) -o $@
203
204DEPS_TPUT = \
205	$(MODEL)/tput.o
206
207tput$x: $(DEPS_TPUT) $(DEPS_CURSES) transform.h
208	@ECHO_LINK@ $(LINK) $(DEPS_TPUT) $(LDFLAGS_DEFAULT) -o $@
209
210DEPS_INFOCMP = \
211	$(MODEL)/infocmp.o \
212	$(MODEL)/dump_entry.o
213
214infocmp$x: $(DEPS_INFOCMP) $(DEPS_CURSES)
215	@ECHO_LINK@ $(LINK) $(DEPS_INFOCMP) $(LDFLAGS_DEFAULT) -o $@
216
217DEPS_TSET = \
218	$(MODEL)/tset.o \
219	$(MODEL)/dump_entry.o
220
221tset$x: $(DEPS_TSET) $(DEPS_CURSES) transform.h
222	@ECHO_LINK@ $(LINK) $(DEPS_TSET) $(LDFLAGS_DEFAULT) -o $@
223
224termsort.c: $(srcdir)/MKtermsort.sh
225	sh -c "$(srcdir)/MKtermsort.sh $(AWK) $(srcdir)/../include/Caps" >$@
226
227#
228# Utility productions start here
229#
230
231tags:
232	ctags *.[ch]
233
234@MAKE_UPPER_TAGS@TAGS:
235@MAKE_UPPER_TAGS@	etags *.[ch]
236
237mostlyclean ::
238	-rm -f core tags TAGS *~ *.i *.ln *.atac trace
239	-rm -f $(TESTPROGS)
240
241clean :: mostlyclean
242	-rm -f $(AUTO_SRC)
243	-rm -f $(PROGS)
244	-rm -rf .libs
245
246distclean :: clean
247	-rm -f Makefile
248
249realclean :: distclean
250
251# These rules are used to allow "make -n" to work on a clean directory-tree
252../include/hashsize.h \
253../include/parametrized.h \
254../include/term.h :
255	cd ../include; $(MAKE) $(CF_MFLAGS)
256$(DEPS_CURSES) :
257	cd ../ncurses; $(MAKE) $(CF_MFLAGS)
258
259lint:
260	$(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/clear.c                          $(LINT_LIBS)
261	$(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/infocmp.c $(srcdir)/dump_entry.c $(LINT_LIBS)
262	$(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tic.c     $(srcdir)/dump_entry.c $(LINT_LIBS)
263	$(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/toe.c     $(srcdir)/dump_entry.c $(LINT_LIBS)
264	$(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tput.c                           $(LINT_LIBS)
265	$(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tset.c    $(srcdir)/dump_entry.c $(LINT_LIBS)
266
267###############################################################################
268# The remainder of this file is automatically generated during configuration
269###############################################################################
270