1 # $Id: Makefile.in,v 1.51 2000/10/14 22:19:14 tom Exp $
2 ##############################################################################
3 # Copyright (c) 1998-2000 Free Software Foundation, Inc. #
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: #
13 # The above copyright notice and this permission notice shall be included in #
14 # all copies or substantial portions of the Software. #
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. #
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 #
28 ##############################################################################
30 # Author: Thomas E. Dickey <dickey@clark.net> 1996,1997
32 # Makefile for ncurses source code.
34 # This makes the ncurses utility programs.
36 # The variable 'srcdir' refers to the source-distribution, and can be set with
37 # the configure script by "--srcdir=DIR".
39 # The rules are organized to produce the libraries for the configured models,
40 # and the programs with the configured default model.
42 # turn off _all_ suffix rules; we'll generate our own
48 CF_MFLAGS = @cf_cv_makeflags@
52 MODEL = ../@DFT_OBJ_SUBDIR@
56 exec_prefix = @exec_prefix@
59 includedir = @includedir@
65 INSTALL_PROGRAM = @INSTALL_PROGRAM@
66 transform = @program_transform_name@
75 INCDIR = $(srcdir)/../include
76 CPPFLAGS = -I../progs -I$(srcdir) @CPPFLAGS@ \
79 CCFLAGS = $(CPPFLAGS) $(CFLAGS)
81 CFLAGS_LIBTOOL = $(CCFLAGS)
82 CFLAGS_NORMAL = $(CCFLAGS)
83 CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE
84 CFLAGS_PROFILE = $(CCFLAGS) -pg
85 CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@
87 CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@)
90 LINK = @LINK_PROGS@ $(LIBTOOL) $(CC)
91 LDFLAGS = @EXTRA_LDFLAGS@ \
92 @PROG_ARGS@ @LDFLAGS@ @LD_MODEL@ @LIBS@ @EXTRA_LIBS@
94 LDFLAGS_LIBTOOL = $(LDFLAGS)
95 LDFLAGS_NORMAL = $(LDFLAGS)
96 LDFLAGS_DEBUG = $(LDFLAGS) @CC_G_OPT@
97 LDFLAGS_PROFILE = $(LDFLAGS) -pg
98 LDFLAGS_SHARED = $(LDFLAGS) @LD_SHARED_OPTS@
100 LDFLAGS_DEFAULT = $(LDFLAGS_@DFT_UPR_MODEL@)
103 LINT_OPTS = @LINT_OPTS@
104 LINT_LIBS = -lncurses @LIBS@
110 PROGS = tic$x toe$x infocmp$x clear$x tput$x tset$x
112 TESTPROGS = mvcur$x tctest$x hardscroll$x hashmap$x
114 # Default library, for linking applications
115 DEPS_CURSES = ../lib/@LIB_PREFIX@ncurses@DFT_DEP_SUFFIX@
117 ################################################################################
118 all: $(AUTO_SRC) $(PROGS)
122 install: $(AUTO_SRC) install.progs
123 uninstall: uninstall.progs
125 # this line simplifies the configure-script
130 TRANSFORM = sed 's/$x$$//'|sed '$(transform)'|sed 's/$$/$x/'
132 actual_captoinfo = `echo captoinfo$x| $(TRANSFORM)`
133 actual_clear = `echo clear$x| $(TRANSFORM)`
134 actual_infocmp = `echo infocmp$x| $(TRANSFORM)`
135 actual_infotocap = `echo infotocap$x| $(TRANSFORM)`
136 actual_init = `echo init$x| $(TRANSFORM)`
137 actual_reset = `echo reset$x| $(TRANSFORM)`
138 actual_tic = `echo tic$x| $(TRANSFORM)`
139 actual_toe = `echo toe$x| $(TRANSFORM)`
140 actual_tput = `echo tput$x| $(TRANSFORM)`
141 actual_tset = `echo tset$x| $(TRANSFORM)`
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)\"" >>$@
149 install.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))
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)
177 $(DESTDIR)$(bindir) :
178 $(srcdir)/../mkinstalldirs $@
181 # Utilities normally built by make all start here
186 $(MODEL)/dump_entry.o
188 tic$x: $(DEPS_TIC) $(DEPS_CURSES) transform.h
189 @ECHO_LINK@ $(LINK) $(DEPS_TIC) $(LDFLAGS_DEFAULT) -o $@
193 $(MODEL)/dump_entry.o
195 toe$x: $(DEPS_TOE) $(DEPS_CURSES)
196 @ECHO_LINK@ $(LINK) $(DEPS_TOE) $(LDFLAGS_DEFAULT) -o $@
201 clear$x: $(DEPS_CLEAR) $(DEPS_CURSES)
202 @ECHO_LINK@ $(LINK) $(DEPS_CLEAR) $(LDFLAGS_DEFAULT) -o $@
207 tput$x: $(DEPS_TPUT) $(DEPS_CURSES) transform.h
208 @ECHO_LINK@ $(LINK) $(DEPS_TPUT) $(LDFLAGS_DEFAULT) -o $@
212 $(MODEL)/dump_entry.o
214 infocmp$x: $(DEPS_INFOCMP) $(DEPS_CURSES)
215 @ECHO_LINK@ $(LINK) $(DEPS_INFOCMP) $(LDFLAGS_DEFAULT) -o $@
219 $(MODEL)/dump_entry.o
221 tset$x: $(DEPS_TSET) $(DEPS_CURSES) transform.h
222 @ECHO_LINK@ $(LINK) $(DEPS_TSET) $(LDFLAGS_DEFAULT) -o $@
224 termsort.c: $(srcdir)/MKtermsort.sh
225 sh -c "$(srcdir)/MKtermsort.sh $(AWK) $(srcdir)/../include/Caps" >$@
228 # Utility productions start here
234 @MAKE_UPPER_TAGS@TAGS:
235 @MAKE_UPPER_TAGS@ etags *.[ch]
238 -rm -f core tags TAGS *~ *.ln *.atac trace
249 realclean :: distclean
251 # These rules are used to allow "make -n" to work on a clean directory-tree
252 ../include/hashsize.h \
253 ../include/parametrized.h \
255 cd ../include; $(MAKE) $(CF_MFLAGS)
257 cd ../ncurses; $(MAKE) $(CF_MFLAGS)
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)
267 ###############################################################################
268 # The remainder of this file is automatically generated during configuration
269 ###############################################################################