Skip to content

Commit f764d76

Browse files
committed
docs: improve the Makefile dependency graph
Uses Mermaid to render it as a diagram in the html docs.
1 parent 5aa1845 commit f764d76

File tree

3 files changed

+33
-41
lines changed

3 files changed

+33
-41
lines changed

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
python-version: "3.10"
2424

2525
- name: Install MkDocs and doc theme packages
26-
run: pip install mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin
26+
run: pip install mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-mermaid2-plugin
2727

2828
- name: Build docs site
2929
run: mkdocs build

docs/build_system.md

Lines changed: 26 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -9,47 +9,34 @@
99
!!! warning
1010
This page is made by someone who is not the developer and should not be considered as an official documentation of the build system. For getting the full picture, it is best to read the Makefiles and understand them yourself.
1111

12-
## Makefile dep graph
13-
14-
```
15-
Makefile
16-
|
17-
|----- Makefile.system # !!! this is included by many of the Makefiles in the subdirectories !!!
18-
| |
19-
| |===== Makefile.prebuild # This is triggered (not included) once by Makefile.system
20-
| | | # and runs before any of the actual library code is built.
21-
| | | # (builds and runs the "getarch" tool for cpu identification,
22-
| | | # runs the compiler detection scripts c_check and f_check)
23-
| | |
24-
| | ----- (Makefile.conf) [ either this or Makefile_kernel.conf is generated ]
25-
| | | { Makefile.system#L243 }
26-
| | ----- (Makefile_kernel.conf) [ temporary Makefile.conf during DYNAMIC_ARCH builds ]
27-
| |
28-
| |----- Makefile.rule # defaults for build options that can be given on the make command line
29-
| |
30-
| |----- Makefile.$(ARCH) # architecture-specific compiler options and OpenBLAS buffer size values
31-
|
32-
|~~~~~ exports/
33-
|
34-
|~~~~~ test/
35-
|
36-
|~~~~~ utest/
37-
|
38-
|~~~~~ ctest/
39-
|
40-
|~~~~~ cpp_thread_test/
41-
|
42-
|~~~~~ kernel/
43-
|
44-
|~~~~~ ${SUBDIRS}
45-
|
46-
|~~~~~ ${BLASDIRS}
47-
|
48-
|~~~~~ ${NETLIB_LAPACK_DIR}{,/timing,/testing/{EIG,LIN}}
49-
|
50-
|~~~~~ relapack/
12+
## Makefile dependency graph
13+
14+
<!---
15+
An easy way to update this diagram is to copy it into https://mermaid.live
16+
and edit it interactively.
17+
-->
18+
19+
```mermaid
20+
flowchart LR
21+
A[Makefile] -->|included by many of the Makefiles in the subdirectories!| B(Makefile.system)
22+
B -->|triggered, not included, once by Makefile.system, and runs before any of the actual library code is built. builds and runs the 'getarch' tool for cpu identification, runs the compiler detection scripts c_check/f_check| C{Makefile.prebuild}
23+
C -->|either this or Makefile_kernel.conf is generated| D[Makefile.conf]
24+
C -->|temporary Makefile.conf during DYNAMIC_ARCH builds| E[Makefile_kernel.conf]
25+
B -->|defaults for build options that can be given on the make command line| F[Makefile.rule]
26+
B -->|architecture-specific compiler options and OpenBLAS buffer size values| G[Makefile.$ARCH]
27+
A --> exports
28+
A -->|directories: test, ctest, utest, cpp_thread_test| H(test directories)
29+
A --> I($BLASDIRS)
30+
I --> interface
31+
I --> driver/level2
32+
I --> driver/level3
33+
I --> driver/others
34+
A -->|for each target in DYNAMIC_CORE if DYNAMIC_ARCH=1| kernel
35+
A -->|subdirs: timing, testing, testing/EIG, testing/LIN| J($NETLIB_LAPACK_DIR)
36+
A --> relapack
5137
```
5238

39+
5340
## Important Variables
5441

5542
Most of the tunable variables are found in

mkdocs.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,18 @@ theme:
2626

2727
plugins:
2828
- search
29+
- mermaid2
2930
- git-revision-date-localized:
3031
enable_creation_date: true
3132

3233
markdown_extensions:
3334
- admonition
3435
- pymdownx.details
35-
- pymdownx.superfences
36+
- pymdownx.superfences:
37+
custom_fences:
38+
- name: mermaid
39+
class: mermaid
40+
format: !!python/name:mermaid2.fence_mermaid_custom
3641
- footnotes
3742
- pymdownx.tabbed:
3843
alternate_style: true

0 commit comments

Comments
 (0)