forked from SolidOS/solid-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (28 loc) · 1.1 KB
/
Makefile
File metadata and controls
31 lines (28 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Make dependency diagram of js functions
# https://graphviz.readthedocs.io/en/stable/manual.html
# https://www.graphviz.org/pdf/dotguide.pdf
# Where to find source files
S=../src
# Where to put files?
D=.
InternalDependencies.svg: $D/dependencies.dot
dot -Tsvg -oInternalDependencies.svg $D/dependencies.dot
$D/dependencies.dot : $D/all.ttl ttl2dot.sed
sed -f ttl2dot.sed < $< > $@
$D/all.ttl : $D/imports.ttl $D/requires.ttl
cat $D/imports.ttl $D/requires.ttl > $@
$D/imports.ttl : $D/imports.txt
sed -e 's/^\([^:]*\):.*from .\(.*\)./<\1> :dependsOn <\2>./' < $D/imports.txt > $@
$D/requires.ttl : convert-dependency.sed $D/requires.txt
sed -f convert-dependency.sed < $D/requires.txt > $@
$D/imports.txt : $D/source-file-list.txt
cat $D/source-file-list.txt | xargs grep "import.*from " > $D/imports.txt
$D/requires.txt : $D/source-file-list.txt
cat $D/source-file-list.txt | xargs grep "require(" > $D/requires.txt
# $D/imports-list.txt : $D/
# grep -e "^import.*from " > $@
$D/source-file-list.txt :
find $S -name "*.js" > $@
clean:
rm imports.* requires.* source-file-list.txt dependencies.dot
# ends