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
This commit is contained in:
Tim 'mithro' Ansell 2015-04-14 18:28:56 +10:00 committed by Sebastien Bourdeauducq
parent 34207982bc
commit c3c5ffb303
1 changed files with 6 additions and 4 deletions

View File

@ -1,15 +1,17 @@
INSTDIR=/usr/lib/ivl INSTDIR = $(shell iverilog-vpi --install-dir)
INCDIRS=-I/usr/include/iverilog
CFLAGS = -Wall -O2 $(CFLAGS_$@)
VPI_CFLAGS := $(shell iverilog-vpi --cflags)
OBJ=ipc.o main.o OBJ=ipc.o main.o
all: migensim.vpi all: migensim.vpi
%.o: %.c %.o: %.c
$(CC) -fPIC -Wall -O2 -c $(INCDIRS) -o $@ $< $(CC) $(CFLAGS) $(VPI_CFLAGS) -c $(INCDIRS) -o $@ $<
migensim.vpi: $(OBJ) migensim.vpi: $(OBJ)
$(CC) -shared -o $@ $(OBJ) -lvpi iverilog-vpi --name=migensim $^
install: migensim.vpi install: migensim.vpi
install -m755 -t $(INSTDIR) $^ install -m755 -t $(INSTDIR) $^