From 7d9b9500c2d9d649ad6a0d9feb1ca5858c2669ea Mon Sep 17 00:00:00 2001 From: Sylvain Munaut Date: Sun, 5 Dec 2021 20:31:37 +0100 Subject: [PATCH] Makefile: Rework liberty timing generation logic This now uses the python script to list all possible liberty files that can be generated for all libraries that are checked out. Each has its own target so parallel build work as expected and each has its own dependency list that should trigger a rebuild if any of the source file is updated. Signed-off-by: Sylvain Munaut --- Makefile | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index ae7d4f7..e83bf9a 100644 --- a/Makefile +++ b/Makefile @@ -78,29 +78,30 @@ check: check-licenses lint-python all: README.rst @true +.PHONY: all -SC_LIBS = $(sort $(notdir $(wildcard libraries/sky130_*_sc_*))) -$(SC_LIBS): | $(CONDA_ENV_PYTHON) - @$(IN_CONDA_ENV) for V in libraries/$@/*; do \ - if [ -d "$$V/cells" ]; then \ - python -m skywater_pdk.liberty $$V; \ - python -m skywater_pdk.liberty $$V all; \ - python -m skywater_pdk.liberty $$V all --ccsnoise; \ - fi \ - done - -sky130_fd_sc_ms-leakage: | $(CONDA_ENV_PYTHON) - @$(IN_CONDA_ENV) for V in libraries/sky130_fd_sc_ms/*; do \ - if [ -d "$$V/cells" ]; then \ - python -m skywater_pdk.liberty $$V all --leakage; \ - fi \ - done - -sky130_fd_sc_ms: sky130_fd_sc_ms-leakage +SC_LIBS = $(foreach lib, $(dir $(wildcard libraries/*/*/timing)), $(shell $(IN_CONDA_ENV) python -m skywater_pdk.liberty --list-targets $(lib))) timing: $(SC_LIBS) | $(CONDA_ENV_PYTHON) @true +.PHONY: timing -.PHONY: all +libraries/%.lib: + @$(IN_CONDA_ENV) python -m skywater_pdk.liberty $@ + +libraries/%.d: + @$(IN_CONDA_ENV) python -m skywater_pdk.liberty --gen-deps $(@:.d=.lib) > $@ + +include $(SC_LIBS:.lib=.d) + +clean:: + @rm -f $(SC_LIBS) $(SC_LIBS:.lib=.d) + +.PHONY: clean + +dist-clean:: + @rm -f $(SC_LIBS) $(SC_LIBS:.lib=.d) + +.PHONY: dist-clean