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