Robert G. Brown
Duke University Physics Department
Durham, NC 27708-0305
Copyright Robert G. Brown, 2013
project_c is a C source project template that permits fully
automagical project maintenance to be done with some simple (and not so
simple) make targets: make tgz, make rpm, make installweb, make cvs
for example. It is worth several hours of work, minimally, in getting
a project off the ground, and gets it off on the right foot, with a lot
of things you might add "eventually" already there in template form,
ready to fill in.
project actually installs from the tarball ONLY -- or if you prefer,
the tarball IS the project template ready to use -- but this page and
distribution set is more or less automagically created by the make
installweb target, so it seems worthwhile to include the rpm's even if
they only install a trivial "Hello World!" program.
To use this template, create or change to your source or template
directory (I use $HOME/Src/Templates but suit yourself), put the
project_c-version.tgz there and unpack it:
tar xvfz project_c-version.tgz
where of course you should use whatever version of this template that
you downloaded. It should verbosely unpack.
Change into the project_c directory. There is a README that gives
instructions on how to use to the template (basically, these
instructions). Most of the mucky part of the process is encapsulated in
a script called "newproject_c". It will install into $HOME/bin (by
default, or edit the Makefile to put it whereever you'd like). Read the
newproject_c script to see how it works.
To use it is really easy. Once you've unpacked project_c in your
templates directory, and if necessary edited newproject_c to point to
that templates directory, enter "make installnew". This copies
newproject_c into $HOME/bin (or anywhere on your PATH that you like) as
noted above. Then simply change into your working/source directory,
e.g. $HOME/Src. Enter:
./projectname (and Hello World example should run).
During the install process, it will ask if you want to directly put
the new project under subversion control. If you answer yes it will try
to do so into (by default) $HOME/Src/svn-tree/projectname. If you want
it anywhere else, or use subversion differently than I do, feel free to
hack newproject_c to make it work the way that you like.
If you want to use the make rpm targets, additionally you must:
Optionally edit the man page template, the README, the abstract, the
php file, Remember, the man page is your friend. Also remember to
update/modify the "Usage" statement in parsecl.c as you add new command
line commands, if any.
If you grab this project_c template and have any fundamental trouble
getting it working, let me know and I'll try to help you. My email
address is rgb at phy dot duke dot edu.