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