]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/gen/Makefile.in
ncurses 6.3 - patch 20221001
[ncurses.git] / Ada95 / gen / Makefile.in
1 ##############################################################################
2 # Copyright 2019-2021,2022 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.100 2022/01/15 18:20:17 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@ @EXTRA_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
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
147 @MAKE_PHONY@.PHONY :    all
148 @MAKE_PHONY@.PHONY :    clean
149 @MAKE_PHONY@.PHONY :    distclean
150 @MAKE_PHONY@.PHONY :    install
151 @MAKE_PHONY@.PHONY :    install.libs
152 @MAKE_PHONY@.PHONY :    libs
153 @MAKE_PHONY@.PHONY :    mostlyclean
154 @MAKE_PHONY@.PHONY :    realclean
155 @MAKE_PHONY@.PHONY :    sources
156 @MAKE_PHONY@.PHONY :    uninstall
157 @MAKE_PHONY@.PHONY :    uninstall.libs
158
159 all \
160 libs :  $(GEN_TARGETS)
161         @echo made $@
162
163 sources:
164
165 $(DESTDIR)$(bindir) :
166         mkdir -p $@
167
168 install \
169 install.libs :: $(DESTDIR)$(bindir) $(ADACURSES_CONFIG)
170         $(INSTALL_SCRIPT) $(ADACURSES_CONFIG) $(DESTDIR)$(bindir)/$(ADACURSES_CONFIG)
171
172 uninstall \
173 uninstall.libs ::
174         -rm -f $(DESTDIR)$(bindir)/$(ADACURSES_CONFIG)
175
176 $(PROG_GENERATE):  gen.o
177         @ECHO_LD@ $(LINK) $(CFLAGS_NORMAL) gen.o $(ACTUAL_LDFLAGS) -o $@
178
179 gen.o:  $(srcdir)/gen.c
180         $(HOST_CC) $(CFLAGS_NORMAL) -c -o $@ $(srcdir)/gen.c
181
182 $(ADA_SRCDIR)/$(ABASE)_constants.ads: $(PROG_GENERATE)
183         $(WRAPPER) "$(GENERATE) $@"
184 ################################################################################
185 $(ADA_SRCDIR)/$(ABASE).ads:     $(srcdir)/$(ABASE).ads.m4 \
186                                 $(srcdir)/normal.m4
187         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
188         $(srcdir)/$(ABASE).ads.m4 |\
189         $(DEL_ADAMODE) >$@
190
191 $(ADA_SRCDIR)/$(ABASE).adb:     $(srcdir)/$(ABASE).adb.m4 \
192                                 $(srcdir)/normal.m4
193         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
194         $(srcdir)/$(ABASE).adb.m4 |\
195         $(DEL_ADAMODE) >$@
196
197 $(ADA_SRCDIR)/$(ABASE)-aux.ads: $(srcdir)/$(ABASE)-aux.ads.m4 \
198                                 $(srcdir)/normal.m4
199         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
200         $(srcdir)/$(ABASE)-aux.ads.m4 |\
201         $(DEL_ADAMODE) >$@
202
203 $(ADA_SRCDIR)/$(ABASE)-trace.ads: $(srcdir)/$(ABASE)-trace.ads.m4 \
204                                   $(srcdir)/normal.m4
205         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
206         $(srcdir)/$(ABASE)-trace.ads.m4 |\
207         $(DEL_ADAMODE) >$@
208
209 $(ADA_SRCDIR)/$(ABASE)-menus.ads: $(srcdir)/$(ABASE)-menus.ads.m4 \
210                                   $(srcdir)/normal.m4
211         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
212         $(srcdir)/$(ABASE)-menus.ads.m4 |\
213         $(DEL_ADAMODE) >$@
214
215 $(ADA_SRCDIR)/$(ABASE)-forms.ads: $(srcdir)/$(ABASE)-forms.ads.m4 \
216                                   $(srcdir)/normal.m4
217         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
218         $(srcdir)/$(ABASE)-forms.ads.m4 |\
219         $(DEL_ADAMODE) >$@
220
221 $(ADA_SRCDIR)/$(ABASE)-mouse.ads: $(srcdir)/$(ABASE)-mouse.ads.m4 \
222                                   $(srcdir)/normal.m4
223         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
224         $(srcdir)/$(ABASE)-mouse.ads.m4 |\
225         $(DEL_ADAMODE) >$@
226
227 $(ADA_SRCDIR)/$(ABASE)-panels.ads: $(srcdir)/$(ABASE)-panels.ads.m4 \
228                                    $(srcdir)/normal.m4
229         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
230         $(srcdir)/$(ABASE)-panels.ads.m4 |\
231         $(DEL_ADAMODE) >$@
232
233 $(ADA_SRCDIR)/$(ABASE)-menus-menu_user_data.ads: \
234                 $(srcdir)/$(ABASE)-menus-menu_user_data.ads.m4 \
235                 $(srcdir)/normal.m4
236         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
237         $(srcdir)/$(ABASE)-menus-menu_user_data.ads.m4 |\
238         $(DEL_ADAMODE) >$@
239
240 $(ADA_SRCDIR)/$(ABASE)-menus-item_user_data.ads: \
241                 $(srcdir)/$(ABASE)-menus-item_user_data.ads.m4 \
242                 $(srcdir)/normal.m4
243         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
244         $(srcdir)/$(ABASE)-menus-item_user_data.ads.m4 |\
245         $(DEL_ADAMODE) >$@
246
247 $(ADA_SRCDIR)/$(ABASE)-forms-form_user_data.ads: \
248                 $(srcdir)/$(ABASE)-forms-form_user_data.ads.m4 \
249                 $(srcdir)/normal.m4
250         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
251         $(srcdir)/$(ABASE)-forms-form_user_data.ads.m4 |\
252         $(DEL_ADAMODE) >$@
253
254 $(ADA_SRCDIR)/$(ABASE)-forms-field_types.ads: \
255                 $(srcdir)/$(ABASE)-forms-field_types.ads.m4 \
256                 $(srcdir)/normal.m4
257         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
258         $(srcdir)/$(ABASE)-forms-field_types.ads.m4 |\
259         $(DEL_ADAMODE) >$@
260
261 $(ADA_SRCDIR)/$(ABASE)-forms-field_user_data.ads: \
262                 $(srcdir)/$(ABASE)-forms-field_user_data.ads.m4 \
263                 $(srcdir)/normal.m4
264         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
265         $(srcdir)/$(ABASE)-forms-field_user_data.ads.m4 |\
266         $(DEL_ADAMODE) >$@
267
268 $(ADA_SRCDIR)/$(ABASE)-panels-user_data.ads: \
269                 $(srcdir)/$(ABASE)-panels-user_data.ads.m4 \
270                 $(srcdir)/normal.m4
271         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
272         $(srcdir)/$(ABASE)-panels-user_data.ads.m4 |\
273         $(DEL_ADAMODE) >$@
274
275 install.progs ::
276
277 tags:
278         ctags *.[ch]
279
280 @MAKE_UPPER_TAGS@TAGS:
281 @MAKE_UPPER_TAGS@       etags *.[ch]
282
283 mostlyclean ::
284         -rm -f a.out core $(PROG_GENERATE) *.o
285
286 clean :: mostlyclean
287         -rm -f $(GEN_TARGETS) instab.tmp *.ad[bs] *.html *.ali *.tmp
288
289 distclean :: clean
290         -rm -f $(ADACURSES_CONFIG)
291         -rm -f Makefile
292
293 realclean :: distclean
294
295 HTML_DIR = @ADAHTML_DIR@
296
297 instab.tmp : table.m4 $(GEN_SRC)
298         @rm -f $@
299         @for f in $(GEN_SRC) ; do \
300           $(M4) $(M4FLAGS) -DM4MACRO=table.m4 $$f | $(DEL_ADAMODE) >> $@ ;\
301         done;
302
303 TABLE_TITLE=Correspondence between ncurses C and Ada functions
304
305 $(HTML_DIR)/table.html : instab.tmp
306         @-touch $@
307         @-chmod +w $@
308         @echo '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">' > $@
309         @echo '<html>' >> $@
310         @echo '<head>' >> $@
311         @echo '<title>$(TABLE_TITLE)</title>' >>$@
312         @echo '</head>' >> $@
313         @echo '<body>' >> $@
314         @echo '<h1>$(TABLE_TITLE)</h1>' >>$@
315         @echo '<h2>Sorted by C function name</h2>' >>$@
316         @echo '<table align="center" border summary="$(TABLE_TITLE)">' >>$@
317         @echo '<tr align="left">' >>$@
318         @echo '<th>C name</th><th>Ada name</th><th>man page</th></tr>' >>$@
319         @sort < instab.tmp >> $@
320         @echo '</table></body></html>' >>$@
321         @rm -f instab.tmp
322
323 adahtml:
324         test -n "$(GNATHTML)" || exit 1
325         @find $(HTML_DIR) -type f -exec rm -f {} \;
326         @mkdir -p $(HTML_DIR)
327         ( cp -p ../src/*.ad[sb] . && chmod +w *.ad[sb] )
328 @USE_OLD_MAKERULES@     ln -sf ../src/*.ali .
329 @USE_GNAT_PROJECTS@     ln -sf ../static-ali/*.ali .
330         @echo "Filtering generated files"
331         @for f in $(GEN_SRC); do \
332            h=`basename $$f` ;\
333            g=`basename $$f .ads.m4` ;\
334            if test "$$g" != "$$h" ; then \
335               $(M4) $(M4FLAGS) -DM4MACRO=html.m4 $$f | $(DEL_ADAMODE) > $$g.ads ;\
336               echo "... $$g.ads" ;\
337            fi \
338         done
339         @-rm -f $(HTML_DIR)/$(ALIB)*.htm*
340         $(GNATHTML) -d -f $(ALIB)*.ads
341         for f in html/$(ALIB)*.htm*; do \
342            a=`basename $$f` ; \
343            sed -e 's/You may also.*body.*//' <$$f |\
344            sed -e 's%\<GNAT\>%<strong>GNAT</strong>%g' |\
345            sed -e 's%&lt;A HREF%<A HREF%g' |\
346            sed -e 's%"&gt;%">%g' |\
347            sed -e 's%#1A\([[:space:]]*NAME="[^"]*"\)#2%<A\1>%' |\
348            sed -e 's%#1/A#2%</A>%' |\
349            sed -e 's/3X/3x/g' |\
350            sed -e 's/$$\([ABCDEFGHIJKLMNOPQRSTUVWXZabcdefghijklmnopqrstuvwxz0123456789_]*:.*\)\$$/@\1@/' |\
351            sed -e 's%&lt;/A&gt;%</A>%g' > $$a.tmp ;\
352            mv $$a.tmp $$f ;\
353         done
354         @rm -f *.ad[sb] *.ali *.tmp
355         @for f in funcs.htm main.htm ; do \
356           sed -e "\%<A HREF=funcs/ .htm>\[ \]</A>%d" < html/$$f > $$f ;\
357           mv $$f html/$$f ;\
358         done
359         @rm -f "html/funcs/ .htm"
360         @cp -pdrf html/* $(HTML_DIR)/
361         @rm -rf html
362
363 html : adahtml $(HTML_DIR)/table.html
364         @echo made $@
365
366 ###############################################################################
367 # The remainder of this file is automatically generated during configuration
368 ###############################################################################