compd --------------------------- compd is a build tool, similar to make, in that it takes input files, and arguments and runs dmd, ar or lib(win32) to create libraries or binaries Building compd: --------------------------- #sh compd.sh *** dmd must be in your path, *** /etc/dmd.conf should be correctly configured with phobos's location. *** the dmd binary is placed in /usr/local/bin/compd (normally in bash's PATH) Running compd: --------------------------- compd can be run in three ways, a) as a command with arguments, and a list of .d files or directories or a *.compd file b) without arguments (in which case it reads the script file build.compd) c) with a single argument which is the script file (eg. build.compd) Below is the documentation for the script file (which is esentially the same as running compd with arguments. - you can override or add to most values by adding the arguments after the script file. usage: #compd #compd build.compd #compd build.compd -o/tmp/leds #compd leds.compd ------------------------------------------------------ compd script file (eg. build.compd) ----------------------------------- The script file is esentially a list of arguments, lines starting with "#" are treated as comments, empty lines are ignored. Arguments: ---------- Source Files "A Directory" "A File" these are the source files to build from, for directories, it looks for any file named *.d example: "src/compd src/dool" Include paths (eg. import search path for D) "-I {value}" These are the include paths, they can be absolute, or relative Since you probably want compd to run in any enviroment, putting absolute paths is generally not a good idea. compd can work out paths of libraries that have been build with compd (eg. if you use -ldool, compd will look in {HOME/.|/etc/}compd/libdool.compd, a file which is writen by compd after it compiles a library. Typically, this line should only contain -Isrc (eg. look in the subdirectory src for any includes ** FIXME ** - work out how to deal with .h include paths for C files? example: "-Isrc" Output library called. "-olib {value}" Tells compd to create a library called {value}.a, which can be used later by other libraries or binaries. example: "-olib libdool" Link with library (and autoload includes if available) "-l{value}" Tells compd to finish off by linking these libraries into the final binary, eg. gcc -l{value} compd will also look in {HOME/.|/etc/}compd/lib{value}.compd to determine include paths (-I) and library locations (-L). example: "-ldool" Create binary called "-o{value}" Tells compd to output a binary executable called {value} examples: "-oleds" "-o/tmp/leds" "-o/usr/bin/leds" ** FIXME ** currently we require -c if we are linking against libraries as well, we should perhaps work this out automatically? ---------------------------------------------------------------- Advanced Usage ---------------------------------------------------------------- Use output directory (for .o files) "-od{value}" Tells compd where to put the temporary .o files used to build the library. ** FIXME ** currently it appends the value to "obj" - it should really prefix it? replace that.. Library location "-L{value}:{value}" Tells compd (and both the linker and dmd) where to look for the libraries (.a or .so), generally it should be needed, unless you are linking against non-d libraries, or libraries not previously build with compd. example: "-L/usr/include/openssl:/usr/include" "-L/usr/src/dool" **FIXME** should this append /usr/include etc. if we are compiling C files as well???? ---------------------------------------------------------------- Future ideas??? - Building .c files and binding them all together? - including other compd files as dependancies.. - and building them first???? - downloading source packages?? -- dssl???? - making a list of valid dmd flags (so that only valid ones get sent to dmd? - make a list of dmd flags to hide from linker? - install??? install configuration/data files???