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