User:Timothee Flutre/Notebook/Postdoc/2012/11/27: Difference between revisions

From OpenWetWare
Jump to navigationJump to search
(→‎How to make a GNU package?: add files requested by GNU)
(→‎How to make a GNU package?: add autotools info)
Line 10: Line 10:
* find a name for the package
* find a name for the package


* make the structure of the project directory ([http://www.sourceware.org/autobook/autobook/autobook_46.html ref])
* structure the package directory:
  touch README INSTALL NEWS AUTHORS COPYING ChangeLog
  touch README INSTALL NEWS AUTHORS COPYING ChangeLog
  mkdir src doc test lib config
  mkdir src build-aux doc test #lib


* populate the <nowiki>src/</nowiki> directory with your code, e.g. one <nowiki>.cpp</nowiki> file
* populate the <code>src/</code> directory with your code, e.g. <code>hello.cpp</code>


* use Autotools ([http://www.lrde.epita.fr/~adl/autotools.html ref])
* use [http://en.wikipedia.org/wiki/GNU_build_system Autotools] (see [http://www.lrde.epita.fr/~adl/autotools.html tutorial]):
** write the files <code>configure.ac</code> and <code>Makefile.am</code>
** run the tool (repeat until there is no error anymore):
autoreconf --install
./configure #can be followed by --prefix=... or LDFLAGS=...
make
make check
make install
make distclean
make dist
 
* write some documentation
 
* share your code, for instance on [http://en.wikipedia.org/wiki/GitHub GitHub] (see [http://openwetware.org/wiki/User:Timothee_Flutre/Notebook/Postdoc/2012/08/14 my tips])


<!-- ##### DO NOT edit below this line unless you know what you are doing. ##### -->
<!-- ##### DO NOT edit below this line unless you know what you are doing. ##### -->

Revision as of 19:49, 27 November 2012

Project name <html><img src="/images/9/94/Report.png" border="0" /></html> Main project page
<html><img src="/images/c/c3/Resultset_previous.png" border="0" /></html>Previous entry<html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</html>

How to make a GNU package?

  • find a name for the package
  • structure the package directory:
touch README INSTALL NEWS AUTHORS COPYING ChangeLog
mkdir src build-aux doc test #lib
  • populate the src/ directory with your code, e.g. hello.cpp
  • use Autotools (see tutorial):
    • write the files configure.ac and Makefile.am
    • run the tool (repeat until there is no error anymore):
autoreconf --install
./configure #can be followed by --prefix=... or LDFLAGS=...
make
make check
make install
make distclean
make dist
  • write some documentation