ncurses 6.2 - patch 20200816
[ncurses.git] / Ada95 / gen / Makefile.in
1 ##############################################################################
2 # Copyright 2019,2020 Thomas E. Dickey                                       #
3 # Copyright 1998-2015,2018 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:  Juergen Pfeifer, 1996
31 #     and:  Thomas E. Dickey, 1997
32 #
33 #  $Id: Makefile.in,v 1.94 2020/08/09 01:06:50 tom Exp $
34 #
35 .SUFFIXES:
36
37 SHELL           = @SHELL@
38 VPATH           = @srcdir@
39 THIS            = Makefile
40
41 x               = @EXEEXT@
42
43 top_srcdir      = @top_srcdir@
44 DESTDIR         = @DESTDIR@
45 srcdir          = @srcdir@
46 prefix          = @prefix@
47 exec_prefix     = @exec_prefix@
48 bindir          = @bindir@
49 includedir      = @includedir@
50
51 INSTALL         = @INSTALL@ @INSTALL_OPT_O@
52 INSTALL_SCRIPT  = @INSTALL_SCRIPT@
53 INSTALL_DATA    = @INSTALL_DATA@
54
55 AWK             = @AWK@
56 LN_S            = @LN_S@
57
58 CC              = @CC@
59 HOST_CC         = @BUILD_CC@
60
61 CFLAGS          = @CFLAGS@
62 HOST_CFLAGS     = @BUILD_CFLAGS@
63
64 CPPFLAGS        = @CPPFLAGS@
65 HOST_CPPFLAGS   = @ACPPFLAGS@ @BUILD_CPPFLAGS@ \
66                   -DHAVE_CONFIG_H -I$(srcdir)
67
68 CCFLAGS         = $(HOST_CPPFLAGS) $(HOST_CFLAGS)
69 CFLAGS_NORMAL   = $(CCFLAGS) -DNCURSES_STATIC
70 CFLAGS_DEBUG    = $(CCFLAGS) -DNCURSES_STATIC @CC_G_OPT@ -DTRACE
71 CFLAGS_PROFILE  = $(CCFLAGS) -DNCURSES_STATIC -pg
72 CFLAGS_SHARED   = $(CCFLAGS) @CC_SHARED_OPTS@
73
74 CFLAGS_DEFAULT  = $(CFLAGS_@DFT_UPR_MODEL@)
75
76 REL_VERSION     = @cf_cv_rel_version@
77 ABI_VERSION     = @cf_cv_abi_version@
78 LOCAL_LIBDIR    = @top_builddir@/lib
79
80 LINK            = $(HOST_CC)
81 LDFLAGS         = @LDFLAGS@
82 LIBS            = @LIBS@
83
84 # For the wide-character configuration combined with broken_linker, we need
85 # addresses of ACS_xxx constants, which requires linking with the newly built
86 # ncurses library.  If cross-compiling, the developer has to fill in a workable
87 # native library for this purpose.
88 NATIVE_LDFLAGS  = @LD_MODEL@ $(LOCAL_LIBS) @TINFO_LDFLAGS2@ $(LDFLAGS) @LIBS@ @LOCAL_LDFLAGS2@ $(LDFLAGS) @TINFO_LIBS@
89 CROSS_LDFLAGS   = @BUILD_LDFLAGS@ @BUILD_LIBS@
90
91 ACTUAL_LDFLAGS  = @ADAGEN_LDFLAGS@
92
93 RANLIB          = @RANLIB@
94
95 M4              = m4
96 M4FLAGS         = -DNCURSES_EXT_FUNCS=@NCURSES_EXT_FUNCS@
97
98 ADACURSES_CONFIG = adacurses@USE_CFG_SUFFIX@-config
99
100 WRAPPER         = @NCURSES_SHLIB2@
101
102 PROG_GENERATE   = ./generate$x
103 GENERATE        = $(PROG_GENERATE) '@USE_ARG_SUFFIX@'
104 DEL_ADAMODE     = sed -e '/^\-\-\ \ \-\*\-\ ada\ \-\*\-.*/d'
105
106 GNATHTML        = `type -p gnathtml || type -p gnathtml.pl 2>/dev/null`
107 GNATHP          = www.gnat.com
108
109 ################################################################################
110 ALIB            = @cf_ada_package@
111 ABASE           = $(ALIB)-curses
112
113 ADA_SRCDIR      = ../src
114
115 GEN_TARGETS     = $(ADA_SRCDIR)/$(ABASE).ads                            \
116                   $(ADA_SRCDIR)/$(ABASE).adb                            \
117                   $(ADA_SRCDIR)/$(ABASE)-aux.ads                        \
118                   $(ADA_SRCDIR)/$(ABASE)-trace.ads                      \
119                   $(ADA_SRCDIR)/$(ABASE)-menus.ads                      \
120                   $(ADA_SRCDIR)/$(ABASE)-forms.ads                      \
121                   $(ADA_SRCDIR)/$(ABASE)-mouse.ads                      \
122                   $(ADA_SRCDIR)/$(ABASE)-panels.ads                     \
123                   $(ADA_SRCDIR)/$(ABASE)-menus-menu_user_data.ads       \
124                   $(ADA_SRCDIR)/$(ABASE)-menus-item_user_data.ads       \
125                   $(ADA_SRCDIR)/$(ABASE)-forms-form_user_data.ads       \
126                   $(ADA_SRCDIR)/$(ABASE)-forms-field_types.ads          \
127                   $(ADA_SRCDIR)/$(ABASE)-forms-field_user_data.ads      \
128                   $(ADA_SRCDIR)/$(ABASE)-panels-user_data.ads           \
129                   $(ADA_SRCDIR)/$(ABASE)_constants.ads
130
131 GEN_SRC         = $(srcdir)/$(ABASE).ads.m4                             \
132                   $(srcdir)/$(ABASE).adb.m4                             \
133                   $(srcdir)/$(ABASE)-aux.ads.m4                         \
134                   $(srcdir)/$(ABASE)-trace.ads.m4                       \
135                   $(srcdir)/$(ABASE)-menus.ads.m4                       \
136                   $(srcdir)/$(ABASE)-forms.ads.m4                       \
137                   $(srcdir)/$(ABASE)-mouse.ads.m4                       \
138                   $(srcdir)/$(ABASE)-panels.ads.m4                      \
139                   $(srcdir)/$(ABASE)-menus-menu_user_data.ads.m4        \
140                   $(srcdir)/$(ABASE)-menus-item_user_data.ads.m4        \
141                   $(srcdir)/$(ABASE)-forms-form_user_data.ads.m4        \
142                   $(srcdir)/$(ABASE)-forms-field_types.ads.m4           \
143                   $(srcdir)/$(ABASE)-forms-field_user_data.ads.m4       \
144                   $(srcdir)/$(ABASE)-panels-user_data.ads.m4
145
146
147 all \
148 libs :  $(GEN_TARGETS)
149         @echo made $@
150
151 sources:
152
153 $(DESTDIR)$(bindir) :
154         mkdir -p $@
155
156 install \
157 install.libs :: $(DESTDIR)$(bindir) $(ADACURSES_CONFIG)
158         $(INSTALL_SCRIPT) $(ADACURSES_CONFIG) $(DESTDIR)$(bindir)/$(ADACURSES_CONFIG)
159
160 uninstall \
161 uninstall.libs ::
162         -rm -f $(DESTDIR)$(bindir)/$(ADACURSES_CONFIG)
163
164 $(PROG_GENERATE):  gen.o
165         @ECHO_LD@ $(LINK) $(CFLAGS_NORMAL) gen.o $(ACTUAL_LDFLAGS) -o $@
166
167 gen.o:  $(srcdir)/gen.c
168         $(HOST_CC) $(CFLAGS_NORMAL) -c -o $@ $(srcdir)/gen.c
169
170 $(ADA_SRCDIR)/$(ABASE)_constants.ads: $(PROG_GENERATE)
171         $(WRAPPER) "$(GENERATE) $@"
172 ################################################################################
173 $(ADA_SRCDIR)/$(ABASE).ads:     $(srcdir)/$(ABASE).ads.m4 \
174                                 $(srcdir)/normal.m4
175         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
176         $(srcdir)/$(ABASE).ads.m4 |\
177         $(DEL_ADAMODE) >$@
178
179 $(ADA_SRCDIR)/$(ABASE).adb:     $(srcdir)/$(ABASE).adb.m4 \
180                                 $(srcdir)/normal.m4
181         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
182         $(srcdir)/$(ABASE).adb.m4 |\
183         $(DEL_ADAMODE) >$@
184
185 $(ADA_SRCDIR)/$(ABASE)-aux.ads: $(srcdir)/$(ABASE)-aux.ads.m4 \
186                                 $(srcdir)/normal.m4
187         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
188         $(srcdir)/$(ABASE)-aux.ads.m4 |\
189         $(DEL_ADAMODE) >$@
190
191 $(ADA_SRCDIR)/$(ABASE)-trace.ads: $(srcdir)/$(ABASE)-trace.ads.m4 \
192                                   $(srcdir)/normal.m4
193         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
194         $(srcdir)/$(ABASE)-trace.ads.m4 |\
195         $(DEL_ADAMODE) >$@
196
197 $(ADA_SRCDIR)/$(ABASE)-menus.ads: $(srcdir)/$(ABASE)-menus.ads.m4 \
198                                   $(srcdir)/normal.m4
199         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
200         $(srcdir)/$(ABASE)-menus.ads.m4 |\
201         $(DEL_ADAMODE) >$@
202
203 $(ADA_SRCDIR)/$(ABASE)-forms.ads: $(srcdir)/$(ABASE)-forms.ads.m4 \
204                                   $(srcdir)/normal.m4
205         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
206         $(srcdir)/$(ABASE)-forms.ads.m4 |\
207         $(DEL_ADAMODE) >$@
208
209 $(ADA_SRCDIR)/$(ABASE)-mouse.ads: $(srcdir)/$(ABASE)-mouse.ads.m4 \
210                                   $(srcdir)/normal.m4
211         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
212         $(srcdir)/$(ABASE)-mouse.ads.m4 |\
213         $(DEL_ADAMODE) >$@
214
215 $(ADA_SRCDIR)/$(ABASE)-panels.ads: $(srcdir)/$(ABASE)-panels.ads.m4 \
216                                    $(srcdir)/normal.m4
217         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
218         $(srcdir)/$(ABASE)-panels.ads.m4 |\
219         $(DEL_ADAMODE) >$@
220
221 $(ADA_SRCDIR)/$(ABASE)-menus-menu_user_data.ads: \
222                 $(srcdir)/$(ABASE)-menus-menu_user_data.ads.m4 \
223                 $(srcdir)/normal.m4
224         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
225         $(srcdir)/$(ABASE)-menus-menu_user_data.ads.m4 |\
226         $(DEL_ADAMODE) >$@
227
228 $(ADA_SRCDIR)/$(ABASE)-menus-item_user_data.ads: \
229                 $(srcdir)/$(ABASE)-menus-item_user_data.ads.m4 \
230                 $(srcdir)/normal.m4
231         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
232         $(srcdir)/$(ABASE)-menus-item_user_data.ads.m4 |\
233         $(DEL_ADAMODE) >$@
234
235 $(ADA_SRCDIR)/$(ABASE)-forms-form_user_data.ads: \
236                 $(srcdir)/$(ABASE)-forms-form_user_data.ads.m4 \
237                 $(srcdir)/normal.m4
238         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
239         $(srcdir)/$(ABASE)-forms-form_user_data.ads.m4 |\
240         $(DEL_ADAMODE) >$@
241
242 $(ADA_SRCDIR)/$(ABASE)-forms-field_types.ads: \
243                 $(srcdir)/$(ABASE)-forms-field_types.ads.m4 \
244                 $(srcdir)/normal.m4
245         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
246         $(srcdir)/$(ABASE)-forms-field_types.ads.m4 |\
247         $(DEL_ADAMODE) >$@
248
249 $(ADA_SRCDIR)/$(ABASE)-forms-field_user_data.ads: \
250                 $(srcdir)/$(ABASE)-forms-field_user_data.ads.m4 \
251                 $(srcdir)/normal.m4
252         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
253         $(srcdir)/$(ABASE)-forms-field_user_data.ads.m4 |\
254         $(DEL_ADAMODE) >$@
255
256 $(ADA_SRCDIR)/$(ABASE)-panels-user_data.ads: \
257                 $(srcdir)/$(ABASE)-panels-user_data.ads.m4 \
258                 $(srcdir)/normal.m4
259         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
260         $(srcdir)/$(ABASE)-panels-user_data.ads.m4 |\
261         $(DEL_ADAMODE) >$@
262
263 install.progs ::
264
265 tags:
266         ctags *.[ch]
267
268 @MAKE_UPPER_TAGS@TAGS:
269 @MAKE_UPPER_TAGS@       etags *.[ch]
270
271 mostlyclean ::
272         -rm -f a.out core $(PROG_GENERATE) *.o
273
274 clean :: mostlyclean
275         -rm -f $(GEN_TARGETS) instab.tmp *.ad[bs] *.html *.ali *.tmp
276
277 distclean :: clean
278         -rm -f $(ADACURSES_CONFIG)
279         -rm -f Makefile
280
281 realclean :: distclean
282
283 HTML_DIR = @ADAHTML_DIR@
284
285 instab.tmp : table.m4 $(GEN_SRC)
286         @rm -f $@
287         @for f in $(GEN_SRC) ; do \
288           $(M4) $(M4FLAGS) -DM4MACRO=table.m4 $$f | $(DEL_ADAMODE) >> $@ ;\
289         done;
290
291 $(HTML_DIR)/table.html : instab.tmp
292         @-touch $@
293         @-chmod +w $@
294         @echo '<!DOCTYPE HTML'  > $@
295         @echo 'PUBLIC "-//IETF//DTD HTML 3.0//EN">' >> $@
296         @echo '<HTML>' >> $@
297         @echo '<HEAD>' >> $@
298         @echo '<TITLE>Correspondence between ncurses C and Ada functions</TITLE>' >>$@
299         @echo '</HEAD>' >> $@
300         @echo '<BODY>' >> $@
301         @echo '<H1>Correspondence between ncurses C and Ada functions</H1>' >>$@
302         @echo '<H2>Sorted by C function name</H2>' >>$@
303         @echo '<TABLE ALIGN=CENTER BORDER>' >>$@
304         @echo '<TR ALIGN=LEFT>' >>$@
305         @echo '<TH>C name</TH><TH>Ada name</TH><TH>man page</TH></TR>' >>$@
306         @sort < instab.tmp >> $@
307         @echo '</TABLE></BODY></HTML>' >>$@
308         @rm -f instab.tmp
309
310 adahtml:
311         test -n "$(GNATHTML)" || exit 1
312         @find $(HTML_DIR) -type f -exec rm -f {} \;
313         @mkdir -p $(HTML_DIR)
314         cp -p ../src/*.ad[sb] . && chmod +w *.ad[sb]
315 @USE_OLD_MAKERULES@     ln -sf ../src/*.ali .
316 @USE_GNAT_PROJECTS@     ln -sf ../static-ali/*.ali .
317         @echo "Filtering generated files"
318         @for f in $(GEN_SRC); do \
319            h=`basename $$f` ;\
320            g=`basename $$f .ads.m4` ;\
321            if test "$$g" != "$$h" ; then \
322               $(M4) $(M4FLAGS) -DM4MACRO=html.m4 $$f | $(DEL_ADAMODE) > $$g.ads ;\
323               echo "... $$g.ads" ;\
324            fi \
325         done
326         @-rm -f $(HTML_DIR)/$(ALIB)*.htm*
327         $(GNATHTML) -d -f $(ALIB)*.ads
328         for f in html/$(ALIB)*.htm*; do \
329            a=`basename $$f` ; \
330            sed -e 's/You may also.*body.*//' <$$f |\
331            sed -e 's%GNAT%<A HREF="http://$(GNATHP)">GNAT</A>%g' |\
332            sed -e 's%&lt;A HREF%<A HREF%g' |\
333            sed -e 's%"&gt;%">%g' |\
334            sed -e 's%#1A\([[:space:]]*NAME="[^"]*"\)#2%<A\1>%' |\
335            sed -e 's%#1/A#2%</A>%' |\
336            sed -e 's/3X/3x/g' |\
337            sed -e 's/$$\([ABCDEFGHIJKLMNOPQRSTUVWXZabcdefghijklmnopqrstuvwxz0123456789_]*:.*\)\$$/@\1@/' |\
338            sed -e 's%&lt;/A&gt;%</A>%g' > $$a.tmp ;\
339            mv $$a.tmp $$f ;\
340         done
341         @rm -f *.ad[sb] *.ali *.tmp
342         @for f in funcs.htm main.htm ; do \
343           sed -e "\%<A HREF=funcs/ .htm>\[ \]</A>%d" < html/$$f > $$f ;\
344           mv $$f html/$$f ;\
345         done
346         @rm -f "html/funcs/ .htm"
347         @cp -pdrf html/* $(HTML_DIR)/
348         @rm -rf html
349
350 html : adahtml $(HTML_DIR)/table.html
351         @echo made $@
352
353 ###############################################################################
354 # The remainder of this file is automatically generated during configuration
355 ###############################################################################