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