From eab9f4d6846eefb0bf791162705c7a559793da1c Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sun, 3 Oct 2021 10:05:22 +0200 Subject: ghdl.cc: display compile date and git hash --- Makefile | 4 +++- src/ghdl.cc | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a384ecf..589a5b0 100644 --- a/Makefile +++ b/Makefile @@ -15,13 +15,15 @@ ALL_LDFLAGS=$(LIBGHDL_LIB) -Wl,-rpath,$(dir $(LIBGHDL_LIB)) $(LDFLAGS) ALL_CFLAGS=-fPIC -DYOSYS_ENABLE_GHDL -I$(LIBGHDL_INC) $(CFLAGS) +VER_HASH=$(shell git rev-parse --short HEAD || echo "unknown") + all: ghdl.$(SOEXT) ghdl.$(SOEXT): ghdl.o $(YOSYS_CONFIG) --build $@ $< -shared $(ALL_LDFLAGS) ghdl.o: src/ghdl.cc - $(YOSYS_CONFIG) --exec --cxx -c --cxxflags -o $@ $< $(ALL_CFLAGS) + $(YOSYS_CONFIG) --exec --cxx -c --cxxflags -o $@ $< $(ALL_CFLAGS) -DGHDL_VER_HASH="\"$(VER_HASH)\"" clean: force $(RM) -f ghdl.$(SOEXT) ghdl.o diff --git a/src/ghdl.cc b/src/ghdl.cc index 7b36042..3d5bfc4 100644 --- a/src/ghdl.cc +++ b/src/ghdl.cc @@ -1272,6 +1272,11 @@ struct GhdlPass : public Pass { if (args.size() == 2 && args[1] == "--disp-config") { ghdlcomp__disp_config(); + log("yosys plugin compiled on " __DATE__ " " __TIME__ +#ifdef GHDL_VER_HASH + ", git hash:" GHDL_VER_HASH +#endif + "\n"); } else { int cmd_argc = args.size() - 1; -- cgit v1.2.3