The main aims of the layout design are: ======================================= 1. To make it possible to set PATH to a single directory in the project, or PATH and *LIB*PATH's to a few stable directories to get access to the full functionaly of the project; 2. To make the project structure comprehensible to a new person with as little effort as posisble; files should be grouped into subdirectories according to their use patterns, and directory names should be informative about the indednt use of the files in them. project/trunk/ (trunk/project/) ================ -- bin/ Compiled binaries of the project. -- scripts/ (alternative names: scr/) Executable programs that are interpreted or compiled on-the-fly. These programs usually do not need or have extension, and their interpreter is selected by the shebang line or by other means. For this reason they need to be kept separately from the src/ tree. Upon installation, they should go into the installation tree bin/, but in the project tree they are better kept separately. -- lib/ On-the-fly compiled modules (e.g. Perl) and compiled librarries (C, Fortran) --- lib/perl5/ ---- lib/perl5/component/ ---- lib/perl5/project/ ---- lib/perl5/project/component/ (???) --- lib/component/libabcsd.so --- lib/externals/ (alternative name: lib/ext/) ## For storing external libraries that are not ## developed here but necessary for compilation. ## e.g.: ---- lib/externals/cexceptions/ -- libexec/ Executable binaries that are only called by scripts or programs in thi sproject but are *not* in the general path. Also may contain *.so* libraries that are specific to the exutables in this project (bin, libexec) that are not included into LD_LIBRARY_PATH and are not searched there. -- src/ All *editable* project sources; compiled destination is lib/ and bin/. For a really small project src/ contents can be directly in the trunk/, and no explicit src/ subdirectory may be present. --- Makefile An optional Makefile to build the project from the src/ sublevel; probably a symlink to ../Makefile, ../makefiles/MasterMakefile or a Makefile that calls them. The src/ subdirectory can be further subdivided: a) by independently usable subsets; see below. -- tests/ 1) For smaller projects, test/, inputs/ and outputs may sit on the top level of the trunk: -- tests/ -- inputs/ -- outputs/ The outputs/ subdirectory can be further subdivided as follows: --- outputs/out/ --- outputs/diff/ 2) For larger projects, the top level trunk/ should contain only the sybdirectory tests/ that hosts all test-related data ans subdirs, and the test case descriptions should go into tests/cases: -- tests/ --- cases/ --- inputs/ --- outputs/ --- programs/ Programs that only need t be compile dfor testing, test drivers. --- bin/ Compiled test drivers --- scripts/ Test driver and setup scripts --- outputs/ The outputs subdirectory can be further subdivided as follows: ---- outputs/out/ ---- outputs/diff/ Other directories on the trunk/ level: -- dependencies/ -- dependecies/Ubuntu-12.04/install.sh Install script for externals dependency packages. -- doc/ Of course! -- TO-DO.txt -- COPYING -- README configure ## GNU-style configure script; should at least accept --prefix Makefile Makeconfig Makelocal Makelocal-xyz -- makefiles/ ## SPOT for all Makefiles in the project Layout of a project src/ subdirectory ===================================== 1) Just sources (*.c, *.y, *.flex, *.java, *.pas, *.for, ...) All sources will be compiled by an appropriate compiler and linked into one program. The program name is either fixed by the top-level Makefile (Makeconfig), or derived from the directory name. 2) -- src/* sources (*.c, *.y, *.flex, *.java, *.pas, *.for, ...) -- src/programs/ (alternative names: prg/, prgsrc/, prog/, progs/, ...) All sources in the src/ subdirectrory should be compiled and linked with every program file from programs/. Each source in the programs/ subdirectory will be compiled into a separate program and linked with the library produced at the previous step. If follows from this convention that each *.c file in the programs/ subdirectory should have a 'main()' function. The compiled libraries go to lib/, the compiled binary programs go to bin/. 3) Alternative, more detailed layout: -- src/*.{c,h,y,flex,lex,s,java,for,pas,cpp} All sources in the src/ subdirectrory should be compiled and linked with every program file from programs/. -- src/lib/ All sources from the lib/ subdirectory should be compiled and archived (or linked) into a library (*.a, *.so*, *.jar). The library name should be determined by the Makefile (Makeconf) or by the project directory name. -- src/programs/ 4) For larger projects: -- src/lib/component1/ -- src/lib/component2/ -- src/programs/ -- src/libexec/component1/ -- src/libexec/component2/ -- src/libexec/programs/ Each 'componentN' subdirectory shold contain sources that are all compiled and linked or archived into the library of the same name (libcomponentN.a, libcomponentN.so*). These libraries should go into lib/. Sources from src/programs should each contain a 'main()' function, or a program source in other language(s), and each should be compiled into a separate executable program and linked against all or some component libraries in lib/ (from the src/lib/ subdirectories). The src/libexec/ subdirectory follows the similar pattern as the src/lib/ hierarchy, but their outputs should go to libexec/. Non-compilable libraries: ========================= -- src/perl5, src/python/, src/bash/, src/R, src/sl, etc... Shold contain a hierarchy of the libraries to be used by scripts/* and src/**. Setting the corresponding path to src// subdirectory should be enough for the language compiler to find the libraries/modules. NOTE: compiled libraries (e.g. *.yp -> *.pm) MAY go to libexec/ or lib/; in that case extra paths should be set in the corresponding environment (such as PERL5LIB variable). For large, multi-component projects: -- src/component1/ -- src/component2/ ... -- src/componentN/ Where each 'component*' subdirectory follows the src/ layout for a single project. E.g.: -- src/componentX/*.c src/componentX/lib/*.c (compiles to lib/componentX/lib*.{a,so*}) src/componentX/libexec/*.c (compiles to libexec/componentX/lib*.{a,so*}) src/componentX/libexec/programs/*.c (compiles to libexec/componentX/* executables) src/componentX/programs (compiles to bin/) Components should be compilable and usable separately. Various extra directories ========================= -- tools/ Various scripts and files that are used for the project maintenancs, but shold not be installed on the target system. -- experiments/ Various files with experimental code and data that are used in the decision taking process but are neither needed to build the project not are installed on the target system. -- generated/ Generated sources that will get linked into the target programs or libraries. -- benchmarks/ Programs and data to benchmark the project -- data/ Larger pieces of data that are needed for project developmen and testing, that do not fit into the test inputs/. -- resources/ All sorts of resources for GUI projects that are not source code. -- obj/ An (originally) empty directory to put compiled object code files. -- config/ Configuration files for the project -- bugs/ Bug descriptions and examples of buggy inputs. -- src/modules/ (???) Modules, packages and libraries for the programing language implemented in a project.