diff --git a/Common/make/ghdl.mk b/Common/make/ghdl.mk new file mode 100644 index 0000000..11fe45e --- /dev/null +++ b/Common/make/ghdl.mk @@ -0,0 +1,28 @@ +# NAME +# BUILD_DIR +# SRCS +# ENTITY_RUN + + +all: analyze + +$(BUILD_DIR): + mkdir -p $@ + +analyze: $(BUILD_DIR) $(SRCS) + ghdl -a --work=$(NAME) --workdir=$(BUILD_DIR) $(SRCS) + +run: analyze + -ghdl -r --work=$(NAME) --workdir=$(BUILD_DIR) $(ENTITY_RUN) --wave=$(BUILD_DIR)/$(NAME).ghw --assert-level=error >$(BUILD_DIR)/$(NAME).log + +sim: run + exec gtkwave -f $(BUILD_DIR)/$(NAME).ghw & + +clean: + rm -f $(BUILD_DIR)/$(NAME)*.cf + +mrproper: + rm -rf $(BUILD_DIR) + + +