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