Most of the work of building a new release is
encoded in admin/Windows/Makefile.

1) Setup environment

First you will need a cygwin environment.
Search the net for details.  As of this writing,
only the gcc 3.2 compiler is acceptable, later
versions being too slow.  

Note that the gcc 3.2 compiler is missing stdint.h.  
For our purposes you can do the following to get 
around this using:

  cat "#include <sys/types.h>" >/usr/include/stdint.h

You will need to download octave-forge (which
presumably you have already done, otherwise you
wouldn't be reading this) and octave sources.
I put them in /c/src/octave-forge-YYYY.MM.DD
and /c/src/octave-2.1.xx, and I build octave
in /c/src/cygwin/octave-2.1.xx.  If for some 
reason this is not acceptable, modify the top 
few lines of the Makefile to reflect your 
environment.

You will need a directory /opt which has a
number of supplementary packages.  These
will be distributed from the octave-forge
download site.  Grab all of the files listed
in the windows-dev section.

The configuration options are hardcoded in 
config-octave.

2) Build octave and octave-forge

Start in the Windows admin directory.

  cd /c/src/octave-forge/admin/Windows

Update the octave-forge version from cvs:

  (cd /c/src/octave-forge; cvs -q update -dP)

Set your octave version:

  export OCTVER=2.1.xx

Clean out any old version:

  make clean.forge

Invoke the build:

  make 

The results of the build will be in:

  config.octave
  build.octave
  check.octave
  install.octave
  config.forge
  build.forge
  check.forge
  install.forge

If any stage fails for some reason (e.g., because 
routines haven't been ported to cygwin yet), you 
will need to remove the corresponding results file 
in order to rebuild it.  This will likely be 
build.octave or build.forge.

It may be helpful when fixing problems to run
octave-forge in place:

  make run.forge

See the results of the tests:

  less check.octave
  less check.forge

Both will have some errors, but there shouldn't be
too many.


The following make targets are available:

  setup
    * create /opt/octave-2.1.xx
    * unpack packages in /opt/PACKAGE.tar.gz
    * build stdc++.dll

  config -> config.octave
    * remove single-precision lapack requirements
    * call ./configure with the appropriate options 

  build -> build.octave
    * call make in the octave directory

  check -> check.octave
    * calls make check in the octave directory

  install -> install.octave
    * calls make install in the octave directory

  docs
    * copies octave docs to the install directory

  clean.forge
    * call make clean in the octave-forge directory
  config.forge -> config.forge
    * call ./autogen.sh and ./configure in octave-forge
  build.forge -> build.forge
    * call make in octave-forge
  check.forge -> check.forge
    * call make check in octave-forge
  install.forge -> install.forge
    * call make install in octave-forge


  cygwin
    * sets up a cygwin environment for octave, taken
      from the current environment.  The list of
      cygwin files is hard-coded.  You may need a
      different list for your version of cygwin.  This
      is only needed for constructing a new distribution.

  dist
    * use nsis to build a new octave distribution.

3) Try out the new build.

You should be able to run the octave with

  /opt/octave-2.1.xx/bin/octave

4) Create a new release

To build a release distribution, you will need the Nullsoft NSIS 2.0
installer from 

  http://www.nullsoft.com/free/nsis/#download

Hack the links
	# Some hand modifications were done in /opt/octave/bin
	# /opt/octave/libexec/.../oct and opt/octave/libexec/...octave-forge
	# to replace linked files with *.link, where *.link contains
	# the required link command:  ln -sf base name
	# This process needs to be automated, but I don't know how.

	# find all links
	find /opt/octave-2.1.57 -type l

To build the installer, use:

  make dist

Paul Kienzle
2004-09-29
