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