Makefile.in revision 66963
1# $Id: Makefile.in,v 1.69 2000/08/26 21:51:30 tom Exp $
2##############################################################################
3# Copyright (c) 1998,1999,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 following:
35#	programs
36#	includes
37#	libraries (normal/debug/profile/shared)
38#
39# The variable 'srcdir' refers to the source-distribution, and can be set with
40# the configure script by "--srcdir=DIR".
41#
42# The rules are organized to produce the libraries for the configured models,
43# and the programs with the configured default model.
44
45# turn off _all_ suffix rules; we'll generate our own
46.SUFFIXES:
47
48SHELL		= /bin/sh
49THIS		= Makefile
50
51x		= @PROG_EXT@
52
53CF_MFLAGS 	= @cf_cv_makeflags@
54@SET_MAKE@
55
56MODEL		= @DFT_LWR_MODEL@
57DESTDIR		= @DESTDIR@
58srcdir		= @srcdir@
59prefix		= @prefix@
60exec_prefix	= @exec_prefix@
61libdir		= @libdir@
62includedir	= @includedir@
63datadir		= @datadir@
64
65INSTALL		= @INSTALL@
66INSTALL_LIB	= @INSTALL@ @INSTALL_LIB@
67INSTALL_DATA	= @INSTALL_DATA@
68
69AR		= @AR@
70AR_OPTS		= @AR_OPTS@
71AWK		= @AWK@
72LD		= @LD@
73LN_S		= @LN_S@
74
75CC		= @CC@
76CPP		= @CPP@
77CFLAGS		= @CFLAGS@
78
79INCDIR		= $(srcdir)/../include
80CPPFLAGS	= -I../ncurses -I$(srcdir) @CPPFLAGS@ \
81		  -DHAVE_CONFIG_H
82
83CCFLAGS		= $(CPPFLAGS) $(CFLAGS)
84
85HOSTCC		= @BUILD_CC@
86HOSTCCFLAGS	= @CFLAGS@ $(CPPFLAGS)
87HOSTLDFLAGS	= @LDFLAGS@ @LIBS@
88
89CFLAGS_NORMAL	= $(CCFLAGS)
90CFLAGS_DEBUG	= $(CCFLAGS) @CC_G_OPT@ -DTRACE
91CFLAGS_PROFILE	= $(CCFLAGS) -pg
92CFLAGS_SHARED	= $(CCFLAGS) @CC_SHARED_OPTS@
93
94CFLAGS_DEFAULT	= $(CFLAGS_@DFT_UPR_MODEL@)
95
96LINK		= $(CC)
97LDFLAGS		= @LDFLAGS@ @LD_MODEL@ @LIBS@
98
99SHLIB_DIRS	= -L../lib -L$(libdir)
100SHLIB_LIST	= $(SHLIB_DIRS) @SHLIB_LIST@
101TINFO_LIST	= $(SHLIB_DIRS) @TINFO_LIST@
102
103MK_SHARED_LIB	= @MK_SHARED_LIB@
104
105REL_VERSION	= @cf_cv_rel_version@
106ABI_VERSION	= @cf_cv_abi_version@
107
108RANLIB		= @RANLIB@
109
110LIBRARIES	= @LIBS_TO_MAKE@
111
112LINT		= @LINT@
113LINT_OPTS	= @LINT_OPTS@
114LINT_LIBS	= -lncurses @LIBS@
115
116FALLBACK_LIST	= @FALLBACK_LIST@
117
118AUTO_SRC = \
119	../include/nomacros.h \
120	./comp_captab.c \
121	./expanded.c \
122	./fallback.c \
123	init_keytry.h \
124	./lib_keyname.c \
125	./lib_gen.c \
126	./codes.c \
127	./names.c \
128	./unctrl.c
129
130TEST_DEPS	= ../lib/@LIB_PREFIX@ncurses@DFT_DEP_SUFFIX@
131TEST_ARGS	= -L../lib -lncurses@DFT_ARG_SUFFIX@
132TEST_LDFLAGS	= @LD_MODEL@ $(TEST_ARGS) @LIBS@ @EXTRA_LIBS@ @LOCAL_LDFLAGS@ @LDFLAGS@
133
134TEST_PROGS = \
135	captoinfo$x \
136	hardscroll$x \
137	hashmap$x \
138	lib_mvcur$x
139
140base	= $(srcdir)/base
141serial	= $(srcdir)/tty
142tinfo	= $(srcdir)/tinfo
143trace	= $(srcdir)/trace
144
145################################################################################
146all \
147libs ::		$(AUTO_SRC) ../lib $(LIBRARIES)
148
149sources:	$(AUTO_SRC)
150
151$(DESTDIR)$(libdir) :
152	$(srcdir)/../mkinstalldirs $@
153
154../lib : ; mkdir $@
155
156./fallback.c : $(tinfo)/MKfallback.sh
157	sh $(tinfo)/MKfallback.sh $(FALLBACK_LIST) >$@
158
159./lib_gen.c : $(base)/MKlib_gen.sh ../include/curses.h
160	sh $(base)/MKlib_gen.sh "$(CPP)" "$(AWK)" <../include/curses.h >$@
161
162../include/nomacros.h : $(base)/MKlib_gen.sh ../include/curses.h
163	sh $(base)/MKlib_gen.sh "$(CPP)" "$(AWK)" <../include/curses.h | \
164		fgrep undef >$@
165
166init_keytry.h: make_keys$x $(tinfo)/keys.list
167	./make_keys $(tinfo)/keys.list > $@
168
169make_keys$x : \
170		$(tinfo)/make_keys.c \
171		./names.c
172	$(HOSTCC) -o $@ $(HOSTCCFLAGS) $(tinfo)/make_keys.c $(HOSTLDFLAGS)
173
174make_hash$x : \
175		$(tinfo)/comp_hash.c \
176		../include/hashsize.h
177	$(HOSTCC) -o $@ $(HOSTCCFLAGS) -DMAIN_PROGRAM $(tinfo)/comp_hash.c $(HOSTLDFLAGS)
178
179./expanded.c : $(serial)/MKexpanded.sh
180	sh $(serial)/MKexpanded.sh "$(CPP)" $(CPPFLAGS) > $@
181
182./comp_captab.c: \
183		make_hash$x \
184		../include/hashsize.h \
185		$(tinfo)/MKcaptab.awk
186	sh $(tinfo)/MKcaptab.awk $(AWK) $(srcdir)/../include/Caps > $@
187
188./lib_keyname.c: $(tinfo)/keys.list $(base)/MKkeyname.awk
189	$(AWK) -f $(base)/MKkeyname.awk $(tinfo)/keys.list > $@
190
191./names.c ./codes.c: $(tinfo)/MKnames.awk
192	$(AWK) -f $(tinfo)/MKnames.awk $(srcdir)/../include/Caps
193	cat namehdr boolnames boolfnames numnames numfnames strnames strfnames nameftr >./names.c
194	cat namehdr boolcodes numcodes strcodes codeftr >./codes.c
195	-rm -f namehdr nameftr codeftr boolnames boolfnames boolcodes numnames numfnames numcodes strnames strfnames strcodes
196
197./unctrl.c: $(base)/MKunctrl.awk
198	echo | $(AWK) -f $(base)/MKunctrl.awk >$@
199
200tags:
201	ctags *.[ch]
202
203@MAKE_UPPER_TAGS@TAGS:
204@MAKE_UPPER_TAGS@	etags *.[ch]
205
206mostlyclean ::
207	-rm -f core tags TAGS *~ *.ln *.atac trace
208	-rm -f $(TEST_PROGS)
209
210clean :: mostlyclean
211	-rm -f $(AUTO_SRC)
212	-rm -f make_keys$x
213	-rm -f make_hash$x
214
215distclean :: clean
216	-rm -f Makefile
217
218realclean :: distclean
219
220# These rules are used to allow "make -n" to work on a clean directory-tree
221../include/hashsize.h \
222../include/parametrized.h \
223../include/term.h :
224	cd ../include; $(MAKE) $(CF_MFLAGS)
225
226# These rules build test-programs for the modules that have test-drivers
227test_progs : $(TEST_PROGS)
228
229captoinfo$x : $(tinfo)/captoinfo.c $(TEST_DEPS)
230	@ECHO_LINK@ $(CC) -o $@ $(CFLAGS_DEFAULT) -DMAIN $(tinfo)/captoinfo.c $(TEST_LDFLAGS)
231
232hardscroll$x : $(serial)/hardscroll.c $(TEST_DEPS)
233	@ECHO_LINK@ $(CC) -o $@ $(CFLAGS_DEFAULT) -DSCROLLDEBUG $(serial)/hardscroll.c $(TEST_LDFLAGS)
234
235hashmap$x : $(serial)/hashmap.c $(TEST_DEPS)
236	@ECHO_LINK@ $(CC) -o $@ $(CFLAGS_DEFAULT) -DHASHDEBUG $(serial)/hashmap.c $(TEST_LDFLAGS)
237
238lib_mvcur$x : $(serial)/lib_mvcur.c $(TEST_DEPS) \
239		../@DFT_OBJ_SUBDIR@/dump_entry.o
240	@ECHO_LINK@ $(CC) -o $@ $(CFLAGS_DEFAULT) -DNCURSES_TEST -I$(serial)/../../progs $(serial)/lib_mvcur.c ../@DFT_OBJ_SUBDIR@/dump_entry.o $(TEST_LDFLAGS)
241
242../@DFT_OBJ_SUBDIR@/dump_entry.o:
243	cd ../progs && $(MAKE) ../@DFT_OBJ_SUBDIR@/dump_entry.o
244
245###############################################################################
246# The remainder of this file is automatically generated during configuration
247###############################################################################
248