ncurses 5.6
[ncurses.git] / Ada95 / gen / Makefile.in
1 ##############################################################################
2 # Copyright (c) 1998-2005,2006 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.51 2006/12/17 16:53: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 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      = Key_Definitions                       \
96                   Old_Keys                              \
97                   Character_Attribute_Set_Rep           \
98                   AC_Rep                                \
99                   Color_Defs                            \
100                   ACS_Map                               \
101                   Linker_Options                        \
102                   Base_Defs                             \
103                   Window_Offsets                        \
104                   Version_Info                          \
105                   Trace_Defs
106
107 GEN_FILES2      = Menu_Opt_Rep                          \
108                   Menu_Base_Defs                        \
109                   Menu_Linker_Options                   \
110                   Item_Rep
111
112 GEN_FILES3      = Form_Opt_Rep                          \
113                   Form_Base_Defs                        \
114                   Form_Linker_Options                   \
115                   Field_Rep
116
117 GEN_FILES4      = Mouse_Base_Defs                       \
118                   Mouse_Event_Rep                       \
119                   Mouse_Events                          \
120                   Panel_Linker_Options
121
122 GEN_FILES5      = Chtype_Def                            \
123                   Eti_Defs
124
125 GEN_TARGETS     = $(ADA_SRCDIR)/$(ABASE).ads                            \
126                   $(ADA_SRCDIR)/$(ABASE)-aux.ads                        \
127                   $(ADA_SRCDIR)/$(ABASE)-trace.ads                      \
128                   $(ADA_SRCDIR)/$(ABASE)-menus.ads                      \
129                   $(ADA_SRCDIR)/$(ABASE)-forms.ads                      \
130                   $(ADA_SRCDIR)/$(ABASE)-mouse.ads                      \
131                   $(ADA_SRCDIR)/$(ABASE)-panels.ads                     \
132                   $(ADA_SRCDIR)/$(ABASE)-menus-menu_user_data.ads       \
133                   $(ADA_SRCDIR)/$(ABASE)-menus-item_user_data.ads       \
134                   $(ADA_SRCDIR)/$(ABASE)-forms-form_user_data.ads       \
135                   $(ADA_SRCDIR)/$(ABASE)-forms-field_types.ads          \
136                   $(ADA_SRCDIR)/$(ABASE)-forms-field_user_data.ads      \
137                   $(ADA_SRCDIR)/$(ABASE)-panels-user_data.ads
138
139 GEN_SRC         = $(srcdir)/$(ABASE).ads.m4                             \
140                   $(srcdir)/$(ABASE)-aux.ads.m4                         \
141                   $(srcdir)/$(ABASE)-trace.ads.m4                       \
142                   $(srcdir)/$(ABASE)-menus.ads.m4                       \
143                   $(srcdir)/$(ABASE)-forms.ads.m4                       \
144                   $(srcdir)/$(ABASE)-mouse.ads.m4                       \
145                   $(srcdir)/$(ABASE)-panels.ads.m4                      \
146                   $(srcdir)/$(ABASE)-menus-menu_user_data.ads.m4        \
147                   $(srcdir)/$(ABASE)-menus-item_user_data.ads.m4        \
148                   $(srcdir)/$(ABASE)-forms-form_user_data.ads.m4        \
149                   $(srcdir)/$(ABASE)-forms-field_types.ads.m4           \
150                   $(srcdir)/$(ABASE)-forms-field_user_data.ads.m4       \
151                   $(srcdir)/$(ABASE)-panels-user_data.ads.m4
152
153
154 all \
155 libs :  $(GEN_TARGETS)
156         @echo made $@
157
158 sources:
159
160 $(ADA_INCLUDE) \
161 $(ADA_OBJECTS) :
162         $(top_srcdir)/mkinstalldirs $@
163
164 install \
165 install.libs :: $(ADA_INCLUDE)
166         @echo installing package $(ALIB) in $(ADA_INCLUDE)
167         @$(top_srcdir)/tar-copy.sh '$(ALIB)*.ad?' $(ADA_SRCDIR) $(ADA_INCLUDE)
168         @$(top_srcdir)/tar-copy.sh '$(ALIB)[-.]*.ad?' $(ADA_SRCDIR) $(ADA_INCLUDE)
169         @test $(srcdir) != ./ && $(top_srcdir)/tar-copy.sh '$(ALIB)*.ad?' $(srcdir)/../src $(ADA_INCLUDE)
170         @test $(srcdir) != ./ && $(top_srcdir)/tar-copy.sh '$(ALIB)[-.]*.ad?' $(srcdir)/../src $(ADA_INCLUDE)
171
172 install \
173 install.libs :: $(ADA_OBJECTS)
174         @echo installing package $(ALIB) in $(ADA_OBJECTS)
175         @-chmod a-wx $(ADA_SRCDIR)/*.ali
176         @$(top_srcdir)/tar-copy.sh '$(ALIB)*.ali' $(ADA_SRCDIR) $(ADA_OBJECTS)
177         @$(top_srcdir)/tar-copy.sh '$(ALIB)[-.]*.ali' $(ADA_SRCDIR) $(ADA_OBJECTS)
178         @-chmod u+x $(ADA_SRCDIR)/*.ali
179
180 uninstall \
181 uninstall.libs ::
182         @echo removing package $(ALIB) from $(ADA_INCLUDE)
183         -@cd $(ADA_INCLUDE) && rm -f $(ALIB)[-.]*
184
185 uninstall \
186 uninstall.libs ::
187         @echo removing package $(ALIB) from $(ADA_OBJECTS)
188         -@cd $(ADA_OBJECTS) && rm -f $(ALIB)[-.]*
189
190 gen$x:  gen.o
191         @ECHO_LINK@ $(LINK) $(CFLAGS_NORMAL) gen.o $(LD_FLAGS) -o $@
192
193 gen.o:  $(srcdir)/gen.c
194         $(HOST_CC) $(CFLAGS_NORMAL) -c -o $@ $(srcdir)/gen.c
195
196 Character_Attribute_Set_Rep: gen$x
197         $(GENERATE) B A >$@
198
199 Base_Defs: gen$x
200         $(GENERATE) B B >$@
201
202 Color_Defs: gen$x
203         $(GENERATE) B C >$@
204
205 Key_Definitions: gen$x
206         $(GENERATE) B K >$@
207
208 Old_Keys: gen$x
209         $(GENERATE) B O >$@
210
211 ACS_Map: gen$x
212         $(GENERATE) B M >$@
213
214 AC_Rep: gen$x
215         $(GENERATE) B R >$@
216
217 Linker_Options: gen$x
218         $(GENERATE) B L >$@
219
220 Version_Info: gen$x
221         $(GENERATE) B V >$@
222
223 Window_Offsets: gen$x
224         $(GENERATE) B D >$@
225
226 Trace_Defs: gen$x
227         $(GENERATE) B T >$@
228
229 Menu_Opt_Rep: gen$x
230         $(GENERATE) M R >$@
231
232 Menu_Base_Defs: gen$x
233         $(GENERATE) M B >$@
234
235 Menu_Linker_Options: gen$x
236         $(GENERATE) M L >$@
237
238 Item_Rep: gen$x
239         $(GENERATE) M I >$@
240
241 Form_Opt_Rep: gen$x
242         $(GENERATE) F R >$@
243
244 Form_Base_Defs: gen$x
245         $(GENERATE) F B >$@
246
247 Form_Linker_Options: gen$x
248         $(GENERATE) F L >$@
249
250 Field_Rep: gen$x
251         $(GENERATE) F I >$@
252
253 Mouse_Base_Defs: gen$x
254         $(GENERATE) P B >$@
255
256 Mouse_Event_Rep: gen$x
257         $(GENERATE) P M >$@
258
259 Mouse_Events: gen$x
260         $(GENERATE) B E >$@
261
262 Panel_Linker_Options: gen$x
263         $(GENERATE) P L >$@
264
265 Chtype_Def: gen$x
266         $(GENERATE) E C >$@
267
268 Eti_Defs: gen$x
269         $(GENERATE) E E >$@
270
271 $(ADA_SRCDIR)/$(ABASE).ads:     $(srcdir)/$(ABASE).ads.m4 \
272                                 $(GEN_FILES1) $(srcdir)/normal.m4
273         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
274         $(srcdir)/$(ABASE).ads.m4 |\
275         $(DEL_ADAMODE) >$@
276
277 $(ADA_SRCDIR)/$(ABASE)-aux.ads: $(srcdir)/$(ABASE)-aux.ads.m4 \
278                                 $(GEN_FILES5) $(srcdir)/normal.m4
279         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
280         $(srcdir)/$(ABASE)-aux.ads.m4 |\
281         $(DEL_ADAMODE) >$@
282
283 $(ADA_SRCDIR)/$(ABASE)-trace.ads: $(srcdir)/$(ABASE)-trace.ads.m4 \
284                                 $(GEN_FILES5) $(srcdir)/normal.m4
285         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
286         $(srcdir)/$(ABASE)-trace.ads.m4 |\
287         $(DEL_ADAMODE) >$@
288
289 $(ADA_SRCDIR)/$(ABASE)-menus.ads: $(srcdir)/$(ABASE)-menus.ads.m4 \
290                                   $(GEN_FILES2) $(srcdir)/normal.m4
291         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
292         $(srcdir)/$(ABASE)-menus.ads.m4 |\
293         $(DEL_ADAMODE) >$@
294
295 $(ADA_SRCDIR)/$(ABASE)-forms.ads: $(srcdir)/$(ABASE)-forms.ads.m4 \
296                                   $(GEN_FILES3) $(srcdir)/normal.m4
297         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
298         $(srcdir)/$(ABASE)-forms.ads.m4 |\
299         $(DEL_ADAMODE) >$@
300
301 $(ADA_SRCDIR)/$(ABASE)-mouse.ads: $(srcdir)/$(ABASE)-mouse.ads.m4 \
302                                   $(GEN_FILES4) $(srcdir)/normal.m4
303         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
304         $(srcdir)/$(ABASE)-mouse.ads.m4 |\
305         $(DEL_ADAMODE) >$@
306
307 $(ADA_SRCDIR)/$(ABASE)-panels.ads: $(srcdir)/$(ABASE)-panels.ads.m4 \
308                                    $(srcdir)/normal.m4
309         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
310         $(srcdir)/$(ABASE)-panels.ads.m4 |\
311         $(DEL_ADAMODE) >$@
312
313 $(ADA_SRCDIR)/$(ABASE)-menus-menu_user_data.ads: \
314                 $(srcdir)/$(ABASE)-menus-menu_user_data.ads.m4 \
315                 $(srcdir)/normal.m4
316         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
317         $(srcdir)/$(ABASE)-menus-menu_user_data.ads.m4 |\
318         $(DEL_ADAMODE) >$@
319
320 $(ADA_SRCDIR)/$(ABASE)-menus-item_user_data.ads: \
321                 $(srcdir)/$(ABASE)-menus-item_user_data.ads.m4 \
322                 $(srcdir)/normal.m4
323         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
324         $(srcdir)/$(ABASE)-menus-item_user_data.ads.m4 |\
325         $(DEL_ADAMODE) >$@
326
327 $(ADA_SRCDIR)/$(ABASE)-forms-form_user_data.ads: \
328                 $(srcdir)/$(ABASE)-forms-form_user_data.ads.m4 \
329                 $(srcdir)/normal.m4
330         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
331         $(srcdir)/$(ABASE)-forms-form_user_data.ads.m4 |\
332         $(DEL_ADAMODE) >$@
333
334 $(ADA_SRCDIR)/$(ABASE)-forms-field_types.ads: \
335                 $(srcdir)/$(ABASE)-forms-field_types.ads.m4 \
336                 $(srcdir)/normal.m4
337         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
338         $(srcdir)/$(ABASE)-forms-field_types.ads.m4 |\
339         $(DEL_ADAMODE) >$@
340
341 $(ADA_SRCDIR)/$(ABASE)-forms-field_user_data.ads: \
342                 $(srcdir)/$(ABASE)-forms-field_user_data.ads.m4 \
343                 $(srcdir)/normal.m4
344         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
345         $(srcdir)/$(ABASE)-forms-field_user_data.ads.m4 |\
346         $(DEL_ADAMODE) >$@
347
348 $(ADA_SRCDIR)/$(ABASE)-panels-user_data.ads: \
349                 $(srcdir)/$(ABASE)-panels-user_data.ads.m4 \
350                 $(srcdir)/normal.m4
351         $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
352         $(srcdir)/$(ABASE)-panels-user_data.ads.m4 |\
353         $(DEL_ADAMODE) >$@
354
355 install.progs ::
356
357 tags:
358         ctags *.[ch]
359
360 TAGS:
361         etags *.[ch]
362
363 mostlyclean ::
364         -rm -f a.out core gen$x *.o
365         -rm -f $(GEN_FILES1)
366         -rm -f $(GEN_FILES2)
367         -rm -f $(GEN_FILES3)
368         -rm -f $(GEN_FILES4)
369         -rm -f $(GEN_FILES5)
370
371 clean :: mostlyclean
372         -rm -f $(GEN_TARGETS) instab.tmp *.ad[bs] *.html *.ali *.tmp
373
374 distclean :: clean
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         for f in $(GEN_SRC); do \
412            g=`basename $$f .ads.m4` ;\
413            $(M4) $(M4FLAGS) -DM4MACRO=html.m4 $$f | $(DEL_ADAMODE) > $$g.ads ;\
414         done
415         @-rm -f $(HTML_DIR)/$(ALIB)*.htm*
416         $(GNATHTML) -d -f $(ALIB)*.ads
417         for f in html/$(ALIB)*.htm*; do \
418            a=`basename $$f` ; \
419            sed -e 's/You may also.*body.*//' <$$f |\
420            sed -e 's%GNAT%<A HREF="http://$(GNATHP)">GNAT</A>%g' |\
421            sed -e 's%&lt;A HREF%<A HREF%g' |\
422            sed -e 's%"&gt;%">%g' |\
423            sed -e 's/3X/3x/g' |\
424            sed -e 's/$$\([ABCDEFGHIJKLMNOPQRSTUVWXZabcdefghijklmnopqrstuvwxz0123456789_]*:.*\)\$$/@\1@/' |\
425            sed -e 's%&lt;/A&gt;%</A>%g' > $$a.tmp ;\
426            mv $$a.tmp $$f ;\
427         done
428         @rm -f *.ad[sb] *.ali *.tmp
429         @for f in funcs.htm main.htm ; do \
430           sed -e "\%<A HREF=funcs/ .htm>\[ \]</A>%d" < html/$$f > $$f ;\
431           mv $$f html/$$f ;\
432         done
433         @rm -f "html/funcs/ .htm"
434         @cp -pdrf html/* $(HTML_DIR)/
435         @rm -rf html
436
437 html : adahtml $(HTML_DIR)/table.html
438         @echo made $@
439
440 ###############################################################################
441 # The remainder of this file is automatically generated during configuration
442 ###############################################################################