
Installation
____________

To create and install the BeBOP interpreter bp, the bebop compiler, and
the pnp preprocessor, follow these steps :


   1. Note down the absolute path name of where the final created
      system is to be installed. This will become the value for the
      INSTALLDIR macro in the Makefile.

   2. Edit the top level Makefile.  All macros needed to make the
      system are defined here and should be changed to reflect the
      configuration of your local machine, and placement of the final
      system.

   3. Type make. A series of messages indicating the progress of the
      compilation will be generated. During this process you will be
      asked to edit the bebop.h header file.  The following output is
      generated by the execution of make (this may vary sligtly if you
      are using cc) :

      Changing to bp directory.

      Creating the bp interpreter, hold on a minute....

              /bin/cat bound.nl call_class.nl demo.nl pcall.nl send.nl
              loadfiles.nl bebop_comp.nl flushwrite.nl > bebop_util.nl
              nc -c bebop_util.nl

      Reading and compiling bebop_util.nl.
      %		Time was     4.669s
               nc -c bebop.nl

      Reading and compiling bebop.nl.
      %		Time was    10.047s
               nc -o bp bebop_util.no bebop.no
      Warning: main/1 redefined

      Changing to compiler directory.

      Creating the bebop compiler, hold on a minute.....

      PLEASE EDIT THIS FILE, I WILL INVOKE THE EDITOR FOR YOU

      /* The editor will be invoked on the bebop.h file.
          You will now have the opportunity to change the
          default paths for the nc and pnp compilers. If
          you do change the paths, you will also have to
          change the associated length #define statements.
      */

      THANK YOU FOR EDITING THE HEADER FILE, NOW COMPILING

      ******* Expect 2 shift/reduce conflicts *********
      ***** See compiler/CHANGES for more info ********

               yacc -vdtl parse.y
      conflicts: 2 shift/reduce
               /bin/mv y.tab.c parse.c
               gcc -ansi -O    -Wall -Wshadow -Wid-clash-20 -Wpointer-arith
      -Wcast-qual -DDYYDEBUG  -c parse.c
      parse.c: In function yyparse:
      parse.c:2098: warning: label `yyerrlab' defined but not used
      parse.c:1928: warning: label `yynewstate' defined but not used
               /bin/cmp -s y.tab.h tokens.h __ cp y.tab.h tokens.h

               lex lexical.l
               /bin/mv lex.yy.c lexical.c
               gcc -O    -Wall -Wshadow -Wid-clash-20 -Wpointer-arith
      -Wcast-qual -DDYYDEBUG  -c lexical.c
      lexical.c: In function yylex:
      lexical.c:135: warning: return-type defaults to `int'
      lexical.c: In function yylex:
      lexical.c:136: warning: unused variable `yyprevious'
      lexical.c:138: warning: label `yyfussy' defined but not used

               gcc -ansi -O    -Wall -Wshadow -Wid-clash-20 -Wpointer-arith
      -Wcast-qual  -Wwrite-strings -DDYYDEBUG  -c error.c
               gcc -ansi -O    -Wall -Wshadow -Wid-clash-20 -Wpointer-arith
      -Wcast-qual  -Wwrite-strings -DDYYDEBUG  -c bebop.c
               gcc -ansi -O    -Wall -Wshadow -Wid-clash-20 -Wpointer-arith
      -Wcast-qual  -Wwrite-strings -DDYYDEBUG  -c symbol.c
               gcc -ansi -O    -Wall -Wshadow -Wid-clash-20 -Wpointer-arith
      -Wcast-qual  -Wwrite-strings -DDYYDEBUG  -c dump_tree.c
               gcc -ansi -O    -Wall -Wshadow -Wid-clash-20 -Wpointer-arith
      -Wcast-qual  -Wwrite-strings -DDYYDEBUG  -c free_tree.c
               gcc -ansi -O    -Wall -Wshadow -Wid-clash-20 -Wpointer-arith
      -Wcast-qual  -Wwrite-strings -DDYYDEBUG  -c compile.c
               gcc -ansi -O    -Wall -Wshadow -Wid-clash-20 -Wpointer-arith
      -Wcast-qual  -Wwrite-strings -DDYYDEBUG  -c bebop_functions.c
               gcc -ansi -O    -Wall -Wshadow -Wid-clash-20 -Wpointer-arith
      -Wcast-qual  -Wwrite-strings -DDYYDEBUG parse.o lexical.o error.o
      bebop.o symbol.o dump_tree.o  free_tree.o compile.o
      bebop_functions.o -o bebop -lc_s -ll -ly

      Changing to pnp directory. Making the pnp processor

               nc -F sequential -c pnp.nl
      Reading and compiling pnp.nl.
      %        Time was     1.600s

               nc -F sequential -c assert2.nl
      Reading and compiling assert2.nl.
      %        Time was     1.330s

               nc -F sequential -c ledet1.nl
      Reading and compiling ledet1.nl.
      %        Time was     6.849s

               nc -F sequential -c ledet2.nl
      Reading and compiling ledet2.nl.
      %        Time was     2.629s

               nc -o pnp pnp.no  assert2.no  ledet1.no  ledet2.no
      Warning: main/1 redefined


   4. Now type make install to copy the created binaries into the
      installation directory as specified in the INSTALLDIR macro.

      Both the bp and pnp files contain an exec command for starting
      NU-Prolog from bp.save and pnp.save respectively.  The bp and pnp
      files require the absolute path name of the saved files and so an
      editor will be invoked so that the noted INSTALLDIR macro value
      can be typed in.  The path to bp.save and pnp.save between the -R
      option and -a option should be replaced by the INSTALLDIR path.

      Thus, in bp.save change

          ...... -R <old_path>/bp.save -a $......
      to
          ...... -R <new_path>/bp.save -a $......

   5. The source directories can now be cleaned by typing make clobber.
      This removes unnecessary .o files, and files that have been copied
      to INSTALLDIR.

