blob: bbfd5f98b45619a83c5dfdecb6839b0dfae7da36 [file] [log] [blame]
#****************************************************************************
#*
#****************************************************************************
BLOCKS = $(shell find * -maxdepth 0 -type d)
CONFIG = $(foreach block,$(BLOCKS), ./$(block)/config.tcl)
CLEAN = $(foreach block,$(BLOCKS), clean-$(block))
OPENLANE_IMAGE_NAME ?= openlane:rc4
OPENLANE_BASIC_COMMAND = "cd /project/openlane && flow.tcl -design ./$* -save_path .. -save -tag $* -overwrite"
OPENLANE_INTERACTIVE_COMMAND = "cd /project/openlane && flow.tcl -it -file ./$*/interactive.tcl"
ifeq (,$(shell which podman))
# Podman (CentOS8+) doesn't require user-spec options
USER_PERM_OPTIONS=-u $(shell id -u $(USER)):$(shell id -g $(USER))
endif
all: $(BLOCKS)
$(CONFIG) :
@echo "Missing $@. Please create a configuration for that design"
@exit 1
$(BLOCKS) : % : ./%/config.tcl FORCE
ifeq ($(OPENLANE_ROOT),)
@echo "Please export OPENLANE_ROOT"
@exit 1
endif
ifeq ($(PDK_ROOT),)
@echo "Please export PDK_ROOT"
@exit 1
endif
@echo "###############################################"
@sleep 1
@if [[ -f ./$*/interactive.tcl ]]; then\
docker run -it -v $(OPENLANE_ROOT):/openLANE_flow \
-v $(PDK_ROOT):$(PDK_ROOT) \
-v $(PWD)/..:/project \
-e PDK_ROOT=$(PDK_ROOT) \
$(USER_PERM_OPTIONS) \
$(OPENLANE_IMAGE_NAME) sh -c $(OPENLANE_INTERACTIVE_COMMAND);\
else\
docker run -it -v $(OPENLANE_ROOT):/openLANE_flow \
-v $(PDK_ROOT):$(PDK_ROOT) \
-v $(PWD)/..:/project \
-e PDK_ROOT=$(PDK_ROOT) \
$(USER_PERM_OPTIONS) \
$(OPENLANE_IMAGE_NAME) sh -c $(OPENLANE_BASIC_COMMAND);\
fi
FORCE:
clean:
@echo "Use clean_all to clean everything :)"
clean_all: $(CLEAN)
$(CLEAN): clean-% :
rm -rf runs/$*
rm -rf ../gds/$**
rm -rf ../mag/$**
rm -rf ../lef/$**