-
Notifications
You must be signed in to change notification settings - Fork 2
/
makefile
142 lines (122 loc) · 3.71 KB
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# Time-stamp: <2021-05-19 20:47:19 kmodi>
# Author : Kaushal Modi
UVM ?= 0
LIB_BASENAME ?= libvpi
SV_FILES ?= tb.sv
DEFINES = DEFINE_PLACEHOLDER
# DSEM2009, DSEMEL: Don't keep on bugging by telling that SV 2009 is
# being used. I know it already.
# SPDUSD: Don't warn about unused include dirs.
NOWARNS = -nowarn DSEM2009 -nowarn DSEMEL -nowarn SPDUSD
NC_SWITCHES ?=
NC_CLEAN ?= 1
# Subdirs contains a list of all directories containing a "Makefile".
SUBDIRS = $(shell find . -name "Makefile" | sed 's|/Makefile||')
GDB ?= 0 # When set to 1, enable gdb support for both nim and xrun
VALG ?= 0 # When set to 1, enable valgrind
C_FILES ?= $(LIB_BASENAME).c
NIM ?= nim
ARCH ?= 64
ifeq ($(ARCH), 64)
NIM_ARCH_FLAGS :=
ARCH_SO := $(LIB_BASENAME)_64.so
NC_ARCH_FLAGS := -64bit
GCC_ARCH_FLAG := -m64
else
NIM_ARCH_FLAGS := --cpu:i386 --passC:-m32 --passL:-m32
ARCH_SO := $(LIB_BASENAME)_32.so
NC_ARCH_FLAGS :=
GCC_ARCH_FLAG := -m32
endif
DEFAULT_SO ?= $(LIB_BASENAME).so
# Possible values of NIM_COMPILES_TO: c, cpp
NIM_COMPILES_TO ?= cpp
# See ./gc_crash_debug/README.org on why --gc:none is the default.
NIM_GC ?= arc
NIM_RELEASE ?= 1
NIM_DEFINES ?=
NIM_SWITCHES ?=
NIM_THREADS ?= 0
NIM_DBG_DLL ?= 0
.PHONY: clean nim nimc nimcpp clib nc $(SUBDIRS) all valg
clean:
rm -rf *~ core simv* urg* *.log *.history \#*.* *.dump .simvision/ waves.shm/ \
core.* simv* csrc* *.tmp *.vpd *.key log temp .vcs* DVE* *~ \
INCA_libs xcelium.d *.o ./.nimcache sigusrdump.out \
.bpad/ bpad*.err
clean2: clean
rm -rf *.so
# $(LIB_BASENAME).nim -> $(LIB_BASENAME).c -> $(DEFAULT_SO)
# --gc:none is needed else Nim tries to free memory allocated for
# arrays and stuff by the simulator on SV side.
# https://irclogs.nim-lang.org/21-01-2019.html#17:16:39
# Thanks to https://stackoverflow.com/a/15561911/1219634 for the t