aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2021-10-03 10:05:22 +0200
committerTristan Gingold <tgingold@free.fr>2021-10-03 10:05:50 +0200
commiteab9f4d6846eefb0bf791162705c7a559793da1c (patch)
treeff9d45b63ffe9a26ef291b69785042accee4c09a /Makefile
parent09b916cff7b5daf9cc9e39f67156198f4fbf4836 (diff)
downloadghdl-yosys-plugin-eab9f4d6846eefb0bf791162705c7a559793da1c.tar.gz
ghdl-yosys-plugin-eab9f4d6846eefb0bf791162705c7a559793da1c.tar.bz2
ghdl-yosys-plugin-eab9f4d6846eefb0bf791162705c7a559793da1c.zip
ghdl.cc: display compile date and git hash
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile4
1 files changed, 3 insertions, 1 deletions
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