NAME
build_sourcetree - create a skeleton source-code tree for an Antelope-dependent software package
SYNOPSIS
build_sourcetree [-v] [-p pfname] project
SUPPORT
Contributed code: NO BRTT support.
THIS PIECE OF SOFTWARE WAS CONTRIBUTED BY THE ANTELOPE USER COMMUNITY. BRTT DISCLAIMS ALL OWNERSHIP, LIABILITY, AND SUPPORT FOR THIS PIECE OF SOFTWARE.
FOR HELP WITH THIS PIECE OF SOFTWARE, PLEASE CONTACT THE CONTRIBUTING AUTHOR.
DESCRIPTION
The
build_sourcetree command takes a short name on the
command-line, usually the name of a project or host organization, and
creates a new skeleton source-code tree (complete with Makefiles, setup scripts,
Make rules, and user environment) for an Antelope-dependent source-code
repository of tools specific to the project or organization. This source-code
tree is then usually imported into a version control system of some sort,
such as CVS, Subversion, or Git, after which it may be populated with
tools and libraries and customized for the specific needs of the organization.
The
build_sourcetree parameter-file specifies the files that go into
the skeleton build structure, and their contents. All necessary subdirectories
will be created during the build process. Files will be auto-filled
upon creation such that the string
__PROJECT__ is replaced with a
capital-letters version of the
project name, the string
__project__ is replaced with a lowercase version of the
project
name, and the string
__BASEDIR__ is replaced with the contents of the
base_dir parameter from the parameter file.
The skeleton source tree comes with many Antelope-style features. Just as
there is are ANTELOPE and ANTELOPEMAKE environment variables (see
antelopeenv(5) and
antelopemakefile(5)), the build_sourcetree command creates
structures around PROJECT and PROJECTMAKE environment variables (with
PROJECT substituted appropriately according to the input project name).
An
/opt/project/X.X/setup.csh file is created. A user-environment in
$PROJECT/data/system is created, with standard environment, alias, path,
and tcshrc defaults (for the latter, once compiled copy
$PROJECT/data/system/tcshrc_defaults to your home directory .tcshrc to
take advantage). A
src/adm/coldstart directory contains a Makefile which
can build everything from first principles the first time it is used,
which can be a nice feature to get going. (Once the module has been compiled
for the first time, it will act more like standard Antelope or Antelope
contributed code and this coldstart feature is no longer necessary).
Standard source directories for Antelope bin, lib, and data files are created.
A set of makerules is created which supports the PROJECTMAKE environment
variable in the same style as
antelopemakefile(5). All of this, of course,
may be modified once the initial skeleton is created.
OPTIONS
-
-p pfname
Specify a parameter-file other than the default build_sourcetree.pf
-
-v
verbose
PARAMETER FILE
-
source_dir
This parameter specifies the directory that is constructed with the new
source-code
-
base_dir
This parameter specifies the top-level directory under which the final
package will be installed, usually /opt (or perhaps /usr/local).
-
make_files_module
This parameter indicates whether to assume there will be a parallel
module with quasi-static files that do not have compile dependencies on
Antelope.
-
files
This array contains one entry for each file to be made in the new
source tree. The key should be a file pathname intended to be relative
to the source_dir (the key may contain directory-separator i.e.
forward-slash characters). The value should be a string value, usually a
pf(5) &Literal assignment, specifying the intended contents of the file.
EXAMPLE
% build_sourcetree anf
% ls -R src
Makefile
adm
bin
data
lib
src/adm:
Makefile
coldstart
docs
setup
src/adm/coldstart:
Makefile
src/adm/docs:
Makefile
anfmakefile.5
src/adm/setup:
Makefile
setup.csh.id
src/bin:
Makefile
db
rt
utility
src/bin/db:
Makefile
src/bin/rt:
Makefile
src/bin/utility:
Makefile
src/data:
Makefile
pf_localmods
system
src/data/pf_localmods:
Makefile
src/data/system:
Makefile
aliasrc
envrc
path
tcsh_properties
tcshrc_default.id
windowbars
src/data/system/path:
Makefile
darwin-intel.id
darwin.id
linux.id
solaris.id
src/lib:
Makefile
makerules
src/lib/makerules:
Makefile
darwin
darwin-intel
linux
solaris
% svn import src svn://localhost/my_repository/project_src_module/trunk
Alternatively
% build_sourcetree anf
%
% cd src/adm/coldstart
%
% make
ANF=/opt/anf/`getid id`; export ANF;
ANFMAKE=/opt/anf/`getid id`/include/anfmake; export ANFMAKE;
( cd ../setup; make install ) ;
( cd ../../lib/makerules; make install ) ;
( cd ../..; make Include ) ;
mkdir /opt/anf/`getid id`/man ;
( cd ../..; make install )
getid < setup.csh.id > setup.csh
deposit setup.csh /opt/anf/4.9
deposit -r darwin-intel /opt/anf/4.9/include/anfmake
+ adm Mon Apr 7 04:52:46 AKDT 2008
+ docs Mon Apr 7 04:52:46 AKDT 2008
+ setup Mon Apr 7 04:52:46 AKDT 2008
+ lib Mon Apr 7 04:52:46 AKDT 2008
+ makerules Mon Apr 7 04:52:46 AKDT 2008
+ bin Mon Apr 7 04:52:46 AKDT 2008
+ db Mon Apr 7 04:52:46 AKDT 2008
+ rt Mon Apr 7 04:52:46 AKDT 2008
+ utility Mon Apr 7 04:52:46 AKDT 2008
+ data Mon Apr 7 04:52:46 AKDT 2008
+ pf_localmods Mon Apr 7 04:52:46 AKDT 2008
+ system Mon Apr 7 04:52:46 AKDT 2008
+ path Mon Apr 7 04:52:46 AKDT 2008
getid < solaris.id > solaris
getid < linux.id > linux
getid < darwin.id > darwin
getid < darwin-intel.id > darwin-intel
deposit -r darwin-intel /opt/anf/4.9/data/system/pathrc
+ adm Mon Apr 7 04:52:46 AKDT 2008
+ docs Mon Apr 7 04:52:46 AKDT 2008
deposit anfmakefile.5 /opt/anf/4.9/man/man5
+ setup Mon Apr 7 04:52:46 AKDT 2008
+ lib Mon Apr 7 04:52:46 AKDT 2008
+ makerules Mon Apr 7 04:52:46 AKDT 2008
+ bin Mon Apr 7 04:52:46 AKDT 2008
+ db Mon Apr 7 04:52:46 AKDT 2008
+ rt Mon Apr 7 04:52:46 AKDT 2008
+ utility Mon Apr 7 04:52:46 AKDT 2008
+ data Mon Apr 7 04:52:46 AKDT 2008
+ pf_localmods Mon Apr 7 04:52:46 AKDT 2008
+ system Mon Apr 7 04:52:46 AKDT 2008
+ path Mon Apr 7 04:52:47 AKDT 2008
getid < tcshrc_default.id > tcshrc_default
deposit envrc /opt/anf/4.9/data/system
deposit aliasrc /opt/anf/4.9/data/system
deposit tcsh_properties /opt/anf/4.9/data/system
deposit tcshrc_default /opt/anf/4.9/data/system
deposit windowbars /opt/anf/4.9/data/system
BUGS AND CAVEATS
The
build_sourcetree command does nothing to alter or enhance
an already-existing source-code tree.
The "coldstart" Makefile created for the source-tree presumes that the
ANTELOPE environment variable and environment are properly set (usually
by sourcing $ANTELOPE/setup.csh or $ANTELOPE/setup.sh). If this is not
true, the coldstart Makefile will fail to perform properly.
The project name is always converted to lowercase for directory names
and to uppercase for environment variable names. It is questionable whether
to enforce this so rigidly.
The parameter-file ends up looking a little unaesthetic, with indentation
omitted to preserve the literal structure of the file contents. The parameter
file is not really meant to be modified by anyone but advanced designers.
AUTHOR
Kent Lindquist
Lindquist Consulting, Inc.
Antelope User Group Contributed Software