From cde5c7b7f61417cd1ef0fa6a92a823310db334d5 Mon Sep 17 00:00:00 2001 From: Stephane Letz Date: Mon, 11 Jan 2021 23:02:23 +0100 Subject: [PATCH] Add library 'stacking' requirement in documentation. --- doc/docs/about.md | 2 +- doc/docs/contributing.md | 2 ++ {rsrc => resources}/.gitignore | 0 resources/Makefile | 46 ++++++++++++++++++++++++++++++++++ {rsrc => resources}/README.md | 3 +-- rsrc/Makefile | 30 ---------------------- 6 files changed, 50 insertions(+), 33 deletions(-) rename {rsrc => resources}/.gitignore (100%) create mode 100644 resources/Makefile rename {rsrc => resources}/README.md (64%) delete mode 100644 rsrc/Makefile diff --git a/doc/docs/about.md b/doc/docs/about.md index ce13ce05..2b382eea 100644 --- a/doc/docs/about.md +++ b/doc/docs/about.md @@ -1,6 +1,6 @@ # The Faust Project -The Faust Project has started in 2004. It is actively developped by the [Grame Research Lab](https://www.grame.fr/recherche). +The Faust Project has started in 2002. It is actively developed by the [Grame Research Lab](https://www.grame.fr/recherche). Many persons are contributing to the Faust project, by providing code for the compiler, architecture files, libraries, examples, documentation, scripts, bug diff --git a/doc/docs/contributing.md b/doc/docs/contributing.md index aa834eeb..3e2adb4a 100644 --- a/doc/docs/contributing.md +++ b/doc/docs/contributing.md @@ -1,5 +1,7 @@ # Contributing +In general, libraries are organised in a *stacked manner*: the base ones define functions or constants without any dependancies, and additional ones are gradually built on top of simpler ones, layer by layer. **Dependency loops must be avoided as much as possible**. The *resources* folder contains tools to build and visualise the libraries dependencies graphs. + If you wish to add a function to any of these libraries or if you plan to add a new library, make sure that you follow the following conventions: ## New Functions diff --git a/rsrc/.gitignore b/resources/.gitignore similarity index 100% rename from rsrc/.gitignore rename to resources/.gitignore diff --git a/resources/Makefile b/resources/Makefile new file mode 100644 index 00000000..2fad3165 --- /dev/null +++ b/resources/Makefile @@ -0,0 +1,46 @@ +# All libraries +LIBS := $(wildcard ../*.lib) + +# All libraries without the 'entry' points ones +INTERNAL_LIBS := $(filter-out ../all.lib ../sf.lib ../stdfaust.lib, $(LIBS)) + +all: deps.pdf internal_deps.pdf + +internal: internal_deps.pdf + +help: + @echo "============ Faust libraries tools ============" + @echo "Available targets are:" + @echo " all (default) : compute a dependencies graph of all libraries using dot" + @echo " internal : compute a dependencies graph of libraries (without 'entry' point ones) using dot" + @echo " clean : remove output files" + +deps.pdf: deps.dot + +deps.dot: + echo "digraph impl { " > $@ + echo "margin=0.05;\n" >> $@ + egrep "=[ \t]*library|^import" $(LIBS) | sed -e 's/^\.\.\///' \ + | sed -e 's/:.*=[ \t]*library("/ -> /' | sed -e 's/:import("/ -> /' \ + | sed -e 's/"..*/;/' |sed -e 's/\.lib//g' | sed -e 's/\//_/g' >> $@ + echo "}" >> $@ + +internal_deps.pdf: internal_deps.dot + +internal_deps.dot: + echo "digraph impl { " > $@ + echo "margin=0.05;\n" >> $@ + egrep "=[ \t]*library|^import" $(INTERNAL_LIBS) | sed -e 's/^\.\.\///' \ + | sed -e 's/:.*=[ \t]*library("/ -> /' | sed -e 's/:import("/ -> /' \ + | sed -e 's/"..*/;/' |sed -e 's/\.lib//g' | sed -e 's/\//_/g' >> $@ + echo "}" >> $@ + +clean: + rm -f deps.pdf deps.dot internal_deps.pdf internal_deps.dot + +test: + echo $(LIBS) + +%.pdf: %.dot + dot -Tpdf -o $@ $< + diff --git a/rsrc/README.md b/resources/README.md similarity index 64% rename from rsrc/README.md rename to resources/README.md index de4e455d..3e5a15b1 100644 --- a/rsrc/README.md +++ b/resources/README.md @@ -1,7 +1,6 @@ # Faust Libraries -This folder contains tools to analyse the libraries. -For the time being, it computes only the dependencies between the libraries. +This folder contains tools to analyse the libraries. For the time being, it computes only the dependencies between the libraries. ### Usage: ~~~~~~~~~~~~~ diff --git a/rsrc/Makefile b/rsrc/Makefile deleted file mode 100644 index bcac6de3..00000000 --- a/rsrc/Makefile +++ /dev/null @@ -1,30 +0,0 @@ - -LIBS := $(wildcard ../*.lib) - -all: deps.pdf - -help: - @echo "============ Faust libraries tools ============" - @echo "Available targets are:" - @echo " all (default) : compute a dependencies graph using dot" - @echo " clean : remove output files" - -deps.pdf: deps.dot - -deps.dot: - echo "digraph impl { " > $@ - echo "margin=0.05;\n" >> $@ - egrep "=[ \t]*library|^import" $(LIBS) | sed -e 's/^\.\.\///' \ - | sed -e 's/:.*=[ \t]*library("/ -> /' | sed -e 's/:import("/ -> /' \ - | sed -e 's/"..*/;/' |sed -e 's/\.lib//g' | sed -e 's/\//_/g' >> $@ - echo "}" >> $@ - -clean: - rm -f deps.pdf deps.dot - -test: - echo $(LIBS) - -%.pdf: %.dot - dot -Tpdf -o $@ $< -