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