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