Skip to content

Commit

Permalink
Add library 'stacking' requirement in documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
sletz committed Jan 11, 2021
1 parent 4a41355 commit cde5c7b
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 33 deletions.
2 changes: 1 addition & 1 deletion doc/docs/about.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 2 additions & 0 deletions doc/docs/contributing.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
File renamed without changes.
46 changes: 46 additions & 0 deletions resources/Makefile
Original file line number Diff line number Diff line change
@@ -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 $@ $<

3 changes: 1 addition & 2 deletions rsrc/README.md → resources/README.md
Original file line number Diff line number Diff line change
@@ -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:
~~~~~~~~~~~~~
Expand Down
30 changes: 0 additions & 30 deletions rsrc/Makefile

This file was deleted.

0 comments on commit cde5c7b

Please sign in to comment.