ncurses 5.7 - patch 20100717
[ncurses.git] / Ada95 / gen / Makefile.in
1 ##############################################################################
2 # Copyright (c) 1998-2009,2010 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.68 2010/07/17 19:56:15 tom Exp $
32 #
33 .SUFFIXES:
34
35 SHELL           = /bin/sh
36 THIS            = Makefile
37
38 x               = @PROG_EXT@
39
40 top_srcdir      = @top_srcdir@
41 DESTDIR         = @DESTDIR@
42 srcdir          = @srcdir@
43 prefix          = @prefix@
44 exec_prefix     = @exec_prefix@
45 bindir          = @bindir@
46 includedir      = @includedir@
47
48 INSTALL         = @INSTALL@
49 INSTALL_PROG    = @INSTALL_PROGRAM@
50 INSTALL_DATA    = @INSTALL_DATA@
51
52 AWK             = @AWK@
53 LN_S            = @LN_S@
54
55 CC              = @CC@
56 HOST_CC         = @BUILD_CC@
57 CFLAGS          = @CFLAGS@
58
59 CPPFLAGS        = @ACPPFLAGS@ \
60                   -DHAVE_CONFIG_H -I$(srcdir)
61
62 CCFLAGS         = $(CPPFLAGS) $(CFLAGS)
63 CFLAGS_NORMAL   = $(CCFLAGS)
64 CFLAGS_DEBUG    = $(CCFLAGS) @CC_G_OPT@ -DTRACE
65 CFLAGS_PROFILE  = $(CCFLAGS) -pg
66 CFLAGS_SHARED   = $(CCFLAGS) @CC_SHARED_OPTS@
67
68 CFLAGS_DEFAULT  = $(CFLAGS_@DFT_UPR_MODEL@)
69
70 REL_VERSION     = @cf_cv_rel_version@
71 ABI_VERSION     = @cf_cv_abi_version@
72 LOCAL_LIBDIR    = @top_builddir@/lib
73
74 LINK            = $(HOST_CC)
75 LD_FLAGS        = @LD_MODEL@ $(LOCAL_LIBS) @LDFLAGS@ @LIBS@ @LOCAL_LDFLAGS2@ $(LDFLAGS) @TINFO_ARGS2@
76
77 RANLIB          = @RANLIB@
78
79 M4              = m4
80 M4FLAGS         = -DNCURSES_EXT_FUNCS=@NCURSES_EXT_FUNCS@
81
82 ADACURSES_CONFIG = adacurses@DFT_ARG_SUFFIX@-config
83
84 WRAPPER         = @NCURSES_SHLIB2@
85
86 PROG_GENERATE   = ./generate$x
87 GENERATE        = $(PROG_GENERATE) '@DFT_ARG_SUFFIX@'
88 DEL_ADAMODE     = sed -e '/^\-\-\ \ \-\*\-\ ada\ \-\*\-.*/d'
89
90 GNATHTML        = `type -p gnathtml || type -p gnathtml.pl`
91 GNATHP          = www.gnat.com
92
93 ################################################################################
94 ALIB            = @cf_ada_package@
95 ABASE           = $(ALIB)-curses
96
97 ADA_SRCDIR      = ../src
98
99 GEN_FILES0      = Base_Defs
100
101 GEN_FILES1      = ACS_Map                               \
102                   AC_Rep                                \
103                   Base_Defs                             \
104                   Character_Attribute_Set_Rep           \
105                   Color_Defs                            \
106                   Key_Definitions                       \
107                   Linker_Options                        \
108                   Old_Keys                              \
109                   Public_Variables                      \
110                   Trace_Defs                            \
111                   Version_Info                          \
112                   Window_Offsets
113
114 GEN_FILES2      = Menu_Opt_Rep                          \
115                   Menu_Base_Defs                        \
116                   Menu_Linker_Options                   \
117                   Item_Rep
118
119 GEN_FILES3      = Form_Opt_Rep                          \
120                   Form_Base_Defs                        \
121                   Form_Linker_Options                   \
122                   Field_Rep
123
124 GEN_FILES4      = Mouse_Base_Defs                       \
125                   Mouse_Event_Rep                       \
126                   Mouse_Events                          \
127                   Panel_Linker_Options
128
129 GEN_FILES5      = Chtype_Def                            \
130                   Eti_Defs
131
132 GEN_TARGETS     = $(ADA_SRCDIR)/$(ABASE).ads                            \
133                   $(ADA_SRCDIR)/$(ABASE).adb                            \
134                   $(ADA_SRCDIR)/$(ABASE)-aux.ads                        \
135                   $(ADA_SRCDIR)/$(ABASE)-trace.ads                      \
136                   $(ADA_SRCDIR)/$(ABASE)-menus.ads                      \
137                   $(ADA_SRCDIR)/$(ABASE)-forms.ads                      \
138                   $(ADA_SRCDIR)/$(ABASE)-mouse.ads                      \
139                   $(ADA_SRCDIR)/$(ABASE)-panels.ads                     \
140                   $(ADA_SRCDIR)/$(ABASE)-menus-menu_user_data.ads       \
141                   $(ADA_SRCDIR)/$(ABASE)-menus-item_user_data.ads       \
142                   $(ADA_SRCDIR)/$(ABASE)-forms-form_user_data.ads       \
143                   $(ADA_SRCDIR)/$(ABASE)-forms-field_types.ads          \
144                   $(ADA_SRCDIR)/$(ABASE)-forms-field_user_data.ads      \
145                   $(ADA_SRCDIR)/$(ABASE)-panels-user_data.ads
146
147 GEN_SRC         = $(srcdir)/$(ABASE).ads.m4                             \
148                   $(srcdir)/$(ABASE).adb.m4                             \
149                   $(srcdir)/$(ABASE)-aux.ads.m4                         \
150                   $(srcdir)/$(ABASE)-trace.ads.m4                       \
151                   $(srcdir)/$(ABASE)-menus.ads.m4                       \
152                   $(srcdir)/$(ABASE)-forms.ads.m4                       \
153                   $(srcdir)/$(ABASE)-mouse.ads.m4                       \
154                   $(srcdir)/$(ABASE)-panels.ads.m4                      \
155                   $(srcdir)/$(ABASE)-menus-menu_user_data.ads.m4        \
156                   $(srcdir)/$(ABASE)-menus-item_user_data.ads.m4        \
157                   $(srcdir)/$(ABASE)-forms-form_user_data.ads.m4        \
158                   $(srcdir)/$(ABASE)-forms-field_types.ads.m4           \
159                   $(srcdir)/$(ABASE)-forms-field_user_data.ads.m4       \
160                   $(srcdir)/$(ABASE)-panels-user_data.ads.m4
161
162
163 all \
164 libs :  $(GEN_TARGETS)
165         @echo made $@
166
167 sources:
168
169 $(DESTDIR)$(bindir) :
170         mkdir -p $@
171
172 install \
173 install.libs :: $(DESTDIR)$(bindir) $(ADACURSES_CONFIG)
174         $(INSTALL_PROG) $(ADACURSES_CONFIG) $(DESTDIR)$(bindir)/$(ADACURSES_CONFIG)
175
176 uninstall \
177 uninstall.libs ::
178         -rm -f $(DESTDIR)$(bindir)/$(ADACURSES_CONFIG)
179
180 $(PROG_GENERATE):  gen.o
181         @ECHO_LINK@ $(LINK) $(CFLAGS_NORMAL) gen.o $(LD_FLAGS) -o $@
182
183 gen.o:  $(srcdir)/gen.c
184         $(HOST_CC) $(CFLAGS_NORMAL) -c -o $@ $(srcdir)/gen.c
185 ################################################################################
186 Character_Attribute_Set_Rep: $(PROG_GENERATE)
187         $(WRAPPER) "$(GENERATE) B A" >$@
188
189 Base_Defs: $(PROG_GENERATE)
190         $(WRAPPER) "$(GENERATE) B B" >$@
191
192 Color_Defs: $(PROG_GENERATE)
193         $(WRAPPER) "$(GENERATE) B C" >$@
194
195 Window_Offsets: $(PROG_GENERATE)
196         $(WRAPPER) "$(GENERATE) B D" >$@
197
198 Key_Definitions: $(PROG_GENERATE)
199         $(WRAPPER) "$(GENERATE) B K" >$@
200
201 Linker_Options: $(PROG_GENERATE)
202         $(WRAPPER) "$(GENERATE) B L" >$@
203
204 ACS_Map: $(PROG_GENERATE)
205         $(WRAPPER) "$(GENERATE) B M" >$@
206
207 Old_Keys: $(PROG_GENERATE)
208         $(WRAPPER) "$(GENERATE) B O" >$@
209
210 Public_Variables: $(PROG_GENERATE)
211         $(WRAPPER) "$(GENERATE) B P" >$@
212
213 AC_Rep: $(PROG_GENERATE)
214         $(WRAPPER) "$(GENERATE) B R" >$@
215
216 Version_Info: $(PROG_GENERATE)
217         $(WRAPPER) "$(GENERATE) B V" >$@
218
219 Trace_Defs: $(PROG_GENERATE)
220         $(WRAPPER) "$(GENERATE) B T" >$@
221 ################################################################################
222 Menu_Opt_Rep: $(PROG_GENERATE)
223         $(WRAPPER) "$(GENERATE) M R" >$@
224
225 Menu_Base_Defs: $(PROG_GENERATE)
226         $(WRAPPER) "$(GENERATE) M B" >$@
227
228 Menu_Linker_Options: $(PROG_GENERATE)
229         $(WRAPPER) "$(GENERATE) M L" >$@
230
231 Item_Rep: $(PROG_GENERATE)
232         $(WRAPPER) "$(GENERATE) M I" >$@
233 ################################################################################
234 Form_Opt_Rep: $(PROG_GENERATE)
235         $(WRAPPER) "$(GENERATE) F R" >$@
236
237 Form_Base_Defs: $(PROG_GENERATE)
238         $(WRAPPER) "$(GENERATE) F B" >$@
239
240 Form_Linker_Options: $(PROG_GENERATE)
241         $(WRAPPER) "$(GENERATE) F L" >$@
242
243 Field_Rep: $(PROG_GENERATE)
244         $(WRAPPER) "$(GENERATE) F I" >$@
245 ################################################################################
246 Mouse_Base_Defs: $(PROG_GENERATE)
247         $(WRAPPER) "$(GENERATE) P B" >$@
248
249 Mouse_Event_Rep: $(PROG_GENERATE)
250         $(WRAPPER) "$(GENERATE) P M" >$@
251
252 Mouse_Events: $(PROG_GENERATE)
253         $(WRAPPER) "$(GENERATE) B E" >$@
254
255 Panel_Linker_Options: $(PROG_GENERATE)
256         $(WRAPPER) "$(GENERATE) P L" >$@
257
258 Chtype_Def: $(PROG_GENERATE)
259         $(WRAPPER) "$(GENERATE) E C" >$@
260
261 Eti_Defs: $(PROG_GENERATE)
262         $(WRAPPER) "$(GENERATE) E E" >$@
263 ################################################################################
264 $(ADA_SRCDIR)/$(ABASE).ads:     $(srcdir)/$(ABASE).ads.m4 \
265                                 $(GEN_FILES1) $(srcdir)/normal.m4
266         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
267         $(srcdir)/$(ABASE).ads.m4 |\
268         $(DEL_ADAMODE) >$@
269
270 $(ADA_SRCDIR)/$(ABASE).adb:     $(srcdir)/$(ABASE).adb.m4 \
271                                 $(GEN_FILES1) $(srcdir)/normal.m4
272         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
273         $(srcdir)/$(ABASE).adb.m4 |\
274         $(DEL_ADAMODE) >$@
275
276 $(ADA_SRCDIR)/$(ABASE)-aux.ads: $(srcdir)/$(ABASE)-aux.ads.m4 \
277                                 $(GEN_FILES5) $(srcdir)/normal.m4
278         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
279         $(srcdir)/$(ABASE)-aux.ads.m4 |\
280         $(DEL_ADAMODE) >$@
281
282 $(ADA_SRCDIR)/$(ABASE)-trace.ads: $(srcdir)/$(ABASE)-trace.ads.m4 \
283                                 $(GEN_FILES5) $(srcdir)/normal.m4
284         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
285         $(srcdir)/$(ABASE)-trace.ads.m4 |\
286         $(DEL_ADAMODE) >$@
287
288 $(ADA_SRCDIR)/$(ABASE)-menus.ads: $(srcdir)/$(ABASE)-menus.ads.m4 \
289                                   $(GEN_FILES2) $(srcdir)/normal.m4
290         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
291         $(srcdir)/$(ABASE)-menus.ads.m4 |\
292         $(DEL_ADAMODE) >$@
293
294 $(ADA_SRCDIR)/$(ABASE)-forms.ads: $(srcdir)/$(ABASE)-forms.ads.m4 \
295                                   $(GEN_FILES3) $(srcdir)/normal.m4
296         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
297         $(srcdir)/$(ABASE)-forms.ads.m4 |\
298         $(DEL_ADAMODE) >$@
299
300 $(ADA_SRCDIR)/$(ABASE)-mouse.ads: $(srcdir)/$(ABASE)-mouse.ads.m4 \
301                                   $(GEN_FILES4) $(srcdir)/normal.m4
302         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
303         $(srcdir)/$(ABASE)-mouse.ads.m4 |\
304         $(DEL_ADAMODE) >$@
305
306 $(ADA_SRCDIR)/$(ABASE)-panels.ads: $(srcdir)/$(ABASE)-panels.ads.m4 \
307                                    $(srcdir)/normal.m4
308         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
309         $(srcdir)/$(ABASE)-panels.ads.m4 |\
310         $(DEL_ADAMODE) >$@
311
312 $(ADA_SRCDIR)/$(ABASE)-menus-menu_user_data.ads: \
313                 $(srcdir)/$(ABASE)-menus-menu_user_data.ads.m4 \
314                 $(srcdir)/normal.m4
315         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
316         $(srcdir)/$(ABASE)-menus-menu_user_data.ads.m4 |\
317         $(DEL_ADAMODE) >$@
318
319 $(ADA_SRCDIR)/$(ABASE)-menus-item_user_data.ads: \
320                 $(srcdir)/$(ABASE)-menus-item_user_data.ads.m4 \
321                 $(srcdir)/normal.m4
322         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
323         $(srcdir)/$(ABASE)-menus-item_user_data.ads.m4 |\
324         $(DEL_ADAMODE) >$@
325
326 $(ADA_SRCDIR)/$(ABASE)-forms-form_user_data.ads: \
327                 $(srcdir)/$(ABASE)-forms-form_user_data.ads.m4 \
328                 $(srcdir)/normal.m4
329         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
330         $(srcdir)/$(ABASE)-forms-form_user_data.ads.m4 |\
331         $(DEL_ADAMODE) >$@
332
333 $(ADA_SRCDIR)/$(ABASE)-forms-field_types.ads: \
334                 $(srcdir)/$(ABASE)-forms-field_types.ads.m4 \
335                 $(srcdir)/normal.m4
336         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
337         $(srcdir)/$(ABASE)-forms-field_types.ads.m4 |\
338         $(DEL_ADAMODE) >$@
339
340 $(ADA_SRCDIR)/$(ABASE)-forms-field_user_data.ads: \
341                 $(srcdir)/$(ABASE)-forms-field_user_data.ads.m4 \
342                 $(srcdir)/normal.m4
343         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
344         $(srcdir)/$(ABASE)-forms-field_user_data.ads.m4 |\
345         $(DEL_ADAMODE) >$@
346
347 $(ADA_SRCDIR)/$(ABASE)-panels-user_data.ads: \
348                 $(srcdir)/$(ABASE)-panels-user_data.ads.m4 \
349                 $(srcdir)/normal.m4
350         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
351         $(srcdir)/$(ABASE)-panels-user_data.ads.m4 |\
352         $(DEL_ADAMODE) >$@
353
354 install.progs ::
355
356 tags:
357         ctags *.[ch]
358
359 @MAKE_UPPER_TAGS@TAGS:
360 @MAKE_UPPER_TAGS@       etags *.[ch]
361
362 mostlyclean ::
363         -rm -f a.out core $(PROG_GENERATE) *.o
364         -rm -f $(GEN_FILES1)
365         -rm -f $(GEN_FILES2)
366         -rm -f $(GEN_FILES3)
367         -rm -f $(GEN_FILES4)
368         -rm -f $(GEN_FILES5)
369
370 clean :: mostlyclean
371         -rm -f $(GEN_TARGETS) instab.tmp *.ad[bs] *.html *.ali *.tmp
372
373 distclean :: clean
374         -rm -f $(ADACURSES_CONFIG)
375         -rm -f Makefile
376
377 realclean :: distclean
378
379 HTML_DIR = ../../doc/html/ada
380
381 instab.tmp : table.m4 $(GEN_SRC)
382         @rm -f $@
383         @for f in $(GEN_SRC) ; do \
384           $(M4) $(M4FLAGS) -DM4MACRO=table.m4 $$f | $(DEL_ADAMODE) >> $@ ;\
385         done;
386
387 $(HTML_DIR)/table.html : instab.tmp
388         @-touch $@
389         @-chmod +w $@
390         @echo '<!DOCTYPE HTML'  > $@
391         @echo 'PUBLIC "-//IETF//DTD HTML 3.0//EN">' >> $@
392         @echo '<HTML>' >> $@
393         @echo '<HEAD>' >> $@
394         @echo '<TITLE>Correspondence between ncurses C and Ada functions</TITLE>' >>$@
395         @echo '</HEAD>' >> $@
396         @echo '<BODY>' >> $@
397         @echo '<H1>Correspondence between ncurses C and Ada functions</H1>' >>$@
398         @echo '<H2>Sorted by C function name</H2>' >>$@
399         @echo '<TABLE ALIGN=CENTER BORDER>' >>$@
400         @echo '<TR ALIGN=LEFT>' >>$@
401         @echo '<TH>C name</TH><TH>Ada name</TH><TH>man page</TH></TR>' >>$@
402         @sort < instab.tmp >> $@
403         @echo '</TABLE></BODY></HTML>' >>$@
404         @rm -f instab.tmp
405
406 adahtml:
407         @find $(HTML_DIR) -type f -exec rm -f {} \;
408         @mkdir -p $(HTML_DIR)
409         cp -p ../src/*.ad[sb] . && chmod +w *.ad[sb]
410         ln -sf ../src/*.ali .
411         @echo "Filtering generated files"
412         @for f in $(GEN_SRC); do \
413            h=`basename $$f` ;\
414            g=`basename $$f .ads.m4` ;\
415            if test "$$g" != "$$h" ; then \
416               $(M4) $(M4FLAGS) -DM4MACRO=html.m4 $$f | $(DEL_ADAMODE) > $$g.ads ;\
417               echo "... $$g.ads" ;\
418            fi \
419         done
420         @-rm -f $(HTML_DIR)/$(ALIB)*.htm*
421         $(GNATHTML) -d -f $(ALIB)*.ads
422         for f in html/$(ALIB)*.htm*; do \
423            a=`basename $$f` ; \
424            sed -e 's/You may also.*body.*//' <$$f |\
425            sed -e 's%GNAT%<A HREF="http://$(GNATHP)">GNAT</A>%g' |\
426            sed -e 's%&lt;A HREF%<A HREF%g' |\
427            sed -e 's%"&gt;%">%g' |\
428            sed -e 's/3X/3x/g' |\
429            sed -e 's/$$\([ABCDEFGHIJKLMNOPQRSTUVWXZabcdefghijklmnopqrstuvwxz0123456789_]*:.*\)\$$/@\1@/' |\
430            sed -e 's%&lt;/A&gt;%</A>%g' > $$a.tmp ;\
431            mv $$a.tmp $$f ;\
432         done
433         @rm -f *.ad[sb] *.ali *.tmp
434         @for f in funcs.htm main.htm ; do \
435           sed -e "\%<A HREF=funcs/ .htm>\[ \]</A>%d" < html/$$f > $$f ;\
436           mv $$f html/$$f ;\
437         done
438         @rm -f "html/funcs/ .htm"
439         @cp -pdrf html/* $(HTML_DIR)/
440         @rm -rf html
441
442 html : adahtml $(HTML_DIR)/table.html
443         @echo made $@
444
445 ###############################################################################
446 # The remainder of this file is automatically generated during configuration
447 ###############################################################################