Skip to content

Commit

Permalink
Makefile: add and use all.ghw, install.ghw and uninstall.ghw targets
Browse files Browse the repository at this point in the history
  • Loading branch information
umarcor authored and tgingold committed Apr 23, 2021
1 parent f80af47 commit dc2542b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 25 deletions.
20 changes: 15 additions & 5 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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: \
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 0 additions & 10 deletions src/grt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 $@ $<
15 changes: 6 additions & 9 deletions testsuite/gna/issue1326/testsuite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit dc2542b

Please sign in to comment.