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.  I'm assuming it is installed
in C:.  If it is in D:, then you will need to change
C: to D: and /cygdrive/c to /cygdrive/d below.

As of this writing, only the gcc 3.2 compiler is 
acceptable, later versions being too slow.  Search
the octave-forge mailing list archives for details
where you can find the right cygwin packages.

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

  if test ! -f /usr/include/stdint.h
  then cat "#include <sys/types.h>" >/usr/include/stdint.h
  fi

Within cygwin, create a few directories:

  mkdir /cygdrive/c/src        # SOURCE
  mkdir /cygdrive/c/src/cygwin # BUILD
  mkdir /opt                   # DEST

Unbundle octave-forge-YYYY.MM.DD.tar.gz in the SOURCE directory:

  tar xzf octave-forge-YYYY.MM.DD.tar.gz -C /cygdrive/c/src

or use CVS:

  cd /cygdrive/c/src
  cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/octave login
  cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/octave co octave-forge

If you are using different SOURCE BUILD and DEST directories
you will need to change octave-forge/admin/Windows/Makefile
to reflect the directories you are actually using.

Download the various windows-dev packages from the
octave-forge download site into C:\cygwin\opt:

  http://sourceforge.net/project/showfiles.php?group_id=2888

These will be unbundled automatically during build.

Download the latest octave from the octave download site 
into C:\src:

  http://www.octave.org/download

This will be unbundled automatically during build.


2) Build octave and octave-forge

Start in the Windows admin directory.

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

If using CVS, update the octave-forge version:

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

Set your octave version:

  export OCTVER=2.1.xx

Clean out any old version of octave-forge and force reconfigure/rebuild:

  make clean

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.

If external packages are causing a problem, remove
them from the EXTERNAL_PACKAGES line in the Makefile.

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

Update the Makefile with NSIS containing the path to your 
makensis.exe.  You will probably need to set WINDEST to
C:\\cygwin\\opt\\octave-${OCTVER} as well since currently
I'm building into C:\opt.

To build the installer, use:

  make dist

Paul Kienzle
2004-11-30
