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