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