ncurses 5.2
[ncurses.git] / Ada95 / gen / Makefile.in
index 6ebf0c5ef04b51c26b366a1428f45097d362af92..b1651379df2828b9a686b7a042a507549a6ee9d8 100644 (file)
 # authorization.                                                             #
 ##############################################################################
 #
-#  Author: Juergen Pfeifer <Juergen.Pfeifer@T-Online.de> 1996
+#  Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1996
 #
 #  Version Control
-#  $Revision: 1.18 $
+#  $Revision: 1.34 $
 #
 .SUFFIXES:
 
 SHELL          = /bin/sh
 THIS           = Makefile
 
+x              = @PROG_EXT@
+
 top_srcdir     = @top_srcdir@
+DESTDIR                = @DESTDIR@
 srcdir         = @srcdir@
 prefix         = @prefix@
 exec_prefix    = @exec_prefix@
-libdir         = @libdir@
-includedir     = @includedir@
-datadir                = @datadir@
-ticdir         = $(datadir)/terminfo
-ADA_INCLUDE    = @ADA_INCLUDE@
-ADA_OBJECTS    = @ADA_OBJECTS@
+ADA_INCLUDE    = $(DESTDIR)@ADA_INCLUDE@
+ADA_OBJECTS    = $(DESTDIR)@ADA_OBJECTS@
 
 INSTALL                = @INSTALL@
 INSTALL_DATA   = @INSTALL_DATA@
@@ -53,14 +52,13 @@ INSTALL_DATA        = @INSTALL_DATA@
 AWK            = @AWK@
 LN_S           = @LN_S@
 
-CC             = @CC@
+HOST_CC                = @BUILD_CC@
 CFLAGS         = @CFLAGS@
 
 CPPFLAGS       = @ACPPFLAGS@ \
                  -DHAVE_CONFIG_H -I$(srcdir)
 
 CCFLAGS                = $(CPPFLAGS) $(CFLAGS)
-
 CFLAGS_NORMAL  = $(CCFLAGS)
 CFLAGS_DEBUG   = $(CCFLAGS) @CC_G_OPT@ -DTRACE
 CFLAGS_PROFILE = $(CCFLAGS) -pg
@@ -68,24 +66,29 @@ CFLAGS_SHARED       = $(CCFLAGS) @CC_SHARED_OPTS@
 
 CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@)
 
-LINK           = $(CC)
+LINK           = $(HOST_CC)
 LD_FLAGS       = @LD_MODEL@ $(LOCAL_LIBS) @LDFLAGS@ @LIBS@ @LOCAL_LDFLAGS2@ $(LDFLAGS)
 
 RANLIB         = @RANLIB@
 
-LIB_CURSES      = -L ../../lib -lncurses
+LIB_CURSES      = -L../../lib -lncurses@LIB_SUFFIX@
 
 M4             = m4
 M4FLAGS                =
 
+GENERATE       = ./gen$x '@DFT_ARG_SUFFIX@'
 DEL_ADAMODE    = sed -e '/^\-\-\ \ \-\*\-\ ada\ \-\*\-.*/d'
 
+GNATHTML       = `type -p gnathtml || type -p gnathtml.pl`
+GNATHP          = www.gnat.com
+MAIL            = juergen.pfeifer@gmx.net
+HOMEP           = home.t-online.de/home/Juergen.Pfeifer
+
 ################################################################################
 ALIB            = @cf_ada_package@
 ABASE          = $(ALIB)-curses
 
-ADA_SRCDIR     = ../ada_include
-ADA_OBJDIR      = ../ada_objects
+ADA_SRCDIR     = ../src
 
 GEN_FILES0      = Base_Defs
 
@@ -97,6 +100,7 @@ GEN_FILES1      = Key_Definitions                            \
                  ACS_Map                               \
                  Linker_Options                        \
                  Base_Defs                             \
+                 Window_Offsets                        \
                  Version_Info
 
 GEN_FILES2      = Menu_Opt_Rep                         \
@@ -111,9 +115,14 @@ GEN_FILES3      = Form_Opt_Rep                             \
 
 GEN_FILES4      = Mouse_Base_Defs                              \
                  Mouse_Event_Rep                       \
+                 Mouse_Events                          \
                  Panel_Linker_Options
 
+GEN_FILES5     = Chtype_Def                            \
+                 Eti_Defs
+
 GEN_TARGETS     = $(ADA_SRCDIR)/$(ABASE).ads                           \
+                 $(ADA_SRCDIR)/$(ABASE)-aux.ads                        \
                  $(ADA_SRCDIR)/$(ABASE)-menus.ads                      \
                  $(ADA_SRCDIR)/$(ABASE)-forms.ads                      \
                  $(ADA_SRCDIR)/$(ABASE)-mouse.ads                      \
@@ -126,6 +135,7 @@ GEN_TARGETS     = $(ADA_SRCDIR)/$(ABASE).ads                                \
                  $(ADA_SRCDIR)/$(ABASE)-panels-user_data.ads
 
 GEN_SRC                = $(srcdir)/$(ABASE).ads.m4                             \
+                 $(srcdir)/$(ABASE)-aux.ads.m4                         \
                  $(srcdir)/$(ABASE)-menus.ads.m4                       \
                  $(srcdir)/$(ABASE)-forms.ads.m4                       \
                  $(srcdir)/$(ABASE)-mouse.ads.m4                       \
@@ -138,102 +148,116 @@ GEN_SRC         = $(srcdir)/$(ABASE).ads.m4                             \
                  $(srcdir)/$(ABASE)-panels-user_data.ads.m4
 
 
-all:   $(ADA_OBJDIR) $(GEN_TARGETS)
+all \
+libs : $(GEN_TARGETS)
        @
 
 sources:
 
-$(ADA_OBJDIR) \
 $(ADA_INCLUDE) \
 $(ADA_OBJECTS) :
        $(top_srcdir)/mkinstalldirs $@
 
 install \
 install.libs :: $(ADA_INCLUDE)
-       @echo installing package $(ABASE) in $(ADA_INCLUDE)
-       @$(top_srcdir)/tar-copy.sh '$(ABASE)[-.]*' $(ADA_SRCDIR) $(ADA_INCLUDE)
-       @test $(srcdir) != ./ && $(top_srcdir)/tar-copy.sh '$(ABASE)[-.]*' $(srcdir)/../ada_include $(ADA_INCLUDE)
+       @echo installing package $(ALIB) in $(ADA_INCLUDE)
+       @$(top_srcdir)/tar-copy.sh '$(ALIB)[-.]*.ad?' $(ADA_SRCDIR) $(ADA_INCLUDE)
+       @test $(srcdir) != ./ && $(top_srcdir)/tar-copy.sh '$(ALIB)[-.]*.ad?' $(srcdir)/../src $(ADA_INCLUDE)
 
 install \
 install.libs :: $(ADA_OBJECTS)
-       @echo installing package $(ABASE) in $(ADA_OBJECTS)
-       @$(top_srcdir)/tar-copy.sh '$(ABASE)[-.]*' $(ADA_OBJDIR) $(ADA_OBJECTS)
+       @echo installing package $(ALIB) in $(ADA_OBJECTS)
+       @chmod a-wx $(ADA_SRCDIR)/*.ali
+       @$(top_srcdir)/tar-copy.sh '$(ALIB)[-.]*.ali' $(ADA_SRCDIR) $(ADA_OBJECTS)
+       @chmod u+x $(ADA_SRCDIR)/*.ali
 
 uninstall \
 uninstall.libs ::
-       @echo removing package $(ABASE) from $(ADA_INCLUDE)
-       -@cd $(ADA_INCLUDE) && rm -f $(ABASE)[-.]*
+       @echo removing package $(ALIB) from $(ADA_INCLUDE)
+       -@cd $(ADA_INCLUDE) && rm -f $(ALIB)[-.]*
 
 uninstall \
 uninstall.libs ::
-       @echo removing package $(ABASE) from $(ADA_OBJECTS)
-       -@cd $(ADA_OBJECTS) && rm -f $(ABASE)[-.]*
+       @echo removing package $(ALIB) from $(ADA_OBJECTS)
+       -@cd $(ADA_OBJECTS) && rm -f $(ALIB)[-.]*
 
-gen:   gen.o
+gen$x: 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
+       $(HOST_CC) $(CFLAGS_NORMAL) -c -o $@ $(srcdir)/gen.c
+
+Character_Attribute_Set_Rep: gen$x
+       $(GENERATE) B A >$@
+
+Base_Defs: gen$x
+       $(GENERATE) B B >$@
+
+Color_Defs: gen$x
+       $(GENERATE) B C >$@
 
-Character_Attribute_Set_Rep: gen
-       ./gen B A >$@
+Key_Definitions: gen$x
+       $(GENERATE) B K >$@
 
-Base_Defs: gen
-       ./gen B B >$@
+Old_Keys: gen$x
+       $(GENERATE) B O >$@
 
-Color_Defs: gen
-       ./gen B C >$@
+ACS_Map: gen$x
+       $(GENERATE) B M >$@
 
-Key_Definitions: gen
-       ./gen B K >$@
+AC_Rep: gen$x
+       $(GENERATE) B R >$@
 
-Old_Keys: gen
-       ./gen B O >$@
+Linker_Options: gen$x
+       $(GENERATE) B L >$@
 
-ACS_Map: gen
-       ./gen B M >$@
+Version_Info: gen$x
+       $(GENERATE) B V >$@
 
-AC_Rep: gen
-       ./gen B R >$@
+Window_Offsets: gen$x
+       $(GENERATE) B D >$@
 
-Linker_Options: gen
-       ./gen B L >$@
+Menu_Opt_Rep: gen$x
+       $(GENERATE) M R >$@
 
-Version_Info: gen
-       ./gen B V >$@
+Menu_Base_Defs: gen$x
+       $(GENERATE) M B >$@
 
-Menu_Opt_Rep: gen
-       ./gen M R >$@
+Menu_Linker_Options: gen$x
+       $(GENERATE) M L >$@
 
-Menu_Base_Defs: gen
-       ./gen M B >$@
+Item_Rep: gen$x
+       $(GENERATE) M I >$@
 
-Menu_Linker_Options: gen
-       ./gen M L >$@
+Form_Opt_Rep: gen$x
+       $(GENERATE) F R >$@
 
-Item_Rep: gen
-       ./gen M I >$@
+Form_Base_Defs: gen$x
+       $(GENERATE) F B >$@
 
-Form_Opt_Rep: gen
-       ./gen F R >$@
+Form_Linker_Options: gen$x
+       $(GENERATE) F L >$@
 
-Form_Base_Defs: gen
-       ./gen F B >$@
+Field_Rep: gen$x
+       $(GENERATE) F I >$@
 
-Form_Linker_Options: gen
-       ./gen F L >$@
+Mouse_Base_Defs: gen$x
+       $(GENERATE) P B >$@
 
-Field_Rep: gen
-       ./gen F I >$@
+Mouse_Event_Rep: gen$x
+       $(GENERATE) P M >$@
 
-Mouse_Base_Defs: gen
-       ./gen P B >$@
+Mouse_Events: gen$x
+       $(GENERATE) B E >$@
 
-Mouse_Event_Rep: gen
-       ./gen P M >$@
+Panel_Linker_Options: gen$x
+       $(GENERATE) P L >$@
 
-Panel_Linker_Options: gen
-       ./gen P L >$@
+Chtype_Def: gen$x
+       $(GENERATE) E C >$@
+
+Eti_Defs: gen$x
+       $(GENERATE) E E >$@
 
 $(ADA_SRCDIR)/$(ABASE).ads:    $(srcdir)/$(ABASE).ads.m4 \
                                $(GEN_FILES1) $(srcdir)/normal.m4
@@ -241,6 +265,12 @@ $(ADA_SRCDIR)/$(ABASE).ads:        $(srcdir)/$(ABASE).ads.m4 \
        $(srcdir)/$(ABASE).ads.m4 |\
        $(DEL_ADAMODE) >$@
 
+$(ADA_SRCDIR)/$(ABASE)-aux.ads: $(srcdir)/$(ABASE)-aux.ads.m4 \
+                               $(GEN_FILES5) $(srcdir)/normal.m4
+       $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
+       $(srcdir)/$(ABASE)-aux.ads.m4 |\
+       $(DEL_ADAMODE) >$@
+
 $(ADA_SRCDIR)/$(ABASE)-menus.ads: $(srcdir)/$(ABASE)-menus.ads.m4 \
                                  $(GEN_FILES2) $(srcdir)/normal.m4
        $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
@@ -316,20 +346,84 @@ TAGS:
        etags *.[ch]
 
 mostlyclean ::
-       -rm -f a.out core gen *.o
+       -rm -f a.out core gen$x *.o
        -rm -f $(GEN_FILES1)
        -rm -f $(GEN_FILES2)
        -rm -f $(GEN_FILES3)
        -rm -f $(GEN_FILES4)
+       -rm -f $(GEN_FILES5)
 
 clean :: mostlyclean
-       -rm -f $(GEN_TARGETS)
+       -rm -f $(GEN_TARGETS) instab.tmp *.ad[bs] *.html *.ali *.tmp
 
 distclean :: clean
        rm -f Makefile
 
 realclean :: distclean
 
+HTML_DIR = ../../doc/html/ada
+
+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:
+       @rm -rf $(HTML_DIR)/
+       @mkdir -p $(HTML_DIR)
+       cp -p ../src/*.ad[sb] . && chmod +w *.ad[sb]
+       ln -sf ../src/*.ali .
+       for f in $(GEN_SRC); do \
+          g=`basename $$f .ads.m4` ;\
+          $(M4) $(M4FLAGS) -DM4MACRO=html.m4 $$f | $(DEL_ADAMODE) > $$g.ads ;\
+       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/3X/3x/g' |\
+          sed -e 's/$$\([A-Za-z0-9_]*:.*\)\$$/@\1@/' |\
+          sed -e 's%Juergen Pfeifer%<A HREF="http://$(HOMEP)">J\&uuml;rgen Pfeifer</A>%g' |\
+          sed -e 's%$(MAIL)%<A HREF="mailto:$(MAIL)">\&lt;$(MAIL)\&gt;</A>%g' |\
+          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
+       @
+
 ###############################################################################
 # The remainder of this file is automatically generated during configuration
 ###############################################################################