1 # $Id: Makefile.in,v 1.21 1997/02/15 20:03:34 tom Exp $
2 ################################################################################
3 # Copyright 1996,1997 by Thomas E. Dickey <dickey@clark.net> #
4 # All Rights Reserved. #
6 # Permission to use, copy, modify, and distribute this software and its #
7 # documentation for any purpose and without fee is hereby granted, provided #
8 # that the above copyright notice appear in all copies and that both that #
9 # copyright notice and this permission notice appear in supporting #
10 # documentation, and that the name of the above listed copyright holder(s) not #
11 # be used in advertising or publicity pertaining to distribution of the #
12 # software without specific, written prior permission. THE ABOVE LISTED #
13 # COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, #
14 # INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT #
15 # SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, #
16 # INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM #
17 # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE #
18 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR #
19 # PERFORMANCE OF THIS SOFTWARE. #
20 ################################################################################
21 # Makefile for ncurses source code.
23 # This makes the ncurses utility programs.
25 # The variable 'srcdir' refers to the source-distribution, and can be set with
26 # the configure script by "--srcdir=DIR".
28 # The rules are organized to produce the libraries for the configured models,
29 # and the programs with the configured default model.
31 # turn off _all_ suffix rules; we'll generate our own
37 NC_MFLAGS = @nc_cv_makeflags@
40 MODEL = ../@DFT_OBJ_SUBDIR@
41 INSTALL_PREFIX = @INSTALL_PREFIX@
44 exec_prefix = @exec_prefix@
46 includedir = @includedir@
49 ticdir = $(datadir)/terminfo
52 INSTALL_PROGRAM = @INSTALL_PROGRAM@
60 INCDIR = $(srcdir)/../include
61 CPPFLAGS = -I../progs -I$(srcdir) @CPPFLAGS@ \
62 -DHAVE_CONFIG_H -DTERMINFO=\"$(ticdir)\"
64 CCFLAGS = $(CPPFLAGS) $(CFLAGS)
66 CFLAGS_NORMAL = $(CCFLAGS)
67 CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE
68 CFLAGS_PROFILE = $(CCFLAGS) -pg
69 CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@
71 CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@)
75 LDFLAGS = -L../lib -lncurses@DFT_ARG_SUFFIX@ @LDFLAGS@ @LD_MODEL@ @LIBS@ @EXTRA_LIBS@
77 LDFLAGS_NORMAL = $(LDFLAGS)
78 LDFLAGS_DEBUG = $(LDFLAGS) @CC_G_OPT@
79 LDFLAGS_PROFILE = $(LDFLAGS) -pg
80 LDFLAGS_SHARED = $(LDFLAGS) @CC_SHARED_OPTS@
82 LDFLAGS_DEFAULT = $(LDFLAGS_@DFT_UPR_MODEL@)
85 LINT_OPTS = @LINT_OPTS@
86 LINT_LIBS = -lncurses @LIBS@
91 PROGS = tic toe infocmp clear tput tset
93 TESTPROGS = mvcur tctest hardscroll hashmap
95 # Default library, for linking applications
96 DEPS_CURSES = ../lib/libncurses@DFT_DEP_SUFFIX@
98 ################################################################################
99 all: $(AUTO_SRC) $(PROGS)
101 install: install.progs
103 # this line simplifies the configure-script
106 install.progs: $(PROGS) $(INSTALL_PREFIX)$(bindir)
107 $(INSTALL_PROGRAM) tic $(INSTALL_PREFIX)$(bindir)/tic
108 $(INSTALL_PROGRAM) toe $(INSTALL_PREFIX)$(bindir)/toe
109 $(INSTALL_PROGRAM) infocmp $(INSTALL_PREFIX)$(bindir)/infocmp
110 $(INSTALL_PROGRAM) clear $(INSTALL_PREFIX)$(bindir)/clear
111 $(INSTALL_PROGRAM) tput $(INSTALL_PREFIX)$(bindir)/tput
112 $(INSTALL_PROGRAM) tset $(INSTALL_PREFIX)$(bindir)/tset
113 @echo "linking captoinfo to tic"
114 -@rm -f $(INSTALL_PREFIX)$(bindir)/captoinfo
115 (cd $(INSTALL_PREFIX)$(bindir) && $(LN_S) tic captoinfo)
116 @echo "linking reset to tset"
117 -@rm -f $(INSTALL_PREFIX)$(bindir)/reset
118 (cd $(INSTALL_PREFIX)$(bindir) && $(LN_S) tset reset)
120 $(INSTALL_PREFIX)$(bindir) :
121 $(srcdir)/../mkinstalldirs $@
124 # Utilities normally built by make all start here
129 $(MODEL)/dump_entry.o
131 tic: $(DEPS_TIC) $(DEPS_CURSES)
132 @ECHO_LINK@ $(LINK) $(DEPS_TIC) $(LDFLAGS_DEFAULT) -o $@
136 $(MODEL)/dump_entry.o
138 toe: $(DEPS_TOE) $(DEPS_CURSES)
139 @ECHO_LINK@ $(LINK) $(DEPS_TOE) $(LDFLAGS_DEFAULT) -o $@
144 clear: $(DEPS_CLEAR) $(DEPS_CURSES)
145 @ECHO_LINK@ $(LINK) $(DEPS_CLEAR) $(LDFLAGS_DEFAULT) -o $@
150 tput: $(DEPS_TPUT) $(DEPS_CURSES)
151 @ECHO_LINK@ $(LINK) $(DEPS_TPUT) $(LDFLAGS_DEFAULT) -o $@
155 $(MODEL)/dump_entry.o
157 infocmp: $(DEPS_INFOCMP) $(DEPS_CURSES)
158 @ECHO_LINK@ $(LINK) $(DEPS_INFOCMP) $(LDFLAGS_DEFAULT) -o $@
162 $(MODEL)/dump_entry.o
164 tset: $(DEPS_TSET) $(DEPS_CURSES)
165 @ECHO_LINK@ $(LINK) $(DEPS_TSET) $(LDFLAGS_DEFAULT) -o $@
167 termsort.c: $(srcdir)/MKtermsort.sh
168 sh -c "$(srcdir)/MKtermsort.sh $(AWK) $(srcdir)/../include/Caps" >$@
171 # Test programs (not normally built by make all) start here.
174 # Cursor movement optimization tester. Use -g for debugging but -O if you're
175 # profiling with intent to determine COMPUTE_OVERHEAD
178 $(srcdir)/../ncurses/lib_mvcur.c \
179 $(MODEL)/dump_entry.o
181 mvcur: $(DEPS_MVCUR) $(DEPS_CURSES)
182 @ECHO_LINK@ $(LINK) $(CCFLAGS) -DTRACE -DMAIN $(MVFLAGS) $(DEPS_MVCUR) $(LDFLAGS_DEFAULT) -o $@
184 # Termcap-conversion tester
186 $(srcdir)/../ncurses/captoinfo.c
188 tctest: $(DEPS_TCTEST) $(DEPS_CURSES)
189 @ECHO_LINK@ $(LINK) $(CCFLAGS) -DTRACE -DMAIN $(DEPS_TCTEST) $(LDFLAGS_DEFAULT) -o $@
191 # Demonstrator/tester for hardware-scrolling algorithm.
193 $(srcdir)/../ncurses/hardscroll.c \
196 @ECHO_LINK@ $(LINK) $(CCFLAGS) -I$(srcdir)/../ncurses -DTRACE -DSCROLLDEBUG $(DEPS_HARDSCROLL) $(LDFLAGS_DEFAULT) -o $@
198 # Demonstrator-tester for enhanced hardware-scrolling code with hash mapping
200 $(srcdir)/../ncurses/hashmap.c \
201 $(srcdir)/../ncurses/hardscroll.c \
203 hashmap: $(DEPS_HASHMAP)
204 @ECHO_LINK@ $(LINK) $(CCFLAGS) -I$(srcdir)/../ncurses -DTRACE -DHASHDEBUG $(DEPS_HASHMAP) -o $@
207 # Utility productions start here
217 -rm -f tags TAGS do.tic *~
218 -rm -f $(AUTO_SRC) $(TESTPROGS)
226 realclean :: distclean
228 # These rules are used to allow "make -n" to work on a clean directory-tree
229 ../include/hashsize.h \
230 ../include/parametrized.h \
232 cd ../include; $(MAKE) $(NC_MFLAGS)
234 cd ../ncurses; $(MAKE) $(NC_MFLAGS)
237 $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/clear.c $(LINT_LIBS)
238 $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/infocmp.c $(srcdir)/dump_entry.c $(LINT_LIBS)
239 $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tic.c $(srcdir)/dump_entry.c $(LINT_LIBS)
240 $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/toe.c $(srcdir)/dump_entry.c $(LINT_LIBS)
241 $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tput.c $(LINT_LIBS)
242 $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tset.c $(srcdir)/dump_entry.c $(LINT_LIBS)
244 ###############################################################################
245 # The remainder of this file is automatically generated during configuration
246 ###############################################################################