mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
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:
parent
34207982bc
commit
c3c5ffb303
1 changed files with 6 additions and 4 deletions
10
vpi/Makefile
10
vpi/Makefile
|
@ -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) $^
|
||||||
|
|
Loading…
Reference in a new issue