Add a new project: Difference between revisions

From VrlWiki
Jump to navigation Jump to search
No edit summary
 
(6 intermediate revisions by the same user not shown)
Line 8: Line 8:
Each directory in your project will need it's own '''Makefile'''.  If your project has several directories it is a convention to create a top level '''Makefile''' to build all of them.  The G Build system is invoked from your make files to provide a common simple build mechanism.  Sample make files and instructions on how to use the G Build system are here:
Each directory in your project will need it's own '''Makefile'''.  If your project has several directories it is a convention to create a top level '''Makefile''' to build all of them.  The G Build system is invoked from your make files to provide a common simple build mechanism.  Sample make files and instructions on how to use the G Build system are here:


http://sourceforge.net/apps/mediawiki/vrg3d/index.php?title=Writing_Make_Files
*[[Writing Make Files]]




Line 14: Line 14:
'''common/build/make'''
'''common/build/make'''


These examples show how to [[Build a Trivial Program]] and [[Build a Trivial Library]].


You should also include some simple tests.  See [[Software tests|Create and automate software tests]] for details.
You should also include some simple tests.  See [[Software tests|Create and automate software tests]] for details.


== Write a Test ==


It is also a good idea to provide one or more quick tests that can be included in the test suite we run each night.  Tests need to run in batch mode and simply return a zero status if successful and non-zero if they fail.
== Check In the Project ==


Ideally in the top level directory you should declare a make target to run the testTypically if there is only one test the target name is '''"test"'''When there are several each target name should use the prefix '''"test."''' plus include a composite target to run all of them with the name '''"alltest"'''.  This way they can all be run when you type '''"make  alltest"'''.
Once you are ready you can check in your projectYou will probably have files in your directory that do not belong in CVSOnly the source code, make files, and files essential for building and running the project should be checked in.


After you've checked in the code, check it out into a test directory and verify that it builds and runs.  If there are files unintentionally checked in be sure to remove them from the CVS repository.
Some essential CVS commands for checking new code into the repository are:


== Check In the Project ==
> cvs add    -m "<comment>" <directory>    # Create a new directory.
 
> cvs add    -m "<comment>" <file>  ...    # Add new files.
> cvs commit -m "<comment>" <file>  ...
 
 
The repository is primarily for source code, but in some cases binary files need to be checked in.  These should be reasonably small.  Large datasets are stored in '''/map/gfx0/data/''' directory.


Once you are ready you can check in your project. You will probably have files in your directory that do not belong in CVSOnly the source code, make files, and files essential for building an running the project should be checked in.
> cvs add -kb  -m "<comment>" <file>  ...  # Add new binary files.
  > cvs commit  -m "<comment>" <file>  ...

Latest revision as of 16:31, 19 November 2010

Write and Build Project Code

Projects can be added to CVS under either the common/ directory (shared code) or the project/ directory (project specific code). Your code should be in a subdirectory of these in your sandbox. The following command examples are for Linux.

> mkdir -p  /map/gfx0/users/$USER/project/<my_project>


Each directory in your project will need it's own Makefile. If your project has several directories it is a convention to create a top level Makefile to build all of them. The G Build system is invoked from your make files to provide a common simple build mechanism. Sample make files and instructions on how to use the G Build system are here:


If you want to inspect the build files they are in:
common/build/make

These examples show how to Build a Trivial Program and Build a Trivial Library.

You should also include some simple tests. See Create and automate software tests for details.


Check In the Project

Once you are ready you can check in your project. You will probably have files in your directory that do not belong in CVS. Only the source code, make files, and files essential for building and running the project should be checked in.

Some essential CVS commands for checking new code into the repository are:

> cvs add    -m "<comment>" <directory>     # Create a new directory.
> cvs add    -m "<comment>" <file>  ...     # Add new files.
> cvs commit -m "<comment>" <file>  ...


The repository is primarily for source code, but in some cases binary files need to be checked in. These should be reasonably small. Large datasets are stored in /map/gfx0/data/ directory.

> cvs add -kb  -m "<comment>" <file>  ...   # Add new binary files.
> cvs commit   -m "<comment>" <file>  ...