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