ncurses 5.9 - patch 20150530
[ncurses.git] / Ada95 / gen / Makefile.in
1 ##############################################################################
2 # Copyright (c) 1998-2014,2015 Free Software Foundation, Inc.                #
3 #                                                                            #
4 # Permission is hereby granted, free of charge, to any person obtaining a    #
5 # copy of this software and associated documentation files (the "Software"), #
6 # to deal in the Software without restriction, including without limitation  #
7 # the rights to use, copy, modify, merge, publish, distribute, distribute    #
8 # with modifications, sublicense, and/or sell copies of the Software, and to #
9 # permit persons to whom the Software is furnished to do so, subject to the  #
10 # following conditions:                                                      #
11 #                                                                            #
12 # The above copyright notice and this permission notice shall be included in #
13 # all copies or substantial portions of the Software.                        #
14 #                                                                            #
15 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
16 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,   #
17 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL    #
18 # THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER      #
19 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING    #
20 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER        #
21 # DEALINGS IN THE SOFTWARE.                                                  #
22 #                                                                            #
23 # Except as contained in this notice, the name(s) of the above copyright     #
24 # holders shall not be used in advertising or otherwise to promote the sale, #
25 # use or other dealings in this Software without prior written               #
26 # authorization.                                                             #
27 ##############################################################################
28 #
29 #  Author:  Juergen Pfeifer, 1996
30 #
31 #  $Id: Makefile.in,v 1.83 2015/04/26 15:49:35 tom Exp $
32 #
33 .SUFFIXES:
34
35 SHELL           = /bin/sh
36 VPATH           = @srcdir@
37 THIS            = Makefile
38
39 x               = @EXEEXT@
40
41 top_srcdir      = @top_srcdir@
42 DESTDIR         = @DESTDIR@
43 srcdir          = @srcdir@
44 prefix          = @prefix@
45 exec_prefix     = @exec_prefix@
46 bindir          = @bindir@
47 includedir      = @includedir@
48
49 INSTALL         = @INSTALL@
50 INSTALL_PROG    = @INSTALL_PROGRAM@
51 INSTALL_DATA    = @INSTALL_DATA@
52
53 AWK             = @AWK@
54 LN_S            = @LN_S@
55
56 CC              = @CC@
57 HOST_CC         = @BUILD_CC@
58
59 CFLAGS          = @CFLAGS@
60 HOST_CFLAGS     = @BUILD_CFLAGS@
61
62 CPPFLAGS        = @CPPFLAGS@
63 HOST_CPPFLAGS   = @ACPPFLAGS@ @BUILD_CPPFLAGS@ \
64                   -DHAVE_CONFIG_H -I$(srcdir)
65
66 CCFLAGS         = $(HOST_CPPFLAGS) $(HOST_CFLAGS)
67 CFLAGS_NORMAL   = $(CCFLAGS)
68 CFLAGS_DEBUG    = $(CCFLAGS) @CC_G_OPT@ -DTRACE
69 CFLAGS_PROFILE  = $(CCFLAGS) -pg
70 CFLAGS_SHARED   = $(CCFLAGS) @CC_SHARED_OPTS@
71
72 CFLAGS_DEFAULT  = $(CFLAGS_@DFT_UPR_MODEL@)
73
74 REL_VERSION     = @cf_cv_rel_version@
75 ABI_VERSION     = @cf_cv_abi_version@
76 LOCAL_LIBDIR    = @top_builddir@/lib
77
78 LINK            = $(HOST_CC)
79
80 LDFLAGS         = @LDFLAGS@
81 HOST_LDFLAGS    = @BUILD_LDFLAGS@
82
83 LIBS            = @LIBS@
84 HOST_LIBS       = @BUILD_LIBS@
85
86 RANLIB          = @RANLIB@
87
88 M4              = m4
89 M4FLAGS         = -DNCURSES_EXT_FUNCS=@NCURSES_EXT_FUNCS@
90
91 ADACURSES_CONFIG = adacurses@USE_CFG_SUFFIX@-config
92
93 WRAPPER         = @NCURSES_SHLIB2@
94
95 PROG_GENERATE   = ./generate$x
96 GENERATE        = $(PROG_GENERATE) '@DFT_ARG_SUFFIX@'
97 DEL_ADAMODE     = sed -e '/^\-\-\ \ \-\*\-\ ada\ \-\*\-.*/d'
98
99 GNATHTML        = `type -p gnathtml || type -p gnathtml.pl 2>/dev/null`
100 GNATHP          = www.gnat.com
101
102 ################################################################################
103 ALIB            = @cf_ada_package@
104 ABASE           = $(ALIB)-curses
105
106 ADA_SRCDIR      = ../src
107
108 GEN_TARGETS     = $(ADA_SRCDIR)/$(ABASE).ads                            \
109                   $(ADA_SRCDIR)/$(ABASE).adb                            \
110                   $(ADA_SRCDIR)/$(ABASE)-aux.ads                        \
111                   $(ADA_SRCDIR)/$(ABASE)-trace.ads                      \
112                   $(ADA_SRCDIR)/$(ABASE)-menus.ads                      \
113                   $(ADA_SRCDIR)/$(ABASE)-forms.ads                      \
114                   $(ADA_SRCDIR)/$(ABASE)-mouse.ads                      \
115                   $(ADA_SRCDIR)/$(ABASE)-panels.ads                     \
116                   $(ADA_SRCDIR)/$(ABASE)-menus-menu_user_data.ads       \
117                   $(ADA_SRCDIR)/$(ABASE)-menus-item_user_data.ads       \
118                   $(ADA_SRCDIR)/$(ABASE)-forms-form_user_data.ads       \
119                   $(ADA_SRCDIR)/$(ABASE)-forms-field_types.ads          \
120                   $(ADA_SRCDIR)/$(ABASE)-forms-field_user_data.ads      \
121                   $(ADA_SRCDIR)/$(ABASE)-panels-user_data.ads           \
122                   $(ADA_SRCDIR)/$(ABASE)_constants.ads
123
124 GEN_SRC         = $(srcdir)/$(ABASE).ads.m4                             \
125                   $(srcdir)/$(ABASE).adb.m4                             \
126                   $(srcdir)/$(ABASE)-aux.ads.m4                         \
127                   $(srcdir)/$(ABASE)-trace.ads.m4                       \
128                   $(srcdir)/$(ABASE)-menus.ads.m4                       \
129                   $(srcdir)/$(ABASE)-forms.ads.m4                       \
130                   $(srcdir)/$(ABASE)-mouse.ads.m4                       \
131                   $(srcdir)/$(ABASE)-panels.ads.m4                      \
132                   $(srcdir)/$(ABASE)-menus-menu_user_data.ads.m4        \
133                   $(srcdir)/$(ABASE)-menus-item_user_data.ads.m4        \
134                   $(srcdir)/$(ABASE)-forms-form_user_data.ads.m4        \
135                   $(srcdir)/$(ABASE)-forms-field_types.ads.m4           \
136                   $(srcdir)/$(ABASE)-forms-field_user_data.ads.m4       \
137                   $(srcdir)/$(ABASE)-panels-user_data.ads.m4
138
139
140 all \
141 libs :  $(GEN_TARGETS)
142         @echo made $@
143
144 sources:
145
146 $(DESTDIR)$(bindir) :
147         mkdir -p $@
148
149 install \
150 install.libs :: $(DESTDIR)$(bindir) $(ADACURSES_CONFIG)
151         $(INSTALL_PROG) $(ADACURSES_CONFIG) $(DESTDIR)$(bindir)/$(ADACURSES_CONFIG)
152
153 uninstall \
154 uninstall.libs ::
155         -rm -f $(DESTDIR)$(bindir)/$(ADACURSES_CONFIG)
156
157 $(PROG_GENERATE):  gen.o
158         @ECHO_LD@ $(LINK) $(CFLAGS_NORMAL) gen.o $(HOST_LDFLAGS) $(HOST_LIBS) -o $@
159
160 gen.o:  $(srcdir)/gen.c
161         $(HOST_CC) $(CFLAGS_NORMAL) -c -o $@ $(srcdir)/gen.c
162
163 $(ADA_SRCDIR)/$(ABASE)_constants.ads: $(PROG_GENERATE)
164         $(WRAPPER) "$(GENERATE)" >$@
165 ################################################################################
166 $(ADA_SRCDIR)/$(ABASE).ads:     $(srcdir)/$(ABASE).ads.m4 \
167                                 $(srcdir)/normal.m4
168         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
169         $(srcdir)/$(ABASE).ads.m4 |\
170         $(DEL_ADAMODE) >$@
171
172 $(ADA_SRCDIR)/$(ABASE).adb:     $(srcdir)/$(ABASE).adb.m4 \
173                                 $(srcdir)/normal.m4
174         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
175         $(srcdir)/$(ABASE).adb.m4 |\
176         $(DEL_ADAMODE) >$@
177
178 $(ADA_SRCDIR)/$(ABASE)-aux.ads: $(srcdir)/$(ABASE)-aux.ads.m4 \
179                                 $(srcdir)/normal.m4
180         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
181         $(srcdir)/$(ABASE)-aux.ads.m4 |\
182         $(DEL_ADAMODE) >$@
183
184 $(ADA_SRCDIR)/$(ABASE)-trace.ads: $(srcdir)/$(ABASE)-trace.ads.m4 \
185                                   $(srcdir)/normal.m4
186         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
187         $(srcdir)/$(ABASE)-trace.ads.m4 |\
188         $(DEL_ADAMODE) >$@
189
190 $(ADA_SRCDIR)/$(ABASE)-menus.ads: $(srcdir)/$(ABASE)-menus.ads.m4 \
191                                   $(srcdir)/normal.m4
192         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
193         $(srcdir)/$(ABASE)-menus.ads.m4 |\
194         $(DEL_ADAMODE) >$@
195
196 $(ADA_SRCDIR)/$(ABASE)-forms.ads: $(srcdir)/$(ABASE)-forms.ads.m4 \
197                                   $(srcdir)/normal.m4
198         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
199         $(srcdir)/$(ABASE)-forms.ads.m4 |\
200         $(DEL_ADAMODE) >$@
201
202 $(ADA_SRCDIR)/$(ABASE)-mouse.ads: $(srcdir)/$(ABASE)-mouse.ads.m4 \
203                                   $(srcdir)/normal.m4
204         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
205         $(srcdir)/$(ABASE)-mouse.ads.m4 |\
206         $(DEL_ADAMODE) >$@
207
208 $(ADA_SRCDIR)/$(ABASE)-panels.ads: $(srcdir)/$(ABASE)-panels.ads.m4 \
209                                    $(srcdir)/normal.m4
210         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
211         $(srcdir)/$(ABASE)-panels.ads.m4 |\
212         $(DEL_ADAMODE) >$@
213
214 $(ADA_SRCDIR)/$(ABASE)-menus-menu_user_data.ads: \
215                 $(srcdir)/$(ABASE)-menus-menu_user_data.ads.m4 \
216                 $(srcdir)/normal.m4
217         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
218         $(srcdir)/$(ABASE)-menus-menu_user_data.ads.m4 |\
219         $(DEL_ADAMODE) >$@
220
221 $(ADA_SRCDIR)/$(ABASE)-menus-item_user_data.ads: \
222                 $(srcdir)/$(ABASE)-menus-item_user_data.ads.m4 \
223                 $(srcdir)/normal.m4
224         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
225         $(srcdir)/$(ABASE)-menus-item_user_data.ads.m4 |\
226         $(DEL_ADAMODE) >$@
227
228 $(ADA_SRCDIR)/$(ABASE)-forms-form_user_data.ads: \
229                 $(srcdir)/$(ABASE)-forms-form_user_data.ads.m4 \
230                 $(srcdir)/normal.m4
231         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
232         $(srcdir)/$(ABASE)-forms-form_user_data.ads.m4 |\
233         $(DEL_ADAMODE) >$@
234
235 $(ADA_SRCDIR)/$(ABASE)-forms-field_types.ads: \
236                 $(srcdir)/$(ABASE)-forms-field_types.ads.m4 \
237                 $(srcdir)/normal.m4
238         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
239         $(srcdir)/$(ABASE)-forms-field_types.ads.m4 |\
240         $(DEL_ADAMODE) >$@
241
242 $(ADA_SRCDIR)/$(ABASE)-forms-field_user_data.ads: \
243                 $(srcdir)/$(ABASE)-forms-field_user_data.ads.m4 \
244                 $(srcdir)/normal.m4
245         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
246         $(srcdir)/$(ABASE)-forms-field_user_data.ads.m4 |\
247         $(DEL_ADAMODE) >$@
248
249 $(ADA_SRCDIR)/$(ABASE)-panels-user_data.ads: \
250                 $(srcdir)/$(ABASE)-panels-user_data.ads.m4 \
251                 $(srcdir)/normal.m4
252         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
253         $(srcdir)/$(ABASE)-panels-user_data.ads.m4 |\
254         $(DEL_ADAMODE) >$@
255
256 install.progs ::
257
258 tags:
259         ctags *.[ch]
260
261 @MAKE_UPPER_TAGS@TAGS:
262 @MAKE_UPPER_TAGS@       etags *.[ch]
263
264 mostlyclean ::
265         -rm -f a.out core $(PROG_GENERATE) *.o
266
267 clean :: mostlyclean
268         -rm -f $(GEN_TARGETS) instab.tmp *.ad[bs] *.html *.ali *.tmp
269
270 distclean :: clean
271         -rm -f $(ADACURSES_CONFIG)
272         -rm -f Makefile
273
274 realclean :: distclean
275
276 HTML_DIR = @ADAHTML_DIR@
277
278 instab.tmp : table.m4 $(GEN_SRC)
279         @rm -f $@
280         @for f in $(GEN_SRC) ; do \
281           $(M4) $(M4FLAGS) -DM4MACRO=table.m4 $$f | $(DEL_ADAMODE) >> $@ ;\
282         done;
283
284 $(HTML_DIR)/table.html : instab.tmp
285         @-touch $@
286         @-chmod +w $@
287         @echo '<!DOCTYPE HTML'  > $@
288         @echo 'PUBLIC "-//IETF//DTD HTML 3.0//EN">' >> $@
289         @echo '<HTML>' >> $@
290         @echo '<HEAD>' >> $@
291         @echo '<TITLE>Correspondence between ncurses C and Ada functions</TITLE>' >>$@
292         @echo '</HEAD>' >> $@
293         @echo '<BODY>' >> $@
294         @echo '<H1>Correspondence between ncurses C and Ada functions</H1>' >>$@
295         @echo '<H2>Sorted by C function name</H2>' >>$@
296         @echo '<TABLE ALIGN=CENTER BORDER>' >>$@
297         @echo '<TR ALIGN=LEFT>' >>$@
298         @echo '<TH>C name</TH><TH>Ada name</TH><TH>man page</TH></TR>' >>$@
299         @sort < instab.tmp >> $@
300         @echo '</TABLE></BODY></HTML>' >>$@
301         @rm -f instab.tmp
302
303 adahtml:
304         test -n "$(GNATHTML)" || exit 1
305         @find $(HTML_DIR) -type f -exec rm -f {} \;
306         @mkdir -p $(HTML_DIR)
307         cp -p ../src/*.ad[sb] . && chmod +w *.ad[sb]
308 @USE_OLD_MAKERULES@     ln -sf ../src/*.ali .
309 @USE_GNAT_PROJECTS@     ln -sf ../static-ali/*.ali .
310         @echo "Filtering generated files"
311         @for f in $(GEN_SRC); do \
312            h=`basename $$f` ;\
313            g=`basename $$f .ads.m4` ;\
314            if test "$$g" != "$$h" ; then \
315               $(M4) $(M4FLAGS) -DM4MACRO=html.m4 $$f | $(DEL_ADAMODE) > $$g.ads ;\
316               echo "... $$g.ads" ;\
317            fi \
318         done
319         @-rm -f $(HTML_DIR)/$(ALIB)*.htm*
320         $(GNATHTML) -d -f $(ALIB)*.ads
321         for f in html/$(ALIB)*.htm*; do \
322            a=`basename $$f` ; \
323            sed -e 's/You may also.*body.*//' <$$f |\
324            sed -e 's%GNAT%<A HREF="http://$(GNATHP)">GNAT</A>%g' |\
325            sed -e 's%&lt;A HREF%<A HREF%g' |\
326            sed -e 's%"&gt;%">%g' |\
327            sed -e 's/3X/3x/g' |\
328            sed -e 's/$$\([ABCDEFGHIJKLMNOPQRSTUVWXZabcdefghijklmnopqrstuvwxz0123456789_]*:.*\)\$$/@\1@/' |\
329            sed -e 's%&lt;/A&gt;%</A>%g' > $$a.tmp ;\
330            mv $$a.tmp $$f ;\
331         done
332         @rm -f *.ad[sb] *.ali *.tmp
333         @for f in funcs.htm main.htm ; do \
334           sed -e "\%<A HREF=funcs/ .htm>\[ \]</A>%d" < html/$$f > $$f ;\
335           mv $$f html/$$f ;\
336         done
337         @rm -f "html/funcs/ .htm"
338         @cp -pdrf html/* $(HTML_DIR)/
339         @rm -rf html
340
341 html : adahtml $(HTML_DIR)/table.html
342         @echo made $@
343
344 ###############################################################################
345 # The remainder of this file is automatically generated during configuration
346 ###############################################################################