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