1
0
mirror of https://github.com/myhdl/myhdl.git synced 2024-12-14 07:44:38 +08:00

clean up modelsim cosim makefile

This commit is contained in:
Keerthan Jaic 2015-07-15 09:16:36 -04:00
parent 1a8ff95a78
commit 5514c254bc

View File

@ -1,33 +1,25 @@
# could add to CFLAGS to turn on warnings if you are using gcc # This makefile assumes that 32bit Modelsim is installed.
WARNS=-Wall # If you have a 64 bit version, run 'ARCH=64 make'
ARCH?=32
CFLAGS_32= -m32
CFLAGS_64= -m64
# change this path to point to the pli include files directory for cver # Guess include dir based on location of vsim
INCS=-I $(shell dirname `which vsim`)/../include INCS=-I $(shell dirname `which vsim`)/../include
CFLAGS= -Wall -shared -BSymbolic -fPIC $(CFLAGS_$(ARCH)) $(INCS)
# maybe want -O<something> and/or -g VSIM_VERSION=$(shell vsim -version 2>/dev/null; echo $$?)
# 32bit for Altera ASE/PE on Ubuntu Natty Narwhal
CFLAGS= -fPIC -Wall -g -m32 $(INCS) -fno-stack-protector
LFLAGS= -G -shared -export-dynamic -melf_i386
# 64bit for SE
#CFLAGS= -fPIC -Wall -c -g $(INCS)
#LFLAGS= -shared -E
# change to your compiler
CC=gcc
all: myhdl_vpi.so all: myhdl_vpi.so
myhdl_vpi.o: myhdl_vpi.c myhdl_vpi.so: myhdl_vpi.c
$(CC) $(CFLAGS) -c myhdl_vpi.c $(info Compiling $(ARCH)bit vpi lib for "$(VSIM_VERSION)")
$(info )
# make rules for dynamic libaries $(CC) $(CFLAGS) -o $@ $?
myhdl_vpi.so: myhdl_vpi.o
$(LD) $(LFLAGS) myhdl_vpi.o -o myhdl_vpi.so
clean: clean:
-rm *.o *.so @rm -f myhdl_vpi.so
.PHONY: test .PHONY: test
test: myhdl_vpi.so test: myhdl_vpi.so