ncurses 5.6 - patch 20070915
[ncurses.git] / Ada95 / gen / Makefile.in
1 ##############################################################################
2 # Copyright (c) 1998-2006,2007 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.60 2007/09/15 17:55:33 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
47 ADA_INCLUDE     = $(DESTDIR)@ADA_INCLUDE@
48 ADA_OBJECTS     = $(DESTDIR)@ADA_OBJECTS@
49
50 INSTALL         = @INSTALL@
51 INSTALL_PROG    = @INSTALL_PROGRAM@
52 INSTALL_DATA    = @INSTALL_DATA@
53
54 AWK             = @AWK@
55 LN_S            = @LN_S@
56
57 CC              = @CC@
58 HOST_CC         = @BUILD_CC@
59 CFLAGS          = @CFLAGS@
60
61 CPPFLAGS        = @ACPPFLAGS@ \
62                   -DHAVE_CONFIG_H -I$(srcdir)
63
64 CCFLAGS         = $(CPPFLAGS) $(CFLAGS)
65 CFLAGS_NORMAL   = $(CCFLAGS)
66 CFLAGS_DEBUG    = $(CCFLAGS) @CC_G_OPT@ -DTRACE
67 CFLAGS_PROFILE  = $(CCFLAGS) -pg
68 CFLAGS_SHARED   = $(CCFLAGS) @CC_SHARED_OPTS@
69
70 CFLAGS_DEFAULT  = $(CFLAGS_@DFT_UPR_MODEL@)
71
72 REL_VERSION     = @cf_cv_rel_version@
73 ABI_VERSION     = @cf_cv_abi_version@
74 LOCAL_LIBDIR    = @top_builddir@/lib
75
76 LINK            = $(HOST_CC)
77 LD_FLAGS        = @LD_MODEL@ $(LOCAL_LIBS) @LDFLAGS@ @LIBS@ @LOCAL_LDFLAGS2@ $(LDFLAGS) @TINFO_ARGS2@
78
79 RANLIB          = @RANLIB@
80
81 M4              = m4
82 M4FLAGS         =
83
84 ADACURSES_CONFIG = adacurses-config
85
86 WRAPPER         = sh $(top_srcdir)/misc/shlib
87 GENERATE        = ./gen$x '@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 $(ADA_INCLUDE) \
170 $(ADA_OBJECTS) :
171         sh $(top_srcdir)/mkdirs.sh $@
172
173 install \
174 install.libs :: $(ADA_INCLUDE)
175         @echo installing package $(ALIB) in $(ADA_INCLUDE)
176         @$(top_srcdir)/tar-copy.sh '$(ALIB)*.ad?' $(ADA_SRCDIR) $(ADA_INCLUDE)
177         @$(top_srcdir)/tar-copy.sh '$(ALIB)[-.]*.ad?' $(ADA_SRCDIR) $(ADA_INCLUDE)
178         @test $(srcdir) != ./ && $(top_srcdir)/tar-copy.sh '$(ALIB)*.ad?' $(srcdir)/../src $(ADA_INCLUDE)
179         @test $(srcdir) != ./ && $(top_srcdir)/tar-copy.sh '$(ALIB)[-.]*.ad?' $(srcdir)/../src $(ADA_INCLUDE)
180
181 install \
182 install.libs :: $(ADA_OBJECTS)
183         @echo installing package $(ALIB) in $(ADA_OBJECTS)
184         @-chmod a-wx $(ADA_SRCDIR)/*.ali
185         @$(top_srcdir)/tar-copy.sh '$(ALIB)*.ali' $(ADA_SRCDIR) $(ADA_OBJECTS)
186         @$(top_srcdir)/tar-copy.sh '$(ALIB)[-.]*.ali' $(ADA_SRCDIR) $(ADA_OBJECTS)
187         @-chmod u+x $(ADA_SRCDIR)/*.ali
188
189 install \
190 install.libs :: $(DESTDIR)$(bindir) adacurses-config
191         $(INSTALL_PROG) adacurses-config $(DESTDIR)$(bindir)/$(ADACURSES_CONFIG)
192
193 uninstall \
194 uninstall.libs ::
195         @echo removing package $(ALIB) from $(ADA_INCLUDE)
196         -@cd $(ADA_INCLUDE) && rm -f $(ALIB)[-.]*
197
198 uninstall \
199 uninstall.libs ::
200         @echo removing package $(ALIB) from $(ADA_OBJECTS)
201         -@cd $(ADA_OBJECTS) && rm -f $(ALIB)[-.]*
202
203 uninstall \
204 uninstall.libs ::
205         -rm -f $(DESTDIR)$(bindir)/$(ADACURSES_CONFIG)
206
207 gen$x:  gen.o
208         @ECHO_LINK@ $(LINK) $(CFLAGS_NORMAL) gen.o $(LD_FLAGS) -o $@
209
210 gen.o:  $(srcdir)/gen.c
211         $(HOST_CC) $(CFLAGS_NORMAL) -c -o $@ $(srcdir)/gen.c
212 ################################################################################
213 Character_Attribute_Set_Rep: gen$x
214         $(WRAPPER) "$(GENERATE) B A" >$@
215
216 Base_Defs: gen$x
217         $(WRAPPER) "$(GENERATE) B B" >$@
218
219 Color_Defs: gen$x
220         $(WRAPPER) "$(GENERATE) B C" >$@
221
222 Window_Offsets: gen$x
223         $(WRAPPER) "$(GENERATE) B D" >$@
224
225 Key_Definitions: gen$x
226         $(WRAPPER) "$(GENERATE) B K" >$@
227
228 Linker_Options: gen$x
229         $(WRAPPER) "$(GENERATE) B L" >$@
230
231 ACS_Map: gen$x
232         $(WRAPPER) "$(GENERATE) B M" >$@
233
234 Old_Keys: gen$x
235         $(WRAPPER) "$(GENERATE) B O" >$@
236
237 Public_Variables: gen$x
238         $(WRAPPER) "$(GENERATE) B P" >$@
239
240 AC_Rep: gen$x
241         $(WRAPPER) "$(GENERATE) B R" >$@
242
243 Version_Info: gen$x
244         $(WRAPPER) "$(GENERATE) B V" >$@
245
246 Trace_Defs: gen$x
247         $(WRAPPER) "$(GENERATE) B T" >$@
248 ################################################################################
249 Menu_Opt_Rep: gen$x
250         $(WRAPPER) "$(GENERATE) M R" >$@
251
252 Menu_Base_Defs: gen$x
253         $(WRAPPER) "$(GENERATE) M B" >$@
254
255 Menu_Linker_Options: gen$x
256         $(WRAPPER) "$(GENERATE) M L" >$@
257
258 Item_Rep: gen$x
259         $(WRAPPER) "$(GENERATE) M I" >$@
260 ################################################################################
261 Form_Opt_Rep: gen$x
262         $(WRAPPER) "$(GENERATE) F R" >$@
263
264 Form_Base_Defs: gen$x
265         $(WRAPPER) "$(GENERATE) F B" >$@
266
267 Form_Linker_Options: gen$x
268         $(WRAPPER) "$(GENERATE) F L" >$@
269
270 Field_Rep: gen$x
271         $(WRAPPER) "$(GENERATE) F I" >$@
272 ################################################################################
273 Mouse_Base_Defs: gen$x
274         $(WRAPPER) "$(GENERATE) P B" >$@
275
276 Mouse_Event_Rep: gen$x
277         $(WRAPPER) "$(GENERATE) P M" >$@
278
279 Mouse_Events: gen$x
280         $(WRAPPER) "$(GENERATE) B E" >$@
281
282 Panel_Linker_Options: gen$x
283         $(WRAPPER) "$(GENERATE) P L" >$@
284
285 Chtype_Def: gen$x
286         $(WRAPPER) "$(GENERATE) E C" >$@
287
288 Eti_Defs: gen$x
289         $(WRAPPER) "$(GENERATE) E E" >$@
290 ################################################################################
291 $(ADA_SRCDIR)/$(ABASE).ads:     $(srcdir)/$(ABASE).ads.m4 \
292                                 $(GEN_FILES1) $(srcdir)/normal.m4
293         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
294         $(srcdir)/$(ABASE).ads.m4 |\
295         $(DEL_ADAMODE) >$@
296
297 $(ADA_SRCDIR)/$(ABASE).adb:     $(srcdir)/$(ABASE).adb.m4 \
298                                 $(GEN_FILES1) $(srcdir)/normal.m4
299         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
300         $(srcdir)/$(ABASE).adb.m4 |\
301         $(DEL_ADAMODE) >$@
302
303 $(ADA_SRCDIR)/$(ABASE)-aux.ads: $(srcdir)/$(ABASE)-aux.ads.m4 \
304                                 $(GEN_FILES5) $(srcdir)/normal.m4
305         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
306         $(srcdir)/$(ABASE)-aux.ads.m4 |\
307         $(DEL_ADAMODE) >$@
308
309 $(ADA_SRCDIR)/$(ABASE)-trace.ads: $(srcdir)/$(ABASE)-trace.ads.m4 \
310                                 $(GEN_FILES5) $(srcdir)/normal.m4
311         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
312         $(srcdir)/$(ABASE)-trace.ads.m4 |\
313         $(DEL_ADAMODE) >$@
314
315 $(ADA_SRCDIR)/$(ABASE)-menus.ads: $(srcdir)/$(ABASE)-menus.ads.m4 \
316                                   $(GEN_FILES2) $(srcdir)/normal.m4
317         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
318         $(srcdir)/$(ABASE)-menus.ads.m4 |\
319         $(DEL_ADAMODE) >$@
320
321 $(ADA_SRCDIR)/$(ABASE)-forms.ads: $(srcdir)/$(ABASE)-forms.ads.m4 \
322                                   $(GEN_FILES3) $(srcdir)/normal.m4
323         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
324         $(srcdir)/$(ABASE)-forms.ads.m4 |\
325         $(DEL_ADAMODE) >$@
326
327 $(ADA_SRCDIR)/$(ABASE)-mouse.ads: $(srcdir)/$(ABASE)-mouse.ads.m4 \
328                                   $(GEN_FILES4) $(srcdir)/normal.m4
329         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
330         $(srcdir)/$(ABASE)-mouse.ads.m4 |\
331         $(DEL_ADAMODE) >$@
332
333 $(ADA_SRCDIR)/$(ABASE)-panels.ads: $(srcdir)/$(ABASE)-panels.ads.m4 \
334                                    $(srcdir)/normal.m4
335         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
336         $(srcdir)/$(ABASE)-panels.ads.m4 |\
337         $(DEL_ADAMODE) >$@
338
339 $(ADA_SRCDIR)/$(ABASE)-menus-menu_user_data.ads: \
340                 $(srcdir)/$(ABASE)-menus-menu_user_data.ads.m4 \
341                 $(srcdir)/normal.m4
342         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
343         $(srcdir)/$(ABASE)-menus-menu_user_data.ads.m4 |\
344         $(DEL_ADAMODE) >$@
345
346 $(ADA_SRCDIR)/$(ABASE)-menus-item_user_data.ads: \
347                 $(srcdir)/$(ABASE)-menus-item_user_data.ads.m4 \
348                 $(srcdir)/normal.m4
349         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
350         $(srcdir)/$(ABASE)-menus-item_user_data.ads.m4 |\
351         $(DEL_ADAMODE) >$@
352
353 $(ADA_SRCDIR)/$(ABASE)-forms-form_user_data.ads: \
354                 $(srcdir)/$(ABASE)-forms-form_user_data.ads.m4 \
355                 $(srcdir)/normal.m4
356         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
357         $(srcdir)/$(ABASE)-forms-form_user_data.ads.m4 |\
358         $(DEL_ADAMODE) >$@
359
360 $(ADA_SRCDIR)/$(ABASE)-forms-field_types.ads: \
361                 $(srcdir)/$(ABASE)-forms-field_types.ads.m4 \
362                 $(srcdir)/normal.m4
363         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
364         $(srcdir)/$(ABASE)-forms-field_types.ads.m4 |\
365         $(DEL_ADAMODE) >$@
366
367 $(ADA_SRCDIR)/$(ABASE)-forms-field_user_data.ads: \
368                 $(srcdir)/$(ABASE)-forms-field_user_data.ads.m4 \
369                 $(srcdir)/normal.m4
370         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
371         $(srcdir)/$(ABASE)-forms-field_user_data.ads.m4 |\
372         $(DEL_ADAMODE) >$@
373
374 $(ADA_SRCDIR)/$(ABASE)-panels-user_data.ads: \
375                 $(srcdir)/$(ABASE)-panels-user_data.ads.m4 \
376                 $(srcdir)/normal.m4
377         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
378         $(srcdir)/$(ABASE)-panels-user_data.ads.m4 |\
379         $(DEL_ADAMODE) >$@
380
381 install.progs ::
382
383 tags:
384         ctags *.[ch]
385
386 @MAKE_UPPER_TAGS@TAGS:
387 @MAKE_UPPER_TAGS@       etags *.[ch]
388
389 mostlyclean ::
390         -rm -f a.out core gen$x *.o
391         -rm -f $(GEN_FILES1)
392         -rm -f $(GEN_FILES2)
393         -rm -f $(GEN_FILES3)
394         -rm -f $(GEN_FILES4)
395         -rm -f $(GEN_FILES5)
396
397 clean :: mostlyclean
398         -rm -f $(GEN_TARGETS) instab.tmp *.ad[bs] *.html *.ali *.tmp
399
400 distclean :: clean
401         -rm -f adacurses-config
402         -rm -f Makefile
403
404 realclean :: distclean
405
406 HTML_DIR = ../../doc/html/ada
407
408 instab.tmp : table.m4 $(GEN_SRC)
409         @rm -f $@
410         @for f in $(GEN_SRC) ; do \
411           $(M4) $(M4FLAGS) -DM4MACRO=table.m4 $$f | $(DEL_ADAMODE) >> $@ ;\
412         done;
413
414 $(HTML_DIR)/table.html : instab.tmp
415         @-touch $@
416         @-chmod +w $@
417         @echo '<!DOCTYPE HTML'  > $@
418         @echo 'PUBLIC "-//IETF//DTD HTML 3.0//EN">' >> $@
419         @echo '<HTML>' >> $@
420         @echo '<HEAD>' >> $@
421         @echo '<TITLE>Correspondence between ncurses C and Ada functions</TITLE>' >>$@
422         @echo '</HEAD>' >> $@
423         @echo '<BODY>' >> $@
424         @echo '<H1>Correspondence between ncurses C and Ada functions</H1>' >>$@
425         @echo '<H2>Sorted by C function name</H2>' >>$@
426         @echo '<TABLE ALIGN=CENTER BORDER>' >>$@
427         @echo '<TR ALIGN=LEFT>' >>$@
428         @echo '<TH>C name</TH><TH>Ada name</TH><TH>man page</TH></TR>' >>$@
429         @sort < instab.tmp >> $@
430         @echo '</TABLE></BODY></HTML>' >>$@
431         @rm -f instab.tmp
432
433 adahtml:
434         @find $(HTML_DIR) -type f -exec rm -f {} \;
435         @mkdir -p $(HTML_DIR)
436         cp -p ../src/*.ad[sb] . && chmod +w *.ad[sb]
437         ln -sf ../src/*.ali .
438         @echo "Filtering generated files"
439         @for f in $(GEN_SRC); do \
440            h=`basename $$f` ;\
441            g=`basename $$f .ads.m4` ;\
442            if test "$$g" != "$$h" ; then \
443               $(M4) $(M4FLAGS) -DM4MACRO=html.m4 $$f | $(DEL_ADAMODE) > $$g.ads ;\
444               echo "... $$g.ads" ;\
445            fi \
446         done
447         @-rm -f $(HTML_DIR)/$(ALIB)*.htm*
448         $(GNATHTML) -d -f $(ALIB)*.ads
449         for f in html/$(ALIB)*.htm*; do \
450            a=`basename $$f` ; \
451            sed -e 's/You may also.*body.*//' <$$f |\
452            sed -e 's%GNAT%<A HREF="http://$(GNATHP)">GNAT</A>%g' |\
453            sed -e 's%&lt;A HREF%<A HREF%g' |\
454            sed -e 's%"&gt;%">%g' |\
455            sed -e 's/3X/3x/g' |\
456            sed -e 's/$$\([ABCDEFGHIJKLMNOPQRSTUVWXZabcdefghijklmnopqrstuvwxz0123456789_]*:.*\)\$$/@\1@/' |\
457            sed -e 's%&lt;/A&gt;%</A>%g' > $$a.tmp ;\
458            mv $$a.tmp $$f ;\
459         done
460         @rm -f *.ad[sb] *.ali *.tmp
461         @for f in funcs.htm main.htm ; do \
462           sed -e "\%<A HREF=funcs/ .htm>\[ \]</A>%d" < html/$$f > $$f ;\
463           mv $$f html/$$f ;\
464         done
465         @rm -f "html/funcs/ .htm"
466         @cp -pdrf html/* $(HTML_DIR)/
467         @rm -rf html
468
469 html : adahtml $(HTML_DIR)/table.html
470         @echo made $@
471
472 ###############################################################################
473 # The remainder of this file is automatically generated during configuration
474 ###############################################################################