From dc2542b1faef1817d7166458fd51dd2c001f45af Mon Sep 17 00:00:00 2001 From: umarcor Date: Fri, 23 Apr 2021 00:57:09 +0200 Subject: Makefile: add and use all.ghw, install.ghw and uninstall.ghw targets --- Makefile.in | 20 +++++++++++++++----- scripts/ci-run.sh | 2 +- src/grt/Makefile | 10 ---------- testsuite/gna/issue1326/testsuite.sh | 15 ++++++--------- 4 files changed, 22 insertions(+), 25 deletions(-) diff --git a/Makefile.in b/Makefile.in index fc86eb2b5..378241e4e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -124,15 +124,15 @@ LIBVHDL_FLAGS_TO_PASS=\ # Object files from grt for the synthesis. GRT_SYNTH_OBJS=grt-cstdio.o -all: Makefile all.$(backend) all.libghdl +all: Makefile all.$(backend) all.libghdl all.ghw -install: install.$(backend) install.vhdllib install.vpi install.libghdl +install: install.$(backend) install.vhdllib install.vpi install.libghdl install.ghw # Generate std.standard package VHDL source $(DESTDIR)$(bindir)/ghdl$(EXEEXT) --disp-standard --std=87 > $(DESTDIR)$(VHDL_LIB_DIR)/src/std/v87/standard.vhdl $(DESTDIR)$(bindir)/ghdl$(EXEEXT) --disp-standard --std=93 > $(DESTDIR)$(VHDL_LIB_DIR)/src/std/v93/standard.vhdl $(DESTDIR)$(bindir)/ghdl$(EXEEXT) --disp-standard --std=08 > $(DESTDIR)$(VHDL_LIB_DIR)/src/std/v08/standard.vhdl -uninstall: uninstall.$(backend) uninstall.vhdllib uninstall.vpi uninstall.libghdl +uninstall: uninstall.$(backend) uninstall.vhdllib uninstall.vpi uninstall.libghdl uninstall.ghw test: test.$(backend) @@ -284,7 +284,7 @@ GHDL1_GCC_BIN= # --GHDL1=/path/to/ghdl1 libs.vhdl.gcc: $(MAKE) -f $(srcdir)/libraries/Makefile.inc $(LIBVHDL_FLAGS_TO_PASS) GHDL="$(GHDL_GCC_BIN)" GHDL_FLAGS="$(GHDL1_GCC_BIN) $(LIB_CFLAGS)" vhdl.libs.all libs.vhdl.standard -ghdllib: libs.vhdl.gcc $(libdirsuffix)/libgrt.a all.libghdl +ghdllib: libs.vhdl.gcc $(libdirsuffix)/libgrt.a all.libghdl all.ghw install.gcc: install.grt @@ -474,7 +474,9 @@ libghdl-py.tgz: GHWDUMP_OBJS=ghwdump.o ghwlib.o -ghwdump: $(GHWDUMP_OBJS) +ghwdump: ghwdump$(EXEEXT) + +ghwdump$(EXEEXT): $(GHWDUMP_OBJS) $(CC) -o $@ $(GHWDUMP_OBJS) ghwdump.o: $(srcdir)/src/grt/ghwdump.c $(srcdir)/src/grt/ghwlib.h @@ -483,6 +485,14 @@ ghwdump.o: $(srcdir)/src/grt/ghwdump.c $(srcdir)/src/grt/ghwlib.h ghwlib.o: $(srcdir)/src/grt/ghwlib.c $(srcdir)/src/grt/ghwlib.h $(CC) -c -o $@ $< $(OPT_FLAGS) $(WARN_CFLAGS) +all.ghw: ghwdump$(EXEEXT) + +install.ghw: + $(INSTALL_PROGRAM) -p ghwdump$(EXEEXT) $(DESTDIR)$(bindir)/ + +uninstall.ghw: + $(RM) $(DESTDIR)$(bindir)/ghwdump$(EXEEXT) + ############### grt ##################################################### install.grt: \ diff --git a/scripts/ci-run.sh b/scripts/ci-run.sh index 2854ee7f3..ba213310c 100755 --- a/scripts/ci-run.sh +++ b/scripts/ci-run.sh @@ -423,7 +423,7 @@ ci_run () { if [ "x$IS_MACOS" = "xtrue" ]; then pip3 install -r testsuite/requirements.txt CC=clang \ - prefix="$(pwd)/install-$(echo "$TASK" | cut -d+ -f2)/usr/local" \ + PATH="$PATH:$(pwd)/install-$(echo "$TASK" | cut -d+ -f2)/usr/local/bin" \ ./testsuite/testsuite.sh else # Build ghdl/ghdl:$GHDL_IMAGE_TAG image diff --git a/src/grt/Makefile b/src/grt/Makefile index 2791b5723..e1ad83619 100644 --- a/src/grt/Makefile +++ b/src/grt/Makefile @@ -42,13 +42,3 @@ show_target: echo "Target is $(target)" include Makefile.inc - - -GRT_CFLAGS=$(GRT_FLAGS) -Wall -ghwdump: ghwdump.o ghwlib.o - $(CC) $(GRT_CFLAGS) -o $@ ghwdump.o ghwlib.o - -ghwlib.o: ghwlib.c ghwlib.h - $(CC) -c $(GRT_CFLAGS) -o $@ $< -ghwdump.o: ghwdump.c ghwlib.h - $(CC) -c $(GRT_CFLAGS) -o $@ $< diff --git a/testsuite/gna/issue1326/testsuite.sh b/testsuite/gna/issue1326/testsuite.sh index b90269d4b..d861ffdcf 100755 --- a/testsuite/gna/issue1326/testsuite.sh +++ b/testsuite/gna/issue1326/testsuite.sh @@ -4,18 +4,15 @@ analyze mytestbench.vhdl elab mytestbench - -simulate mytestbench --wave=dump.ghw | tee mytestbench.out - -if c_compiler_is_available; then - - gcc ../../../src/grt/ghwdump.c ../../../src/grt/ghwlib.c -I../../../src/grt/ -o ghwdump +if ghdl_has_feature mytestbench ghw; then + elab_simulate mytestbench --wave=dump.ghw | tee mytestbench.out # We're just checking that ghwdump doesn't crash on a zero length signal. - ./ghwdump -ths dump.ghw > dump.txt + ghwdump -ths dump.ghw > dump.txt + + rm -f mytestbench.out dump.txt dump.ghw fi -rm -f mytestbench.out ghwdump dump.txt dump.ghw clean -echo "Test passed" +echo "Test successful" -- cgit v1.2.3