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