-> Note: this file is a template used by the Perl script 'get_contents'. -> get_contents reads this file and the CONTENTS files in each -> subdirectory then creates the new_developer.html file by -> populating the "Where does your code belong" section. -> Albert Danial Jan 2 2002
|
Home | Summary | Forums | Bugs | Support | Patches | Lists | Tasks | Docs | Surveys | News | CVS | Files
If you've never submitted code to a SourceForge project before, create your home directory by logging onto the octave-forge account with ssh:
$ ssh -l sflogin cvs.octave.sourceforge.net Password: your SF passwordAlthough SF will only show you a message-of-the-day screen then log you out, this process has the useful side effect of creating a home directory for you if one doesn't already exist. Some CVS commands will fail if you do not have a home directory on SF.
$ cd working_directory $ export CVS_RSH=ssh $ cvs -d:ext:sflogin@cvs.sourceforge.net:/cvsroot/octave co octave-forge
Each file in octave-forge must contain a copyright notice. If you wish to release your code under the GNU GPL , insert the following text at the top of your file:
## Copyright (C) year Your Name <your@preferred.email> ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USAHere are other popular open source licenses: Consult opensource.org. for a comprehensive list of Open Source licenses.
include ../../Makeconf all: f1.oct clean: ; -$(RM) *.o core octave-core *.oct *~
If you define multiple DEFUN_DLD's in a file, you may need to use symbolic links in order for Octave to find them:
include ../../Makeconf # extra functions defined in fn.oct fn_LINKS=fn2.oct fn3.oct # all compiled functions PROGS=fn.oct $(fn_LINKS) gn.oct all: $(PROGS) $(PROGS): Makefile $(fn_LINKS): -$(RM) $@ $(LN_S) fn.oct $@ clean: ; -$(RM) *.o core octave-core *.oct *~
The "include ../../Makeconf" line above includes all of the definitions that were created during configuration. This includes things like MKOCTFILE, as well as implicit rules for compiling oct-files. See Makeconf.base for a list of predefined variables and rules. Sometimes you will see "sinclude ../../Makeconf". This is for packages which can be compiled independently of Octave-forge. If Octave-forge is configured, then the variable OCTAVE_FORGE will be defined.
Even more complicated makefiles are sometimes necessary, particularly when the package depends on external libraries. See main/symbolic/Makefile for an example. The external libraries must be found during configure so main/symbolic/configure.add provides detection rules. The results are posted in main/symbolic/Makeconf.add, and will be available during make.
Please try to keep compatibility with older versions of Octave. The main configure script tests for features that have changed since octave-2.1.36. The tests are done in such a way that conditions are only defined if you are using an older version of octave. That way if the tests are not performed and the conditions are not defined, support defaults to the newer version of octave. The following conditions are defined in configure.base:
#ifdef HAVE_SLLIST_H
#define LIST SLList
#define LISTSIZE length
#define SUBSREF_STRREF
#else
#include <list>
#define LIST std::list
#define LISTSIZE size
#define SUBSREF_STRREF &
#endif
...
octave_value subsref (const std::string SUBSREF_STRREF type,
const LIST<octave_value_list>& idx) {
...
}
octave_value_list subsref (const std::string SUBSREF_STRREF type,
const LIST<octave_value_list>& idx,
int nargout) {
...
if (idx.LISTSIZE () > 1)
...
}
#ifdef NEED_OCTAVE_QUIT
#define OCTAVE_QUIT do {} while (0)
#define BEGIN_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE
#define END_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE
#define octave_throw_bad_alloc() \
do { jump_to_top_level(); panic_impossible(); } while (0)
#else
#include <octave/quit.h>
#endif
#ifdef USE_OCTAVE_NAN
#define lo_ieee_nan_value() octave_NaN
#define lo_ieee_inf_value() octave_Inf
#endif
m-file support across multiple versions is tricky. Sometimes try/catch will help, but for syntax changes you will need some sort of preprocessor, such as awk or sed.
$ cvs add files $ cvs commit filesAfter hitting the carriage return at the end of the commit command, CVS will open your default editor so that you can enter comments about the commit. The first time you commit a file the comment might be something as simple as `Initial commit into CVS.' However, for all subsequent commits please add meaningful comments that explain why changes were made to the file since all comments will appear in the changelog. Try to gather related changes into one commit command.
Aside: the default editor can be defined like so:
$ export EDITOR=vim
If you are uploading an entire package, then put your directory into the octave-forge tree and do the following:
$ cd octave-forge/main $ cvs add package $ cvs commit package $ cd package $ cvs add * $ cvs commit *You may find it easier to use the import command, especially if your package contains subdirectories. In this case, you should not put your directory into the octave-forge tree. Instead, change to the root of your package tree and enter the following:
$ cd package $ cvs -d:ext:sflogin@cvs.octave.sourceforge.net:/cvsroot/octave import -m "package name" octave-forge/main/package sflogin startYou can then fetch the new package from octave-forge as follows:
$ cd octave-forge $ cvs -q update -d
From time to time, you will need to synchronize with CVS:
$ cd octave-forge $ cvs -q update -dEach file will be listed with one of the following codes: