Skip to content

Commit

Permalink
Makefile Improvements + Banner Update (The-OpenROAD-Project#2018)
Browse files Browse the repository at this point in the history
+ Added a new target to the Makefile, `make m`, which mounts the directory at the same path in the container as it is in the host
~ Changed Makefile to mount an empty folder where `install` is so there's less confusion
~ Updated banner per @shalan's recommendation
- Remove `make veryclean` which users may not use consciously and end up nuking their designs
  • Loading branch information
donn authored Oct 19, 2023
1 parent 7ea7a2a commit 747bdbb
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 1,218 deletions.
28 changes: 20 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,22 @@ export STD_CELL_LIBRARY ?= sky130_fd_sc_hd
PDK_OPTS += -e STD_CELL_LIBRARY=$(STD_CELL_LIBRARY)
endif

# ./designs is mounted over ./install so env.tcl is not found inside the Docker
# container if the user had previously installed it.
ENV_START = docker run --rm\
_FAKE_VARIABLE_TO_FORCE_MKDIR := $(shell mkdir -p ./empty)

ENV_MOUNT = \
-v $(OPENLANE_DIR):/openlane\
-v $(OPENLANE_DIR)/designs:/openlane/install\
-v $(PWD)/empty:/openlane/install

ifeq ($(MAKECMDGOALS), m)
ENV_MOUNT = \
-v $(OPENLANE_DIR):$(OPENLANE_DIR)\
-v $(PWD)/empty:$(OPENLANE_DIR)/install\
-w $(OPENLANE_DIR)
endif

ENV_START := docker run --rm\
-v $(HOME):$(HOME)\
$(ENV_MOUNT)\
$(PDK_OPTS)\
$(STD_CELL_OPTS)\
$(DOCKER_OPTIONS)
Expand All @@ -117,6 +127,11 @@ pull-openlane:
get-openlane:
@$(MAKE) pull-openlane || $(MAKE) openlane

.PHONY: m
m:
cd $(OPENLANE_DIR) && \
$(ENV_START) -ti $(OPENLANE_IMAGE_NAME)-$(DOCKER_ARCH)

.PHONY: mount
mount:
cd $(OPENLANE_DIR) && \
Expand Down Expand Up @@ -197,10 +212,7 @@ quick_run:
cd $(OPENLANE_DIR) && \
$(ENV_COMMAND) sh -c "./flow.tcl -design $(QUICK_RUN_DESIGN)"

.PHONY: veryclean clean_runs clean_results
veryclean:
@git clean -fdX

.PHONY: clean_runs clean_results
clean_runs:
@rm -rf ./designs/*/runs ./designs/ci/*/runs ./_build/it_tc_logs && echo "Runs cleaned successfully." || echo "Failed to delete runs."
@rm -rf ./tests/*/runs && echo "Test runs cleaned successfully." || echo "Failed to delete test runs."
Expand Down
Loading

0 comments on commit 747bdbb

Please sign in to comment.