From c3c5ffb3035a6ff0ba3abcd1b5757c40a0702e16 Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Tue, 14 Apr 2015 18:28:56 +1000 Subject: [PATCH] Makefile now uses iverilog-vpi From `man iverilog-vpi`; > iverilog-vpi is a tool to simplify the compilation of VPI modules for use > with Icarus Verilog. It takes on the command line a list of C or C++ source > files, and generates as output a linked VPI module. Fixes https://github.com/m-labs/migen/issues/11 --- vpi/Makefile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/vpi/Makefile b/vpi/Makefile index dc2fa025..54ab175b 100644 --- a/vpi/Makefile +++ b/vpi/Makefile @@ -1,15 +1,17 @@ -INSTDIR=/usr/lib/ivl -INCDIRS=-I/usr/include/iverilog +INSTDIR = $(shell iverilog-vpi --install-dir) + +CFLAGS = -Wall -O2 $(CFLAGS_$@) +VPI_CFLAGS := $(shell iverilog-vpi --cflags) OBJ=ipc.o main.o all: migensim.vpi %.o: %.c - $(CC) -fPIC -Wall -O2 -c $(INCDIRS) -o $@ $< + $(CC) $(CFLAGS) $(VPI_CFLAGS) -c $(INCDIRS) -o $@ $< migensim.vpi: $(OBJ) - $(CC) -shared -o $@ $(OBJ) -lvpi + iverilog-vpi --name=migensim $^ install: migensim.vpi install -m755 -t $(INSTDIR) $^ -- 2.30.2