[Assorted-commits] SF.net SVN: assorted: [498] simple-build/trunk/README
Brought to you by:
yangzhang
From: <yan...@us...> - 2008-02-24 20:48:10
|
Revision: 498 http://assorted.svn.sourceforge.net/assorted/?rev=498&view=rev Author: yangzhang Date: 2008-02-24 12:48:14 -0800 (Sun, 24 Feb 2008) Log Message: ----------- added a bunch of information to the readme Modified Paths: -------------- simple-build/trunk/README Modified: simple-build/trunk/README =================================================================== --- simple-build/trunk/README 2008-02-24 20:47:57 UTC (rev 497) +++ simple-build/trunk/README 2008-02-24 20:48:14 UTC (rev 498) @@ -1,12 +1,16 @@ +% SimpleBuild +% Yang Zhang + Overview -------- -Keep your builds as simple as possible. Never repeat yourself. Separation of -rules from declared goals. - Eventually aims to be a complete solution for software configuration, building, installation and distribution. +Some vague principles: keep your build configurations as tiny as possible. +Leverage/target existing build and package systems. Lots of features. +Extensibility. Portability. Cross-language. Cross-project. Etc. + Current features: - out-of-the-box support for C, C++, Java, Scala @@ -19,7 +23,49 @@ my case, the culprits are often C++ Commons, Scala Commons, etc.) - automatic library specification by checking headers against well-known header-to-library mappings +- in-place or out-of-place builds +Requirements +------------ + +- [JYaml] 1.3 + +Examples +-------- + +Say the directory `~/myapp/` contains two C++ programs: `client.cc` and +`server.cc`. To build these with SimpleBuild, create a file called `build` +containing the following [YAML] data: + + client: + srcs: [client.cc] + + server: + srcs: [server.cc] + libs: [pthread, profiler] + +Now running `simple-build` generates a `GNUmakefile` that can be used to +compile both programs in a variety of ways. We could alternatively keep the +source tree clean of generated files by changing to a different directory and +running `simple-build ~/myapp/build`. + +The `libs` field lists libraries that are to be linked with the application. +`simple-build` is also capable of inferring libraries by automatically +determining the headers included by your source files and then mapping these +onto library names. + +The `GNUmakefile` also contains a mechanism for [automatically generating +dependencies] from your source files. This mechanism relies on `gcc -M` and +some GNU `make` tricks. I also take other cues from Peter Miller's excellent +paper ["Recursive Make Considered Harmful"]. + +This automatic dependency generation is also available for Java and Scala; the +mechanism there relies on the compilers' verbose output, and has only been +tested with Sun's `javac`. + +Todo +---- + Planned features: - software deployment @@ -43,8 +89,100 @@ - DART/cmake for C/C++ - somehow merge with simple-setup (generate simple-setup files too?) - support on other platforms (e.g. pthread -> thr on BSD) +- look into: + - [precompiled headers] + - [lzz], [preprocess] + - [autodepend] +- selective target specification: enable configuration of rules (esp. `all`) to + build only certain targets that the user is interested in (currently all + configurations of all programs are built) -Requirements +Related Work ------------ -- jyaml-1.3.jar +The decision to write yet another build system was based on the empty-handed +outcome of a long (and depressing) quest. Here are brief commentaries of some +other build systems. + +- [autotools]: The de-facto standard for portable source distributions, but + writing portable, meaningful `configure.ac` scripts requires a lot of care, + which doesn't suit well the frequent one-off programs I write. Also, + `autotools` doesn't do much for Java or Scala. The aspiration for SimpleBuild + is to one day be able to generate `autotools` inputs (as well as other kinds + of software packaging). + +- [Boost.Build]: A system for building C++ projects. Documentation hints that + it is capable of discovering transitive dependencies as well. This seems like + the closest thing to what I wanted. + +- [GNU `make`]: Currently, SimpleBuild targets only `make`. + +- [ANT]: A portable, "cleaner" version of `make`. Where `make` relies on shell + commands for its actions, ANT relies on actions implemented in Java (either + built-in or provided by extensions). Also, ANT does not by default (i.e., + all targets are "phony"). It is also rid of other `make` idiosyncracies + (syntax, whitespace values, etc.). + +- [Maven]: Much more than a build system, Maven tries to cover everything + related to the general maintenance of software with attention to + cross-project maintenance, and is even a standard way of publishing and + obtaining software. A number of plug-ins (also automatically obtained) take + care of continuous builds, testing, and integration, all presented in a + cohesive dashboard interface. It requires the project follow certain + conventions (e.g. in file organization), but this turns out to be reasonable + for most projects. Again, Maven is not as meaningful for one-off Scala + scripts ([Scala Maven tools] do exist, BTW), but this is where I hope to take + `SimpleBuild` someday. + +- [clump]: A way to build C programs without any build configuration file + whatsoever. The idea of automatic library inference via a header-to-library + database came from here. + +- [CMake]: Cross-platform `make`. Uses its own quirky scripting language and + has quite a few features. I should probably target this. + +- [WAF]: An even simpler/more barren build system. You actually write + imperative scripts for each build you need. A bit scary. + +- [DART]: Somewhat like Maven but for C++, providing a tests/reports/dashboards + for monitoring the status of projects. From the same people behind CMake. + +- [SCons]: For building C, C++, Java, and more. Very minimalistic in its + approach, and imposes (even defines well) few abstractions. It doesn't have + many features. + +- [buildr]: A drop-in replacement for Maven written in Ruby. Supports Scala, + apparently. + +- [rake]: SCons in Ruby. + +- [rant]: Ant in Ruby. + +- [SAnt]: Ant in Scala (abandoned). + +[jyaml]: http://jyaml.sourceforge.net/ + +[precompiled headers]: http://gcc.gnu.org/onlinedocs/gcc/Precompiled-Headers.html +[lzz]: http://www.lazycplusplus.com/ +[preprocess]: http://os.inf.tu-dresden.de/~hohmuth/prj/preprocess/ +[autodepend]: http://autodepend.sourceforge.net/ + +[YAML]: http://yaml.org/ +[automatically generating dependencies]: http://make.paulandlesley.org/autodep.html +["Recursive Make Considered Harmful"]: http://miller.emu.id.au/pmiller/books/rmch/ + +[ANT]: http://ant.apache.org/ +[Boost.Build]: http://boost.org/boost-build2/ +[CMake]: http://www.cmake.org/ +[DART]: http://www.itk.org/Dart/HTML/Index.html +[GNU `make`]: http://www.gnu.org/software/make/ +[Maven]: http://maven.apache.org/ +[SAnt]: http://code.google.com/p/sant/ +[SCons]: http://www.scons.org/ +[Scala Maven tools]: http://scala-tools.org/ +[WAF]: http://code.google.com/p/waf/ +[autotools]: http://sources.redhat.com/autobook/ +[buildr]: http://incubator.apache.org/buildr/ +[clump]: http://www.fexl.com/clump/ +[rake]: http://rake.rubyforge.org/ +[rant]: http://rant.rubyforge.org/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |