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