ncurses 6.1 - patch 20190921
[ncurses.git] / Ada95 / gen / Makefile.in
index 775c344f6883dea9243b2ef55fc18667f64b1727..4e649d1c36e0b32b8cffbd309951d0dcea24c492 100644 (file)
@@ -1,53 +1,69 @@
-#----------------------------------------------------------------------------
-#                                                                          --
-#                            GNAT ncurses Binding                          --
-#                                gen/Makefile                              --
-#                                                                          --
-#  Version 00.92                                                           --
-#                                                                          --
-#  The ncurses Ada95 binding is copyrighted 1996 by                        --
-#  Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de                     --
-#                                                                          --
-#  Permission is hereby granted to reproduce and distribute this           --
-#  binding by any means and for any fee, whether alone or as part          --
-#  of a larger distribution, in source or in binary form, PROVIDED         --
-#  this notice is included with any such distribution, and is not          --
-#  removed from any of its header files. Mention of ncurses and the        --
-#  author of this binding in any applications linked with it is            --
-#  highly appreciated.                                                     --
-#                                                                          --
-#  This binding comes AS IS with no warranty, implied or expressed.        --
-#----------------------------------------------------------------------------
-#  Version Control
-#  $Revision: 1.8 $
+##############################################################################
+# Copyright (c) 1998-2018,2019 Free Software Foundation, Inc.                #
+#                                                                            #
+# Permission is hereby granted, free of charge, to any person obtaining a    #
+# copy of this software and associated documentation files (the "Software"), #
+# to deal in the Software without restriction, including without limitation  #
+# the rights to use, copy, modify, merge, publish, distribute, distribute    #
+# with modifications, sublicense, and/or sell copies of the Software, and to #
+# permit persons to whom the Software is furnished to do so, subject to the  #
+# following conditions:                                                      #
+#                                                                            #
+# The above copyright notice and this permission notice shall be included in #
+# all copies or substantial portions of the Software.                        #
+#                                                                            #
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,   #
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL    #
+# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER      #
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING    #
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER        #
+# DEALINGS IN THE SOFTWARE.                                                  #
+#                                                                            #
+# Except as contained in this notice, the name(s) of the above copyright     #
+# holders shall not be used in advertising or otherwise to promote the sale, #
+# use or other dealings in this Software without prior written               #
+# authorization.                                                             #
+##############################################################################
+#
+#  Author:  Juergen Pfeifer, 1996
+#
+#  $Id: Makefile.in,v 1.89 2019/08/31 15:44:14 tom Exp $
 #
 .SUFFIXES:
 
-SHELL          = /bin/sh
+SHELL          = @SHELL@
+VPATH          = @srcdir@
 THIS           = Makefile
 
+x              = @EXEEXT@
+
+top_srcdir     = @top_srcdir@
+DESTDIR                = @DESTDIR@
 srcdir         = @srcdir@
 prefix         = @prefix@
 exec_prefix    = @exec_prefix@
-libdir         = @libdir@
+bindir         = @bindir@
 includedir     = @includedir@
-datadir                = @datadir@
-ticdir         = $(datadir)/terminfo
 
-INSTALL                = @INSTALL@
+INSTALL                = @INSTALL@ @INSTALL_OPT_O@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_DATA   = @INSTALL_DATA@
 
 AWK            = @AWK@
 LN_S           = @LN_S@
 
 CC             = @CC@
+HOST_CC                = @BUILD_CC@
+
 CFLAGS         = @CFLAGS@
+HOST_CFLAGS    = @BUILD_CFLAGS@
 
-CPPFLAGS       = @ACPPFLAGS@ \
+CPPFLAGS       = @CPPFLAGS@
+HOST_CPPFLAGS  = @ACPPFLAGS@ @BUILD_CPPFLAGS@ \
                  -DHAVE_CONFIG_H -I$(srcdir)
 
-CCFLAGS                = $(CPPFLAGS) $(CFLAGS)
-
+CCFLAGS                = $(HOST_CPPFLAGS) $(HOST_CFLAGS)
 CFLAGS_NORMAL  = $(CCFLAGS)
 CFLAGS_DEBUG   = $(CCFLAGS) @CC_G_OPT@ -DTRACE
 CFLAGS_PROFILE = $(CCFLAGS) -pg
@@ -55,52 +71,49 @@ CFLAGS_SHARED       = $(CCFLAGS) @CC_SHARED_OPTS@
 
 CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@)
 
-LINK           = $(CC)
-LD_FLAGS       = @LD_MODEL@ $(LOCAL_LIBS) @LDFLAGS@ @LIBS@ @LOCAL_LDFLAGS2@ $(LDFLAGS)
+REL_VERSION    = @cf_cv_rel_version@
+ABI_VERSION    = @cf_cv_abi_version@
+LOCAL_LIBDIR   = @top_builddir@/lib
 
-RANLIB         = @RANLIB@
+LINK           = $(HOST_CC)
+LDFLAGS                = @LDFLAGS@
+LIBS           = @LIBS@
 
-LIB_CURSES      = -L ../../lib -lncurses
+# For the wide-character configuration combined with broken_linker, we need
+# addresses of ACS_xxx constants, which requires linking with the newly built
+# ncurses library.  If cross-compiling, the developer has to fill in a workable
+# native library for this purpose.
+NATIVE_LDFLAGS = @LD_MODEL@ $(LOCAL_LIBS) @TINFO_LDFLAGS2@ $(LDFLAGS) @LIBS@ @LOCAL_LDFLAGS2@ $(LDFLAGS) @TINFO_LIBS@
+CROSS_LDFLAGS  = @BUILD_LDFLAGS@ @BUILD_LIBS@
 
-M4             = m4
-M4FLAGS                =
+ACTUAL_LDFLAGS = @ADAGEN_LDFLAGS@
 
-DEL_ADAMODE    = sed -e '/^\-\-\ \ \-\*\-\ ada\ \-\*\-.*/d'
+RANLIB         = @RANLIB@
 
-################################################################################
-ALIB            = @nc_ada_package@
-ABASE          = $(ALIB)-curses
+M4             = m4
+M4FLAGS                = -DNCURSES_EXT_FUNCS=@NCURSES_EXT_FUNCS@
 
-ADA_SRCDIR     = ../ada_include
-ADA_OBJDIR      = ../ada_objects
-OBJDIR          = ../objects
+ADACURSES_CONFIG = adacurses@USE_CFG_SUFFIX@-config
 
-GEN_FILES0      = Base_Defs
+WRAPPER                = @NCURSES_SHLIB2@
 
-GEN_FILES1      = Key_Definitions                              \
-                 Old_Keys                              \
-                 Character_Attribute_Set_Rep           \
-                 AC_Rep                                \
-                 Color_Defs                            \
-                 ACS_Map                               \
-                 Linker_Options                        \
-                 Base_Defs
+PROG_GENERATE  = ./generate$x
+GENERATE       = $(PROG_GENERATE) '@USE_ARG_SUFFIX@'
+DEL_ADAMODE    = sed -e '/^\-\-\ \ \-\*\-\ ada\ \-\*\-.*/d'
 
-GEN_FILES2      = Menu_Opt_Rep                         \
-                 Menu_Base_Defs                        \
-                 Menu_Linker_Options                   \
-                 Item_Rep
+GNATHTML       = `type -p gnathtml || type -p gnathtml.pl 2>/dev/null`
+GNATHP          = www.gnat.com
 
-GEN_FILES3      = Form_Opt_Rep                                 \
-                 Form_Base_Defs                        \
-                 Form_Linker_Options                   \
-                 Field_Rep
+################################################################################
+ALIB            = @cf_ada_package@
+ABASE          = $(ALIB)-curses
 
-GEN_FILES4      = Mouse_Base_Defs                              \
-                 Mouse_Event_Rep                       \
-                 Panel_Linker_Options
+ADA_SRCDIR     = ../src
 
 GEN_TARGETS     = $(ADA_SRCDIR)/$(ABASE).ads                           \
+                 $(ADA_SRCDIR)/$(ABASE).adb                            \
+                 $(ADA_SRCDIR)/$(ABASE)-aux.ads                        \
+                 $(ADA_SRCDIR)/$(ABASE)-trace.ads                      \
                  $(ADA_SRCDIR)/$(ABASE)-menus.ads                      \
                  $(ADA_SRCDIR)/$(ABASE)-forms.ads                      \
                  $(ADA_SRCDIR)/$(ABASE)-mouse.ads                      \
@@ -108,10 +121,15 @@ GEN_TARGETS     = $(ADA_SRCDIR)/$(ABASE).ads                              \
                  $(ADA_SRCDIR)/$(ABASE)-menus-menu_user_data.ads       \
                  $(ADA_SRCDIR)/$(ABASE)-menus-item_user_data.ads       \
                  $(ADA_SRCDIR)/$(ABASE)-forms-form_user_data.ads       \
+                 $(ADA_SRCDIR)/$(ABASE)-forms-field_types.ads          \
                  $(ADA_SRCDIR)/$(ABASE)-forms-field_user_data.ads      \
-                 $(ADA_SRCDIR)/$(ABASE)-panels-user_data.ads
+                 $(ADA_SRCDIR)/$(ABASE)-panels-user_data.ads           \
+                  $(ADA_SRCDIR)/$(ABASE)_constants.ads
 
 GEN_SRC                = $(srcdir)/$(ABASE).ads.m4                             \
+                 $(srcdir)/$(ABASE).adb.m4                             \
+                 $(srcdir)/$(ABASE)-aux.ads.m4                         \
+                 $(srcdir)/$(ABASE)-trace.ads.m4                       \
                  $(srcdir)/$(ABASE)-menus.ads.m4                       \
                  $(srcdir)/$(ABASE)-forms.ads.m4                       \
                  $(srcdir)/$(ABASE)-mouse.ads.m4                       \
@@ -119,99 +137,75 @@ GEN_SRC           = $(srcdir)/$(ABASE).ads.m4                             \
                  $(srcdir)/$(ABASE)-menus-menu_user_data.ads.m4        \
                  $(srcdir)/$(ABASE)-menus-item_user_data.ads.m4        \
                  $(srcdir)/$(ABASE)-forms-form_user_data.ads.m4        \
+                 $(srcdir)/$(ABASE)-forms-field_types.ads.m4           \
                  $(srcdir)/$(ABASE)-forms-field_user_data.ads.m4       \
                  $(srcdir)/$(ABASE)-panels-user_data.ads.m4
 
 
-all:   $(GEN_TARGETS) dirs
-       @
-
-dirs:
-       @-mkdir $(OBJDIR) $(ADA_OBJDIR)
-
-gen:   gen.o
-       @ECHO_LINK@ $(LINK) $(CFLAGS_NORMAL) gen.o $(LD_FLAGS) -o $@ $(LIB_CURSES)
-
-gen.o: $(srcdir)/gen.c
-       $(CC) $(CFLAGS_NORMAL) -c -o $@ $(srcdir)/gen.c
-
-Character_Attribute_Set_Rep: gen
-       ./gen B A >$@
-
-Base_Defs: gen
-       ./gen B B >$@
-
-Color_Defs: gen
-       ./gen B C >$@
-
-Key_Definitions: gen
-       ./gen B K >$@
-
-Old_Keys: gen
-       ./gen B O >$@
+all \
+libs : $(GEN_TARGETS)
+       @echo made $@
 
-ACS_Map: gen
-       ./gen B M >$@
+sources:
 
-AC_Rep: gen
-       ./gen B R >$@
+$(DESTDIR)$(bindir) :
+       mkdir -p $@
 
-Linker_Options: gen
-       ./gen B L >$@
+install \
+install.libs :: $(DESTDIR)$(bindir) $(ADACURSES_CONFIG)
+       $(INSTALL_SCRIPT) $(ADACURSES_CONFIG) $(DESTDIR)$(bindir)/$(ADACURSES_CONFIG)
 
-Menu_Opt_Rep: gen
-       ./gen M R >$@
+uninstall \
+uninstall.libs ::
+       -rm -f $(DESTDIR)$(bindir)/$(ADACURSES_CONFIG)
 
-Menu_Base_Defs: gen
-       ./gen M B >$@
+$(PROG_GENERATE):  gen.o
+       @ECHO_LD@ $(LINK) $(CFLAGS_NORMAL) gen.o $(ACTUAL_LDFLAGS) -o $@
 
-Menu_Linker_Options: gen
-       ./gen M L >$@
-
-Item_Rep: gen
-       ./gen M I >$@
-
-Form_Opt_Rep: gen
-       ./gen F R >$@
-
-Form_Base_Defs: gen
-       ./gen F B >$@
-
-Form_Linker_Options: gen
-       ./gen F L >$@
-
-Field_Rep: gen
-       ./gen F I >$@
+gen.o: $(srcdir)/gen.c
+       $(HOST_CC) $(CFLAGS_NORMAL) -c -o $@ $(srcdir)/gen.c
 
-Mouse_Base_Defs: gen
-       ./gen P B >$@
+$(ADA_SRCDIR)/$(ABASE)_constants.ads: $(PROG_GENERATE)
+       $(WRAPPER) "$(GENERATE)" >$@
+################################################################################
+$(ADA_SRCDIR)/$(ABASE).ads:    $(srcdir)/$(ABASE).ads.m4 \
+                               $(srcdir)/normal.m4
+       $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
+       $(srcdir)/$(ABASE).ads.m4 |\
+       $(DEL_ADAMODE) >$@
 
-Mouse_Event_Rep: gen
-       ./gen P M >$@
+$(ADA_SRCDIR)/$(ABASE).adb:    $(srcdir)/$(ABASE).adb.m4 \
+                               $(srcdir)/normal.m4
+       $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
+       $(srcdir)/$(ABASE).adb.m4 |\
+       $(DEL_ADAMODE) >$@
 
-Panel_Linker_Options: gen
-       ./gen P L >$@
+$(ADA_SRCDIR)/$(ABASE)-aux.ads: $(srcdir)/$(ABASE)-aux.ads.m4 \
+                               $(srcdir)/normal.m4
+       $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
+       $(srcdir)/$(ABASE)-aux.ads.m4 |\
+       $(DEL_ADAMODE) >$@
 
-$(ADA_SRCDIR)/$(ABASE).ads:    $(srcdir)/$(ABASE).ads.m4 \
-                               $(GEN_FILES1) $(srcdir)/normal.m4
+$(ADA_SRCDIR)/$(ABASE)-trace.ads: $(srcdir)/$(ABASE)-trace.ads.m4 \
+                                 $(srcdir)/normal.m4
        $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
-       $(srcdir)/$(ABASE).ads.m4 |\
+       $(srcdir)/$(ABASE)-trace.ads.m4 |\
        $(DEL_ADAMODE) >$@
 
 $(ADA_SRCDIR)/$(ABASE)-menus.ads: $(srcdir)/$(ABASE)-menus.ads.m4 \
-                                 $(GEN_FILES2) $(srcdir)/normal.m4
+                                 $(srcdir)/normal.m4
        $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
        $(srcdir)/$(ABASE)-menus.ads.m4 |\
        $(DEL_ADAMODE) >$@
 
 $(ADA_SRCDIR)/$(ABASE)-forms.ads: $(srcdir)/$(ABASE)-forms.ads.m4 \
-                                 $(GEN_FILES3) $(srcdir)/normal.m4
+                                 $(srcdir)/normal.m4
        $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
        $(srcdir)/$(ABASE)-forms.ads.m4 |\
        $(DEL_ADAMODE) >$@
 
 $(ADA_SRCDIR)/$(ABASE)-mouse.ads: $(srcdir)/$(ABASE)-mouse.ads.m4 \
-                                 $(GEN_FILES4) $(srcdir)/normal.m4
+                                 $(srcdir)/normal.m4
        $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
        $(srcdir)/$(ABASE)-mouse.ads.m4 |\
        $(DEL_ADAMODE) >$@
@@ -243,6 +237,13 @@ $(ADA_SRCDIR)/$(ABASE)-forms-form_user_data.ads: \
        $(srcdir)/$(ABASE)-forms-form_user_data.ads.m4 |\
        $(DEL_ADAMODE) >$@
 
+$(ADA_SRCDIR)/$(ABASE)-forms-field_types.ads: \
+               $(srcdir)/$(ABASE)-forms-field_types.ads.m4 \
+               $(srcdir)/normal.m4
+       $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
+       $(srcdir)/$(ABASE)-forms-field_types.ads.m4 |\
+       $(DEL_ADAMODE) >$@
+
 $(ADA_SRCDIR)/$(ABASE)-forms-field_user_data.ads: \
                $(srcdir)/$(ABASE)-forms-field_user_data.ads.m4 \
                $(srcdir)/normal.m4
@@ -257,29 +258,96 @@ $(ADA_SRCDIR)/$(ABASE)-panels-user_data.ads: \
        $(srcdir)/$(ABASE)-panels-user_data.ads.m4 |\
        $(DEL_ADAMODE) >$@
 
-install :: 
-
-install.libs ::
-
 install.progs ::
 
 tags:
        ctags *.[ch]
 
-TAGS:
-       etags *.[ch]
+@MAKE_UPPER_TAGS@TAGS:
+@MAKE_UPPER_TAGS@      etags *.[ch]
 
-clean ::
-       rm -f a.out core gen *.o $(GEN_FILES1) $(GEN_FILES2) $(GEN_FILES3) \
-       $(GEN_FILES4) $(GEN_TARGETS)
+mostlyclean ::
+       -rm -f a.out core $(PROG_GENERATE) *.o
 
-mostlyclean :: clean
+clean :: mostlyclean
+       -rm -f $(GEN_TARGETS) instab.tmp *.ad[bs] *.html *.ali *.tmp
 
-distclean :: mostlyclean
-       rm -f Makefile
+distclean :: clean
+       -rm -f $(ADACURSES_CONFIG)
+       -rm -f Makefile
 
 realclean :: distclean
 
+HTML_DIR = @ADAHTML_DIR@
+
+instab.tmp : table.m4 $(GEN_SRC)
+       @rm -f $@
+       @for f in $(GEN_SRC) ; do \
+         $(M4) $(M4FLAGS) -DM4MACRO=table.m4 $$f | $(DEL_ADAMODE) >> $@ ;\
+       done;
+
+$(HTML_DIR)/table.html : instab.tmp
+       @-touch $@
+       @-chmod +w $@
+       @echo '<!DOCTYPE HTML'  > $@
+       @echo 'PUBLIC "-//IETF//DTD HTML 3.0//EN">' >> $@
+       @echo '<HTML>' >> $@
+       @echo '<HEAD>' >> $@
+       @echo '<TITLE>Correspondence between ncurses C and Ada functions</TITLE>' >>$@
+       @echo '</HEAD>' >> $@
+       @echo '<BODY>' >> $@
+       @echo '<H1>Correspondence between ncurses C and Ada functions</H1>' >>$@
+       @echo '<H2>Sorted by C function name</H2>' >>$@
+       @echo '<TABLE ALIGN=CENTER BORDER>' >>$@
+       @echo '<TR ALIGN=LEFT>' >>$@
+       @echo '<TH>C name</TH><TH>Ada name</TH><TH>man page</TH></TR>' >>$@
+       @sort < instab.tmp >> $@
+       @echo '</TABLE></BODY></HTML>' >>$@
+       @rm -f instab.tmp
+
+adahtml:
+       test -n "$(GNATHTML)" || exit 1
+       @find $(HTML_DIR) -type f -exec rm -f {} \;
+       @mkdir -p $(HTML_DIR)
+       cp -p ../src/*.ad[sb] . && chmod +w *.ad[sb]
+@USE_OLD_MAKERULES@    ln -sf ../src/*.ali .
+@USE_GNAT_PROJECTS@    ln -sf ../static-ali/*.ali .
+       @echo "Filtering generated files"
+       @for f in $(GEN_SRC); do \
+          h=`basename $$f` ;\
+          g=`basename $$f .ads.m4` ;\
+          if test "$$g" != "$$h" ; then \
+             $(M4) $(M4FLAGS) -DM4MACRO=html.m4 $$f | $(DEL_ADAMODE) > $$g.ads ;\
+             echo "... $$g.ads" ;\
+          fi \
+       done
+       @-rm -f $(HTML_DIR)/$(ALIB)*.htm*
+       $(GNATHTML) -d -f $(ALIB)*.ads
+       for f in html/$(ALIB)*.htm*; do \
+          a=`basename $$f` ; \
+          sed -e 's/You may also.*body.*//' <$$f |\
+          sed -e 's%GNAT%<A HREF="http://$(GNATHP)">GNAT</A>%g' |\
+          sed -e 's%&lt;A HREF%<A HREF%g' |\
+          sed -e 's%"&gt;%">%g' |\
+          sed -e 's%#1A\([[:space:]]*NAME="[^"]*"\)#2%<A\1>%' |\
+          sed -e 's%#1/A#2%</A>%' |\
+          sed -e 's/3X/3x/g' |\
+          sed -e 's/$$\([ABCDEFGHIJKLMNOPQRSTUVWXZabcdefghijklmnopqrstuvwxz0123456789_]*:.*\)\$$/@\1@/' |\
+          sed -e 's%&lt;/A&gt;%</A>%g' > $$a.tmp ;\
+          mv $$a.tmp $$f ;\
+       done
+       @rm -f *.ad[sb] *.ali *.tmp
+       @for f in funcs.htm main.htm ; do \
+         sed -e "\%<A HREF=funcs/ .htm>\[ \]</A>%d" < html/$$f > $$f ;\
+         mv $$f html/$$f ;\
+       done
+       @rm -f "html/funcs/ .htm"
+       @cp -pdrf html/* $(HTML_DIR)/
+       @rm -rf html
+
+html : adahtml $(HTML_DIR)/table.html
+       @echo made $@
+
 ###############################################################################
 # The remainder of this file is automatically generated during configuration
 ###############################################################################