12 # features (the more the better)
28 # other configuration flags
34 # sccache is not always a drop-in replacement for ccache in practice
39 # Needed for environments that can't run executables (i.e. emscripten, wasm)
41 # Needed for environments that don't have proper thread support (i.e. emscripten, wasm--for now)
42 DISABLE_ABC_THREADS
:= 0
48 # SANITIZER = undefined
53 OS
:= $(shell uname
-s
)
57 ifneq ($(wildcard Makefile.conf
),)
61 ifeq ($(ENABLE_PYOSYS
),1)
65 BINDIR
:= $(PREFIX
)/bin
66 LIBDIR
:= $(PREFIX
)/lib
/$(PROGRAM_PREFIX
)yosys
67 DATDIR
:= $(PREFIX
)/share
/$(PROGRAM_PREFIX
)yosys
74 TARGETS
= $(PROGRAM_PREFIX
)yosys
$(EXE
) $(PROGRAM_PREFIX
)yosys-config
80 UNITESTPATH
:= tests
/unit
84 YOSYS_SRC
:= $(dir $(firstword $(MAKEFILE_LIST
)))
87 CXXFLAGS
:= $(CXXFLAGS
) -Wall
-Wextra
-ggdb
-I.
-I
"$(YOSYS_SRC)" -MD
-MP
-D_YOSYS_
-fPIC
-I
$(PREFIX
)/include
88 LDLIBS
:= $(LDLIBS
) -lstdc
++ -lm
91 PKG_CONFIG ?
= pkg-config
98 PLUGIN_LDFLAGS
+= -undefined dynamic_lookup
100 # homebrew search paths
101 ifneq ($(shell :; command
-v brew
),)
102 BREW_PREFIX
:= $(shell brew
--prefix)/opt
103 $(info $$BREW_PREFIX is
[${BREW_PREFIX}])
104 ifeq ($(ENABLE_PYOSYS
),1)
105 CXXFLAGS
+= -I
$(BREW_PREFIX
)/boost
/include/boost
106 LDFLAGS
+= -L
$(BREW_PREFIX
)/boost
/lib
108 CXXFLAGS
+= -I
$(BREW_PREFIX
)/readline
/include
109 LDFLAGS
+= -L
$(BREW_PREFIX
)/readline
/lib
110 PKG_CONFIG_PATH
:= $(BREW_PREFIX
)/libffi
/lib
/pkgconfig
:$(PKG_CONFIG_PATH
)
111 PKG_CONFIG_PATH
:= $(BREW_PREFIX
)/tcl-tk
/lib
/pkgconfig
:$(PKG_CONFIG_PATH
)
112 export PATH
:= $(BREW_PREFIX
)/bison
/bin
:$(BREW_PREFIX
)/gettext
/bin
:$(BREW_PREFIX
)/flex
/bin
:$(PATH
)
114 # macports search paths
115 else ifneq ($(shell :; command
-v port
),)
116 PORT_PREFIX
:= $(patsubst %/bin
/port
,%,$(shell :; command
-v port
))
117 CXXFLAGS
+= -I
$(PORT_PREFIX
)/include
118 LDFLAGS
+= -L
$(PORT_PREFIX
)/lib
119 PKG_CONFIG_PATH
:= $(PORT_PREFIX
)/lib
/pkgconfig
:$(PKG_CONFIG_PATH
)
120 export PATH
:= $(PORT_PREFIX
)/bin
:$(PATH
)
128 YOSYS_VER
:= 0.9+3715
129 GIT_REV
:= $(shell cd
$(YOSYS_SRC
) && git rev-parse
--short HEAD
2> /dev
/null || echo UNKNOWN
)
130 OBJS
= kernel
/version_
$(GIT_REV
).o
133 sed
-i
"/^YOSYS_VER := / s/+[0-9][0-9]*$$/+`git log --oneline 8a4c6e6.. | wc -l`/;" Makefile
135 # set 'ABCREV = default' to use abc/ as it is
137 # Note: If you do ABC development, make sure that 'abc' in this directory
138 # is just a symlink to your actual ABC working directory, as 'make mrproper'
139 # will remove the 'abc' directory and you do not want to accidentally
140 # delete your work on ABC..
143 ABCURL ?
= https
://github.com
/YosysHQ
/abc
144 ABCMKARGS
= CC
="$(CXX)" CXX
="$(CXX)" ABC_USE_LIBSTDCXX
=1
146 # set ABCEXTERNAL = <abc-command> to use an external ABC instance
147 # Note: The in-tree ABC (yosys-abc) will not be installed when ABCEXTERNAL is set.
155 ifneq ($(wildcard Makefile.conf
),)
156 # don't echo Makefile.conf contents when invoked to print source versions
157 ifeq ($(findstring echo-
,$(MAKECMDGOALS
)),)
158 $(info $(subst $$--$$,$(newline
),$(shell sed
's,^,[Makefile.conf] ,; s,$$,$$--$$,;' < Makefile.conf | tr
-d
'\n' | sed
's,\$$--\$$$$,,')))
160 include Makefile.conf
163 PYTHON_EXECUTABLE
:= $(shell if python3
-c
""; then echo
"python3"; else echo
"python"; fi
)
164 ifeq ($(ENABLE_PYOSYS
),1)
165 PYTHON_VERSION_TESTCODE
:= "import sys;t='{v[0]}.{v[1]}'.format(v=list(sys.version_info[:2]));print(t)"
166 PYTHON_VERSION
:= $(shell $(PYTHON_EXECUTABLE
) -c
""$(PYTHON_VERSION_TESTCODE
)"")
167 PYTHON_MAJOR_VERSION
:= $(shell echo
$(PYTHON_VERSION
) | cut
-f1
-d.
)
169 ENABLE_PYTHON_CONFIG_EMBED ?
= $(shell $(PYTHON_EXECUTABLE
)-config
--embed
--libs
> /dev
/null
&& echo
1)
170 ifeq ($(ENABLE_PYTHON_CONFIG_EMBED
),1)
171 PYTHON_CONFIG
:= $(PYTHON_EXECUTABLE
)-config
--embed
173 PYTHON_CONFIG
:= $(PYTHON_EXECUTABLE
)-config
176 PYTHON_DESTDIR
:= $(shell $(PYTHON_EXECUTABLE
) -c
"import site; print(site.getsitepackages()[-1]);")
178 # Reload Makefile.conf to override python specific variables if defined
179 ifneq ($(wildcard Makefile.conf
),)
180 include Makefile.conf
185 ifeq ($(CONFIG
),clang
)
188 CXXFLAGS
+= -std
=c
++11 -Os
189 ABCMKARGS
+= ARCHFLAGS
="-DABC_USE_STDINT_H"
191 ifneq ($(SANITIZER
),)
192 $(info [Clang Sanitizer
] $(SANITIZER
))
193 CXXFLAGS
+= -g
-O1
-fno-omit-frame-pointer
-fno-optimize-sibling-calls
-fsanitize
=$(SANITIZER
)
194 LDFLAGS
+= -g
-fsanitize
=$(SANITIZER
)
195 ifeq ($(SANITIZER
),address
)
198 ifeq ($(SANITIZER
),memory
)
199 CXXFLAGS
+= -fPIE
-fsanitize-memory-track-origins
200 LDFLAGS
+= -fPIE
-fsanitize-memory-track-origins
202 ifeq ($(SANITIZER
),cfi
)
208 else ifeq ($(CONFIG
),gcc
)
211 CXXFLAGS
+= -std
=c
++11 -Os
212 ABCMKARGS
+= ARCHFLAGS
="-DABC_USE_STDINT_H"
214 else ifeq ($(CONFIG
),gcc-static
)
216 LDFLAGS
:= $(filter-out -rdynamic
,$(LDFLAGS
)) -static
217 LDLIBS
:= $(filter-out -lrt
,$(LDLIBS
))
218 CXXFLAGS
:= $(filter-out -fPIC
,$(CXXFLAGS
))
219 CXXFLAGS
+= -std
=c
++11 -Os
220 ABCMKARGS
= CC
="$(CC)" CXX
="$(CXX)" LD
="$(LD)" ABC_USE_LIBSTDCXX
=1 LIBS
="-lm -lpthread -static" OPTFLAGS
="-O" \
221 ARCHFLAGS
="-DABC_USE_STDINT_H -DABC_NO_DYNAMIC_LINKING=1 -Wno-unused-but-set-variable $(ARCHFLAGS)" ABC_USE_NO_READLINE
=1
222 ifeq ($(DISABLE_ABC_THREADS
),1)
223 ABCMKARGS
+= "ABC_USE_NO_PTHREADS=1"
226 else ifeq ($(CONFIG
),gcc-4.8
)
229 CXXFLAGS
+= -std
=c
++11 -Os
230 ABCMKARGS
+= ARCHFLAGS
="-DABC_USE_STDINT_H"
232 else ifeq ($(CONFIG
),afl-gcc
)
233 CXX
= AFL_QUIET
=1 AFL_HARDEN
=1 afl-gcc
234 LD
= AFL_QUIET
=1 AFL_HARDEN
=1 afl-gcc
235 CXXFLAGS
+= -std
=c
++11 -Os
236 ABCMKARGS
+= ARCHFLAGS
="-DABC_USE_STDINT_H"
238 else ifeq ($(CONFIG
),cygwin
)
241 CXXFLAGS
+= -std
=gnu
++11 -Os
242 ABCMKARGS
+= ARCHFLAGS
="-DABC_USE_STDINT_H"
244 else ifeq ($(CONFIG
),emcc
)
247 CXXFLAGS
:= -std
=c
++11 $(filter-out -fPIC
-ggdb
,$(CXXFLAGS
))
248 ABCMKARGS
+= ARCHFLAGS
="-DABC_USE_STDINT_H -DABC_MEMALIGN=8"
249 EMCCFLAGS
:= -Os
-Wno-warn-absolute-paths
250 EMCCFLAGS
+= --memory-init-file
0 --embed-file share
-s NO_EXIT_RUNTIME
=1
251 EMCCFLAGS
+= -s EXPORTED_FUNCTIONS
="['_main','_run','_prompt','_errmsg','_memset']"
252 EMCCFLAGS
+= -s TOTAL_MEMORY
=134217728
253 EMCCFLAGS
+= -s EXTRA_EXPORTED_RUNTIME_METHODS
='["ccall", "cwrap"]'
254 # https://github.com/kripken/emscripten/blob/master/src/settings.js
255 CXXFLAGS
+= $(EMCCFLAGS
)
256 LDFLAGS
+= $(EMCCFLAGS
)
262 TARGETS
:= $(filter-out $(PROGRAM_PREFIX
)yosys-config
,$(TARGETS
))
263 EXTRA_TARGETS
+= yosysjs-
$(YOSYS_VER
).zip
265 ifeq ($(ENABLE_ABC
),1)
267 DISABLE_ABC_THREADS
:= 1
271 wget
-O viz.js.part https
://github.com
/mdaines
/viz.js
/releases
/download
/0.0.3/viz.js
272 mv viz.js.part viz.js
274 yosysjs-
$(YOSYS_VER
).zip
: yosys.js yosys.wasm viz.js misc
/yosysjs
/*
275 rm -rf yosysjs-
$(YOSYS_VER
) yosysjs-
$(YOSYS_VER
).zip
276 mkdir
-p yosysjs-
$(YOSYS_VER
)
277 cp viz.js misc
/yosysjs
/* yosys.js yosys.wasm yosysjs-
$(YOSYS_VER
)/
278 zip
-r yosysjs-
$(YOSYS_VER
).zip yosysjs-
$(YOSYS_VER
)
280 yosys.html
: misc
/yosys.html
281 $(P
) cp misc
/yosys.html yosys.html
283 else ifeq ($(CONFIG
),wasi
)
289 WASIFLAGS
:= -target wasm32-wasi
--sysroot
$(WASI_SYSROOT
) $(WASIFLAGS
)
291 CXX
= $(WASI_SDK
)/bin
/clang
292 LD
= $(WASI_SDK
)/bin
/clang
++
293 AR
= $(WASI_SDK
)/bin
/ar
294 RANLIB
= $(WASI_SDK
)/bin
/ranlib
295 WASIFLAGS
:= --sysroot
$(WASI_SDK
)/share
/wasi-sysroot
$(WASIFLAGS
)
297 CXXFLAGS
:= $(WASIFLAGS
) -std
=c
++11 -Os
$(filter-out -fPIC
,$(CXXFLAGS
))
298 LDFLAGS
:= $(WASIFLAGS
) -Wl
,-z
,stack-size
=1048576 $(filter-out -rdynamic
,$(LDFLAGS
))
299 LDLIBS
:= $(filter-out -lrt
,$(LDLIBS
))
300 ABCMKARGS
+= AR
="$(AR)" RANLIB
="$(RANLIB)"
301 ABCMKARGS
+= ARCHFLAGS
="$(WASIFLAGS) -DABC_USE_STDINT_H -DABC_NO_DYNAMIC_LINKING"
302 ABCMKARGS
+= OPTFLAGS
="-Os"
307 ifeq ($(ENABLE_ABC
),1)
309 DISABLE_ABC_THREADS
:= 1
312 else ifeq ($(CONFIG
),mxe
)
313 PKG_CONFIG
= /usr
/local
/src
/mxe
/usr
/bin
/i686-w64-mingw32.static-pkg-config
314 CXX
= /usr
/local
/src
/mxe
/usr
/bin
/i686-w64-mingw32.static-g
++
315 LD
= /usr
/local
/src
/mxe
/usr
/bin
/i686-w64-mingw32.static-g
++
316 CXXFLAGS
+= -std
=c
++11 -Os
-D_POSIX_SOURCE
-DYOSYS_MXE_HACKS
-Wno-attributes
317 CXXFLAGS
:= $(filter-out -fPIC
,$(CXXFLAGS
))
318 LDFLAGS
:= $(filter-out -rdynamic
,$(LDFLAGS
)) -s
319 LDLIBS
:= $(filter-out -lrt
,$(LDLIBS
))
320 ABCMKARGS
+= ARCHFLAGS
="-DWIN32_NO_DLL -DHAVE_STRUCT_TIMESPEC -fpermissive -w"
321 # TODO: Try to solve pthread linking issue in more appropriate way
322 ABCMKARGS
+= LIBS
="lib/x86/pthreadVC2.lib -s" LDFLAGS
="-Wl,--allow-multiple-definition" ABC_USE_NO_READLINE
=1 CC
="/usr/local/src/mxe/usr/bin/i686-w64-mingw32.static-gcc"
325 else ifeq ($(CONFIG
),msys2
)
326 CXX
= i686-w64-mingw32-g
++
327 LD
= i686-w64-mingw32-g
++
328 CXXFLAGS
+= -std
=c
++11 -Os
-D_POSIX_SOURCE
-DYOSYS_WIN32_UNIX_DIR
329 CXXFLAGS
:= $(filter-out -fPIC
,$(CXXFLAGS
))
330 LDFLAGS
:= $(filter-out -rdynamic
,$(LDFLAGS
)) -s
331 LDLIBS
:= $(filter-out -lrt
,$(LDLIBS
))
332 ABCMKARGS
+= ARCHFLAGS
="-DABC_USE_STDINT_H -DWIN32_NO_DLL -DHAVE_STRUCT_TIMESPEC -fpermissive -w"
333 ABCMKARGS
+= LIBS
="-lpthread -s" ABC_USE_NO_READLINE
=0 CC
="i686-w64-mingw32-gcc" CXX
="$(CXX)"
336 else ifeq ($(CONFIG
),msys2-64
)
337 CXX
= x86_64-w64-mingw32-g
++
338 LD
= x86_64-w64-mingw32-g
++
339 CXXFLAGS
+= -std
=c
++11 -Os
-D_POSIX_SOURCE
-DYOSYS_WIN32_UNIX_DIR
340 CXXFLAGS
:= $(filter-out -fPIC
,$(CXXFLAGS
))
341 LDFLAGS
:= $(filter-out -rdynamic
,$(LDFLAGS
)) -s
342 LDLIBS
:= $(filter-out -lrt
,$(LDLIBS
))
343 ABCMKARGS
+= ARCHFLAGS
="-DABC_USE_STDINT_H -DWIN32_NO_DLL -DHAVE_STRUCT_TIMESPEC -fpermissive -w"
344 ABCMKARGS
+= LIBS
="-lpthread -s" ABC_USE_NO_READLINE
=0 CC
="x86_64-w64-mingw32-gcc" CXX
="$(CXX)"
347 else ifneq ($(CONFIG
),none
)
348 $(error Invalid CONFIG setting
'$(CONFIG)'. Valid values
: clang
, gcc
, gcc-4.8
, emcc
, mxe
, msys2
, msys2-64
)
351 ifeq ($(ENABLE_LIBYOSYS
),1)
352 TARGETS
+= libyosys.so
355 ifeq ($(ENABLE_PYOSYS
),1)
357 #Detect name of boost_python library. Some distros usbe boost_python-py<version>, other boost_python<version>, some only use the major version number, some a concatenation of major and minor version numbers
359 BOOST_PYTHON_LIB ?
= $(shell \
360 if echo
"int main(int argc, char ** argv) {return 0;}" |
$(CXX
) -xc
-o
/dev
/null
$(shell $(PYTHON_CONFIG
) --ldflags) -lboost_python-py
$(subst .
,,$(PYTHON_VERSION
)) - > /dev
/null
2>&1; then echo
"-lboost_python-py$(subst .,,$(PYTHON_VERSION))"; else \
361 if echo
"int main(int argc, char ** argv) {return 0;}" |
$(CXX
) -xc
-o
/dev
/null
$(shell $(PYTHON_CONFIG
) --ldflags) -lboost_python-py
$(subst .
,,$(PYTHON_MAJOR_VERSION
)) - > /dev
/null
2>&1; then echo
"-lboost_python-py$(subst .,,$(PYTHON_MAJOR_VERSION))"; else \
362 if echo
"int main(int argc, char ** argv) {return 0;}" |
$(CXX
) -xc
-o
/dev
/null
$(shell $(PYTHON_CONFIG
) --ldflags) -lboost_python
$(subst .
,,$(PYTHON_VERSION
)) - > /dev
/null
2>&1; then echo
"-lboost_python$(subst .,,$(PYTHON_VERSION))"; else \
363 if echo
"int main(int argc, char ** argv) {return 0;}" |
$(CXX
) -xc
-o
/dev
/null
$(shell $(PYTHON_CONFIG
) --ldflags) -lboost_python
$(subst .
,,$(PYTHON_MAJOR_VERSION
)) - > /dev
/null
2>&1; then echo
"-lboost_python$(subst .,,$(PYTHON_MAJOR_VERSION))"; else \
364 echo
""; fi
; fi
; fi
; fi
;)
366 BOOST_PYTHON_LIB ?
= $(shell \
367 if echo
"int main(int argc, char ** argv) {return 0;}" |
$(CXX
) -xc
-o
/dev
/null
`$(PYTHON_CONFIG) --libs` -lboost_python-py
$(subst .
,,$(PYTHON_VERSION
)) - > /dev
/null
2>&1; then echo
"-lboost_python-py$(subst .,,$(PYTHON_VERSION))"; else \
368 if echo
"int main(int argc, char ** argv) {return 0;}" |
$(CXX
) -xc
-o
/dev
/null
`$(PYTHON_CONFIG) --libs` -lboost_python-py
$(subst .
,,$(PYTHON_MAJOR_VERSION
)) - > /dev
/null
2>&1; then echo
"-lboost_python-py$(subst .,,$(PYTHON_MAJOR_VERSION))"; else \
369 if echo
"int main(int argc, char ** argv) {return 0;}" |
$(CXX
) -xc
-o
/dev
/null
`$(PYTHON_CONFIG) --libs` -lboost_python
$(subst .
,,$(PYTHON_VERSION
)) - > /dev
/null
2>&1; then echo
"-lboost_python$(subst .,,$(PYTHON_VERSION))"; else \
370 if echo
"int main(int argc, char ** argv) {return 0;}" |
$(CXX
) -xc
-o
/dev
/null
`$(PYTHON_CONFIG) --libs` -lboost_python
$(subst .
,,$(PYTHON_MAJOR_VERSION
)) - > /dev
/null
2>&1; then echo
"-lboost_python$(subst .,,$(PYTHON_MAJOR_VERSION))"; else \
371 echo
""; fi
; fi
; fi
; fi
;)
374 ifeq ($(BOOST_PYTHON_LIB
),)
375 $(error BOOST_PYTHON_LIB could not be detected. Please
define manually
)
379 ifeq ($(PYTHON_MAJOR_VERSION
),3)
380 LDLIBS
+= $(shell $(PYTHON_CONFIG
) --ldflags) $(BOOST_PYTHON_LIB
) -lboost_system
-lboost_filesystem
381 CXXFLAGS
+= $(shell $(PYTHON_CONFIG
) --includes
) -DWITH_PYTHON
383 LDLIBS
+= $(shell $(PYTHON_CONFIG
) --ldflags) $(BOOST_PYTHON_LIB
) -lboost_system
-lboost_filesystem
384 CXXFLAGS
+= $(shell $(PYTHON_CONFIG
) --includes
) -DWITH_PYTHON
387 ifeq ($(PYTHON_MAJOR_VERSION
),3)
388 LDLIBS
+= $(shell $(PYTHON_CONFIG
) --libs
) $(BOOST_PYTHON_LIB
) -lboost_system
-lboost_filesystem
389 CXXFLAGS
+= $(shell $(PYTHON_CONFIG
) --includes
) -DWITH_PYTHON
391 LDLIBS
+= $(shell $(PYTHON_CONFIG
) --libs
) $(BOOST_PYTHON_LIB
) -lboost_system
-lboost_filesystem
392 CXXFLAGS
+= $(shell $(PYTHON_CONFIG
) --includes
) -DWITH_PYTHON
396 ifeq ($(ENABLE_PYOSYS
),1)
397 PY_WRAPPER_FILE
= kernel
/python_wrappers
398 OBJS
+= $(PY_WRAPPER_FILE
).o
399 PY_GEN_SCRIPT
= py_wrap_generator
400 PY_WRAP_INCLUDES
:= $(shell python
$(PYTHON_VERSION
) -c
"from misc import $(PY_GEN_SCRIPT); $(PY_GEN_SCRIPT).print_includes()")
404 ifeq ($(ENABLE_READLINE
),1)
405 CXXFLAGS
+= -DYOSYS_ENABLE_READLINE
406 ifeq ($(OS
), FreeBSD
)
407 CXXFLAGS
+= -I
/usr
/local
/include
410 ifeq ($(LINK_CURSES
),1)
412 ABCMKARGS
+= "ABC_READLINE_LIBRARIES=-lcurses -lreadline"
414 ifeq ($(LINK_TERMCAP
),1)
416 ABCMKARGS
+= "ABC_READLINE_LIBRARIES=-lreadline -ltermcap"
422 ifeq ($(ENABLE_EDITLINE
),1)
423 CXXFLAGS
+= -DYOSYS_ENABLE_EDITLINE
424 LDLIBS
+= -ledit
-ltinfo
-lbsd
426 ABCMKARGS
+= "ABC_USE_NO_READLINE=1"
430 ifeq ($(DISABLE_ABC_THREADS
),1)
431 ABCMKARGS
+= "ABC_USE_NO_PTHREADS=1"
434 ifeq ($(DISABLE_SPAWN
),1)
435 CXXFLAGS
+= -DYOSYS_DISABLE_SPAWN
438 ifeq ($(ENABLE_PLUGINS
),1)
439 CXXFLAGS
+= $(shell PKG_CONFIG_PATH
=$(PKG_CONFIG_PATH
) $(PKG_CONFIG
) --silence-errors
--cflags libffi
) -DYOSYS_ENABLE_PLUGINS
440 LDLIBS
+= $(shell PKG_CONFIG_PATH
=$(PKG_CONFIG_PATH
) $(PKG_CONFIG
) --silence-errors
--libs libffi || echo
-lffi
)
441 ifneq ($(OS
), FreeBSD
)
446 ifeq ($(ENABLE_GLOB
),1)
447 CXXFLAGS
+= -DYOSYS_ENABLE_GLOB
450 ifeq ($(ENABLE_ZLIB
),1)
451 CXXFLAGS
+= -DYOSYS_ENABLE_ZLIB
456 ifeq ($(ENABLE_TCL
),1)
457 TCL_VERSION ?
= tcl
$(shell bash
-c
"tclsh <(echo 'puts [info tclversion]')")
458 ifeq ($(OS
), FreeBSD
)
459 TCL_INCLUDE ?
= /usr
/local
/include/$(TCL_VERSION
)
461 TCL_INCLUDE ?
= /usr
/include/$(TCL_VERSION
)
465 CXXFLAGS
+= -DYOSYS_ENABLE_TCL
466 LDLIBS
+= -ltcl86
-lwsock32
-lws2_32
-lnetapi32
-lz
-luserenv
468 CXXFLAGS
+= $(shell PKG_CONFIG_PATH
=$(PKG_CONFIG_PATH
) $(PKG_CONFIG
) --silence-errors
--cflags tcl || echo
-I
$(TCL_INCLUDE
)) -DYOSYS_ENABLE_TCL
469 ifeq ($(OS
), FreeBSD
)
470 # FreeBSD uses tcl8.6, but lib is named "libtcl86"
471 LDLIBS
+= $(shell PKG_CONFIG_PATH
=$(PKG_CONFIG_PATH
) $(PKG_CONFIG
) --silence-errors
--libs tcl || echo
-l
$(TCL_VERSION
) | tr
-d
'.')
473 LDLIBS
+= $(shell PKG_CONFIG_PATH
=$(PKG_CONFIG_PATH
) $(PKG_CONFIG
) --silence-errors
--libs tcl || echo
-l
$(TCL_VERSION
))
478 ifeq ($(ENABLE_GCOV
),1)
479 CXXFLAGS
+= --coverage
480 LDFLAGS
+= --coverage
483 ifeq ($(ENABLE_GPROF
),1)
488 ifeq ($(ENABLE_NDEBUG
),1)
489 CXXFLAGS
:= -O3
-DNDEBUG
$(filter-out -Os
-ggdb
,$(CXXFLAGS
))
492 ifeq ($(ENABLE_DEBUG
),1)
493 ifeq ($(CONFIG
),clang
)
494 CXXFLAGS
:= -O0
-DDEBUG
$(filter-out -Os
,$(CXXFLAGS
))
496 CXXFLAGS
:= -Og
-DDEBUG
$(filter-out -Os
,$(CXXFLAGS
))
500 ifeq ($(ENABLE_ABC
),1)
501 CXXFLAGS
+= -DYOSYS_ENABLE_ABC
503 CXXFLAGS
+= -DYOSYS_LINK_ABC
504 ifeq ($(DISABLE_ABC_THREADS
),0)
508 ifeq ($(ABCEXTERNAL
),)
509 TARGETS
+= $(PROGRAM_PREFIX
)yosys-abc
$(EXE
)
514 ifeq ($(ENABLE_VERIFIC
),1)
515 VERIFIC_DIR ?
= /usr
/local
/src
/verific_lib
516 VERIFIC_COMPONENTS ?
= verilog vhdl database util containers hier_tree
517 CXXFLAGS
+= $(patsubst %,-I
$(VERIFIC_DIR
)/%,$(VERIFIC_COMPONENTS
)) -DYOSYS_ENABLE_VERIFIC
519 LDLIBS
+= $(patsubst %,$(VERIFIC_DIR
)/%/*-mac.a
,$(VERIFIC_COMPONENTS
)) -lz
521 LDLIBS
+= $(patsubst %,$(VERIFIC_DIR
)/%/*-linux.a
,$(VERIFIC_COMPONENTS
)) -lz
525 ifeq ($(ENABLE_PROTOBUF
),1)
526 LDLIBS
+= $(shell pkg-config
--cflags --libs protobuf
)
529 ifeq ($(ENABLE_COVER
),1)
530 CXXFLAGS
+= -DYOSYS_ENABLE_COVER
533 ifeq ($(ENABLE_CCACHE
),1)
536 ifeq ($(ENABLE_SCCACHE
),1)
537 CXX
:= sccache
$(CXX
)
541 define add_share_file
542 EXTRA_TARGETS
+= $(subst //,/,$(1)/$(notdir $(2)))
543 $(subst //,/,$(1)/$(notdir $(2))): $(2)
545 $$(Q
) cp
"$(YOSYS_SRC)"/$(2) $(subst //,/,$(1)/$(notdir $(2)))
548 define add_gen_share_file
549 EXTRA_TARGETS
+= $(subst //,/,$(1)/$(notdir $(2)))
550 $(subst //,/,$(1)/$(notdir $(2))): $(2)
552 $$(Q
) cp
$(2) $(subst //,/,$(1)/$(notdir $(2)))
555 define add_include_file
556 $(eval
$(call add_share_file
,$(dir share
/include/$(1)),$(1)))
559 define add_extra_objs
567 P_UPDATE
= $(eval P_STATUS
=$(shell echo
$(OBJS
) $(PROGRAM_PREFIX
)yosys
$(EXE
) |
$(AWK
) 'BEGIN { RS = " "; I = $(P_STATUS)+0; } $$1 == "$@" && NR > I { I = NR; } END { print I; }'))
568 P_SHOW
= [$(shell $(AWK
) "BEGIN { N=$(words $(OBJS) $(PROGRAM_PREFIX)yosys$(EXE)); printf \"%3d\", $(P_OFFSET)+90*$(P_STATUS)/N; exit; }")%]
569 P
= @echo
"$(if $(findstring $@,$(TARGETS) $(EXTRA_TARGETS)),$(eval P_OFFSET = 10))$(call P_UPDATE)$(call P_SHOW) Building $@";
579 $(eval
$(call add_include_file
,kernel
/yosys.h
))
580 $(eval
$(call add_include_file
,kernel
/hashlib.h
))
581 $(eval
$(call add_include_file
,kernel
/log.h
))
582 $(eval
$(call add_include_file
,kernel
/rtlil.h
))
583 $(eval
$(call add_include_file
,kernel
/register.h
))
584 $(eval
$(call add_include_file
,kernel
/celltypes.h
))
585 $(eval
$(call add_include_file
,kernel
/celledges.h
))
586 $(eval
$(call add_include_file
,kernel
/consteval.h
))
587 $(eval
$(call add_include_file
,kernel
/constids.inc
))
588 $(eval
$(call add_include_file
,kernel
/sigtools.h
))
589 $(eval
$(call add_include_file
,kernel
/modtools.h
))
590 $(eval
$(call add_include_file
,kernel
/macc.h
))
591 $(eval
$(call add_include_file
,kernel
/utils.h
))
592 $(eval
$(call add_include_file
,kernel
/satgen.h
))
593 $(eval
$(call add_include_file
,kernel
/ff.h
))
594 $(eval
$(call add_include_file
,kernel
/ffinit.h
))
595 $(eval
$(call add_include_file
,kernel
/mem.h
))
596 $(eval
$(call add_include_file
,libs
/ezsat
/ezsat.h
))
597 $(eval
$(call add_include_file
,libs
/ezsat
/ezminisat.h
))
598 $(eval
$(call add_include_file
,libs
/sha1
/sha1.h
))
599 $(eval
$(call add_include_file
,libs
/json11
/json11.hpp
))
600 $(eval
$(call add_include_file
,passes
/fsm
/fsmdata.h
))
601 $(eval
$(call add_include_file
,frontends
/ast
/ast.h
))
602 $(eval
$(call add_include_file
,backends
/rtlil
/rtlil_backend.h
))
603 $(eval
$(call add_include_file
,backends
/cxxrtl
/cxxrtl.h
))
604 $(eval
$(call add_include_file
,backends
/cxxrtl
/cxxrtl_vcd.h
))
605 $(eval
$(call add_include_file
,backends
/cxxrtl
/cxxrtl_capi.
cc))
606 $(eval
$(call add_include_file
,backends
/cxxrtl
/cxxrtl_capi.h
))
607 $(eval
$(call add_include_file
,backends
/cxxrtl
/cxxrtl_vcd_capi.
cc))
608 $(eval
$(call add_include_file
,backends
/cxxrtl
/cxxrtl_vcd_capi.h
))
610 OBJS
+= kernel
/driver.o kernel
/register.o kernel
/rtlil.o kernel
/log.o kernel
/calc.o kernel
/yosys.o
611 ifeq ($(ENABLE_ABC
),1)
612 ifneq ($(ABCEXTERNAL
),)
613 kernel
/yosys.o
: CXXFLAGS
+= -DABCEXTERNAL
='"$(ABCEXTERNAL)"'
616 OBJS
+= kernel
/cellaigs.o kernel
/celledges.o kernel
/satgen.o kernel
/mem.o
618 kernel
/log.o
: CXXFLAGS
+= -DYOSYS_SRC
='"$(YOSYS_SRC)"'
619 kernel
/yosys.o
: CXXFLAGS
+= -DYOSYS_DATDIR
='"$(DATDIR)"' -DYOSYS_PROGRAM_PREFIX
='"$(PROGRAM_PREFIX)"'
621 OBJS
+= libs
/bigint
/BigIntegerAlgorithms.o libs
/bigint
/BigInteger.o libs
/bigint
/BigIntegerUtils.o
622 OBJS
+= libs
/bigint
/BigUnsigned.o libs
/bigint
/BigUnsignedInABase.o
624 OBJS
+= libs
/sha1
/sha1.o
628 OBJS
+= libs
/json11
/json11.o
630 OBJS
+= libs
/subcircuit
/subcircuit.o
632 OBJS
+= libs
/ezsat
/ezsat.o
633 OBJS
+= libs
/ezsat
/ezminisat.o
635 OBJS
+= libs
/minisat
/Options.o
636 OBJS
+= libs
/minisat
/SimpSolver.o
637 OBJS
+= libs
/minisat
/Solver.o
638 OBJS
+= libs
/minisat
/System.o
640 include $(YOSYS_SRC
)/frontends
/*/Makefile.inc
641 include $(YOSYS_SRC
)/passes
/*/Makefile.inc
642 include $(YOSYS_SRC
)/backends
/*/Makefile.inc
643 include $(YOSYS_SRC
)/techlibs
/*/Makefile.inc
647 include $(YOSYS_SRC
)/frontends
/verilog
/Makefile.inc
648 include $(YOSYS_SRC
)/frontends
/rtlil
/Makefile.inc
649 include $(YOSYS_SRC
)/frontends
/ast
/Makefile.inc
650 include $(YOSYS_SRC
)/frontends
/blif
/Makefile.inc
652 OBJS
+= passes
/hierarchy
/hierarchy.o
653 OBJS
+= passes
/cmds
/select.o
654 OBJS
+= passes
/cmds
/show.o
655 OBJS
+= passes
/cmds
/stat.o
656 OBJS
+= passes
/cmds
/cover.o
657 OBJS
+= passes
/cmds
/design.o
658 OBJS
+= passes
/cmds
/plugin.o
660 include $(YOSYS_SRC
)/passes
/proc
/Makefile.inc
661 include $(YOSYS_SRC
)/passes
/opt
/Makefile.inc
662 include $(YOSYS_SRC
)/passes
/techmap
/Makefile.inc
664 include $(YOSYS_SRC
)/backends
/verilog
/Makefile.inc
665 include $(YOSYS_SRC
)/backends
/rtlil
/Makefile.inc
667 include $(YOSYS_SRC
)/techlibs
/common
/Makefile.inc
672 OBJS
+= $(PROGRAM_PREFIX
)yosys-libabc.a
675 # prevent the CXXFLAGS set by this Makefile from reaching abc/Makefile,
676 # especially the -MD flag which will break the build when CXX is clang
679 top-all
: $(TARGETS
) $(EXTRA_TARGETS
)
681 @echo
" Build successful."
684 ifeq ($(CONFIG
),emcc
)
685 yosys.js
: $(filter-out yosysjs-
$(YOSYS_VER
).zip
,$(EXTRA_TARGETS
))
688 $(PROGRAM_PREFIX
)yosys
$(EXE
): $(OBJS
)
689 $(P
) $(LD
) -o
$(PROGRAM_PREFIX
)yosys
$(EXE
) $(LDFLAGS
) $(OBJS
) $(LDLIBS
)
691 libyosys.so
: $(filter-out kernel
/driver.o
,$(OBJS
))
693 $(P
) $(LD
) -o libyosys.so
-shared
-Wl
,-install_name
,$(DESTDIR
)$(LIBDIR
)/libyosys.so
$(LDFLAGS
) $^
$(LDLIBS
)
695 $(P
) $(LD
) -o libyosys.so
-shared
-Wl
,-soname
,$(DESTDIR
)$(LIBDIR
)/libyosys.so
$(LDFLAGS
) $^
$(LDLIBS
)
699 $(Q
) mkdir
-p
$(dir $@
)
700 $(P
) $(CXX
) -o
$@
-c
$(CPPFLAGS
) $(CXXFLAGS
) $<
703 $(Q
) mkdir
-p
$(dir $@
)
704 $(P
) cat
$< | grep
-E
-v
"#[ ]*(include|error)" |
$(LD
) $(CXXFLAGS
) -x c
++ -o
$@
-E
-P
-
706 ifeq ($(ENABLE_PYOSYS
),1)
707 $(PY_WRAPPER_FILE
).
cc: misc
/$(PY_GEN_SCRIPT
).py
$(PY_WRAP_INCLUDES
)
708 $(Q
) mkdir
-p
$(dir $@
)
709 $(P
) python
$(PYTHON_VERSION
) -c
"from misc import $(PY_GEN_SCRIPT); $(PY_GEN_SCRIPT).gen_wrappers(\"$(PY_WRAPPER_FILE).cc\")"
713 $(Q
) mkdir
-p
$(dir $@
)
714 $(P
) $(CXX
) -o
$@
-c
$(CPPFLAGS
) $(CXXFLAGS
) $<
716 YOSYS_VER_STR
:= Yosys
$(YOSYS_VER
) (git sha1
$(GIT_REV
), $(notdir $(CXX
)) $(shell \
717 $(CXX
) --version | tr
' ()' '\n' | grep
'^[0-9]' | head
-n1
) $(filter -f
% -m
% -O
% -DNDEBUG
,$(CXXFLAGS
)))
719 kernel
/version_
$(GIT_REV
).
cc: $(YOSYS_SRC
)/Makefile
720 $(P
) rm -f kernel
/version_
*.o kernel
/version_
*.d kernel
/version_
*.
cc
721 $(Q
) mkdir
-p kernel
&& echo
"namespace Yosys { extern const char *yosys_version_str; const char *yosys_version_str=\"$(YOSYS_VER_STR)\"; }" > kernel
/version_
$(GIT_REV
).
cc
723 ifeq ($(ENABLE_VERIFIC
),1)
724 CXXFLAGS_NOVERIFIC
= $(foreach v
,$(CXXFLAGS
),$(if
$(findstring $(VERIFIC_DIR
),$(v
)),,$(v
)))
725 LDLIBS_NOVERIFIC
= $(foreach v
,$(LDLIBS
),$(if
$(findstring $(VERIFIC_DIR
),$(v
)),,$(v
)))
727 CXXFLAGS_NOVERIFIC
= $(CXXFLAGS
)
728 LDLIBS_NOVERIFIC
= $(LDLIBS
)
731 $(PROGRAM_PREFIX
)yosys-config
: misc
/yosys-config.in
732 $(P
) $(SED
) -e
's#@CXXFLAGS@#$(subst -I. -I"$(YOSYS_SRC)",-I"$(DATDIR)/include",$(strip $(CXXFLAGS_NOVERIFIC)))#;' \
733 -e
's#@CXX@#$(strip $(CXX))#;' -e
's#@LDFLAGS@#$(strip $(LDFLAGS) $(PLUGIN_LDFLAGS))#;' -e
's#@LDLIBS@#$(strip $(LDLIBS_NOVERIFIC))#;' \
734 -e
's#@BINDIR@#$(strip $(BINDIR))#;' -e
's#@DATDIR@#$(strip $(DATDIR))#;' < $< > $(PROGRAM_PREFIX
)yosys-config
735 $(Q
) chmod
+x
$(PROGRAM_PREFIX
)yosys-config
737 abc
/abc-
$(ABCREV
)$(EXE
) abc
/libabc-
$(ABCREV
).a
:
739 ifneq ($(ABCREV
),default
)
740 $(Q
) if
test -d abc
/.hg
; then \
741 echo
'REEBE: NOP qverpgbel vf n ut jbexvat pbcl! Erzbir nop/ naq er-eha "znxr".' | tr
'A-Za-z' 'N-ZA-Mn-za-m'; false
; \
743 $(Q
) if
( cd abc
2> /dev
/null
&& ! git diff-index
--quiet HEAD
; ); then \
744 echo
'REEBE: NOP pbagnvaf ybpny zbqvsvpngvbaf! Frg NOPERI=qrsnhyg va Lbflf Znxrsvyr!' | tr
'A-Za-z' 'N-ZA-Mn-za-m'; false
; \
746 # set a variable so the test fails if git fails to run - when comparing outputs directly, empty string would match empty string
747 $(Q
) if
! (cd abc
2> /dev
/null
&& rev
="`git rev-parse $(ABCREV)`" && test "`git rev-parse HEAD`" == "$$rev"); then \
748 test $(ABCPULL
) -ne
0 ||
{ echo
'REEBE: NOP abg hc gb qngr naq NOPCHYY frg gb 0 va Znxrsvyr!' | tr
'A-Za-z' 'N-ZA-Mn-za-m'; exit
1; }; \
749 echo
"Pulling ABC from $(ABCURL):"; set
-x
; \
750 test -d abc || git clone
$(ABCURL
) abc
; \
751 cd abc
&& $(MAKE
) DEP
= clean && git fetch
$(ABCURL
) && git checkout
$(ABCREV
); \
754 $(Q
) rm -f abc
/abc-
[0-9a-f
]*
755 $(Q
) cd abc
&& $(MAKE
) $(S
) $(ABCMKARGS
) $(if
$(filter %.a
,$@
),PROG
="abc-$(ABCREV)",PROG
="abc-$(ABCREV)$(EXE)") MSG_PREFIX
="$(eval P_OFFSET = 5)$(call P_SHOW)$(eval P_OFFSET = 10) ABC: " $(if
$(filter %.a
,$@
),libabc-
$(ABCREV
).a
)
757 ifeq ($(ABCREV
),default
)
758 .PHONY
: abc
/abc-
$(ABCREV
)$(EXE
)
759 .PHONY
: abc
/libabc-
$(ABCREV
).a
762 $(PROGRAM_PREFIX
)yosys-abc
$(EXE
): abc
/abc-
$(ABCREV
)$(EXE
)
763 $(P
) cp abc
/abc-
$(ABCREV
)$(EXE
) $(PROGRAM_PREFIX
)yosys-abc
$(EXE
)
765 $(PROGRAM_PREFIX
)yosys-libabc.a
: abc
/libabc-
$(ABCREV
).a
766 $(P
) cp abc
/libabc-
$(ABCREV
).a
$(PROGRAM_PREFIX
)yosys-libabc.a
774 ifneq ($(ABCEXTERNAL
),)
775 ABCOPT
="-A $(ABCEXTERNAL)"
780 test: $(TARGETS
) $(EXTRA_TARGETS
)
781 +cd tests
/simple
&& bash run-test.sh
$(SEEDOPT
)
782 +cd tests
/simple_abc9
&& bash run-test.sh
$(SEEDOPT
)
783 +cd tests
/hana
&& bash run-test.sh
$(SEEDOPT
)
784 +cd tests
/asicworld
&& bash run-test.sh
$(SEEDOPT
)
785 # +cd tests/realmath && bash run-test.sh $(SEEDOPT)
786 +cd tests
/share
&& bash run-test.sh
$(SEEDOPT
)
787 +cd tests
/opt_share
&& bash run-test.sh
$(SEEDOPT
)
788 +cd tests
/fsm
&& bash run-test.sh
$(SEEDOPT
)
789 +cd tests
/techmap
&& bash run-test.sh
790 +cd tests
/memories
&& bash run-test.sh
$(ABCOPT
) $(SEEDOPT
)
791 +cd tests
/bram
&& bash run-test.sh
$(SEEDOPT
)
792 +cd tests
/various
&& bash run-test.sh
793 +cd tests
/select
&& bash run-test.sh
794 +cd tests
/sat
&& bash run-test.sh
795 +cd tests
/svinterfaces
&& bash run-test.sh
$(SEEDOPT
)
796 +cd tests
/svtypes
&& bash run-test.sh
$(SEEDOPT
)
797 +cd tests
/proc
&& bash run-test.sh
798 +cd tests
/opt
&& bash run-test.sh
799 +cd tests
/aiger
&& bash run-test.sh
$(ABCOPT
)
800 +cd tests
/arch
&& bash run-test.sh
801 +cd tests
/arch
/ice40
&& bash run-test.sh
$(SEEDOPT
)
802 +cd tests
/arch
/xilinx
&& bash run-test.sh
$(SEEDOPT
)
803 +cd tests
/arch
/ecp5
&& bash run-test.sh
$(SEEDOPT
)
804 +cd tests
/arch
/efinix
&& bash run-test.sh
$(SEEDOPT
)
805 +cd tests
/arch
/anlogic
&& bash run-test.sh
$(SEEDOPT
)
806 +cd tests
/arch
/gowin
&& bash run-test.sh
$(SEEDOPT
)
807 +cd tests
/arch
/intel_alm
&& bash run-test.sh
$(SEEDOPT
)
808 +cd tests
/arch
/nexus
&& bash run-test.sh
$(SEEDOPT
)
809 +cd tests
/rpc
&& bash run-test.sh
810 +cd tests
/memfile
&& bash run-test.sh
811 +cd tests
/verilog
&& bash run-test.sh
813 @echo
" Passed \"make test\"."
816 VALGRIND ?
= valgrind
--error-exitcode
=1 --leak-check
=full
--show-reachable
=yes
--errors-for-leak-kinds
=all
818 vgtest
: $(TARGETS
) $(EXTRA_TARGETS
)
819 $(VALGRIND
) .
/yosys
-p
'setattr -mod -unset top; synth' $$( ls tests
/simple
/*.v | grep
-v repwhile.v
)
821 @echo
" Passed \"make vgtest\"."
824 vloghtb
: $(TARGETS
) $(EXTRA_TARGETS
)
825 +cd tests
/vloghtb
&& bash run-test.sh
827 @echo
" Passed \"make vloghtb\"."
830 ystests
: $(TARGETS
) $(EXTRA_TARGETS
)
832 git clone https
://github.com
/YosysHQ
/yosys-tests.git tests
/ystests
833 +$(MAKE
) PATH
="$$PWD:$$PATH" -C tests
/ystests
835 @echo
" Finished \"make ystests\"."
839 unit-test
: libyosys.so
840 @
$(MAKE
) -C
$(UNITESTPATH
) CXX
="$(CXX)" CPPFLAGS
="$(CPPFLAGS)" \
841 CXXFLAGS
="$(CXXFLAGS)" LDLIBS
="$(LDLIBS)" ROOTPATH
="$(CURDIR)"
844 @
$(MAKE
) -C
$(UNITESTPATH
) clean
846 install: $(TARGETS
) $(EXTRA_TARGETS
)
847 $(INSTALL_SUDO
) mkdir
-p
$(DESTDIR
)$(BINDIR
)
848 $(INSTALL_SUDO
) cp
$(filter-out libyosys.so
,$(TARGETS
)) $(DESTDIR
)$(BINDIR
)
849 ifneq ($(filter $(PROGRAM_PREFIX
)yosys
,$(TARGETS
)),)
850 $(INSTALL_SUDO
) $(STRIP
) -S
$(DESTDIR
)$(BINDIR
)/$(PROGRAM_PREFIX
)yosys
852 ifneq ($(filter $(PROGRAM_PREFIX
)yosys-abc
,$(TARGETS
)),)
853 $(INSTALL_SUDO
) $(STRIP
) $(DESTDIR
)$(BINDIR
)/$(PROGRAM_PREFIX
)yosys-abc
855 ifneq ($(filter $(PROGRAM_PREFIX
)yosys-filterlib
,$(TARGETS
)),)
856 $(INSTALL_SUDO
) $(STRIP
) $(DESTDIR
)$(BINDIR
)/$(PROGRAM_PREFIX
)yosys-filterlib
858 $(INSTALL_SUDO
) mkdir
-p
$(DESTDIR
)$(DATDIR
)
859 $(INSTALL_SUDO
) cp
-r share
/.
$(DESTDIR
)$(DATDIR
)/.
860 ifeq ($(ENABLE_LIBYOSYS
),1)
861 $(INSTALL_SUDO
) mkdir
-p
$(DESTDIR
)$(LIBDIR
)
862 $(INSTALL_SUDO
) cp libyosys.so
$(DESTDIR
)$(LIBDIR
)/
863 $(INSTALL_SUDO
) $(STRIP
) -S
$(DESTDIR
)$(LIBDIR
)/libyosys.so
864 ifeq ($(ENABLE_PYOSYS
),1)
865 $(INSTALL_SUDO
) mkdir
-p
$(DESTDIR
)$(PYTHON_DESTDIR
)/$(subst -,_
,$(PROGRAM_PREFIX
))pyosys
866 $(INSTALL_SUDO
) cp libyosys.so
$(DESTDIR
)$(PYTHON_DESTDIR
)/$(subst -,_
,$(PROGRAM_PREFIX
))pyosys
/libyosys.so
867 $(INSTALL_SUDO
) cp misc
/__init__.py
$(DESTDIR
)$(PYTHON_DESTDIR
)/$(subst -,_
,$(PROGRAM_PREFIX
))pyosys
/
872 $(INSTALL_SUDO
) rm -vf
$(addprefix $(DESTDIR
)$(BINDIR
)/,$(notdir $(TARGETS
)))
873 $(INSTALL_SUDO
) rm -rvf
$(DESTDIR
)$(DATDIR
)
874 ifeq ($(ENABLE_LIBYOSYS
),1)
875 $(INSTALL_SUDO
) rm -vf
$(DESTDIR
)$(LIBDIR
)/libyosys.so
876 ifeq ($(ENABLE_PYOSYS
),1)
877 $(INSTALL_SUDO
) rm -vf
$(DESTDIR
)$(PYTHON_DESTDIR
)/$(subst -,_
,$(PROGRAM_PREFIX
))pyosys
/libyosys.so
878 $(INSTALL_SUDO
) rm -vf
$(DESTDIR
)$(PYTHON_DESTDIR
)/$(subst -,_
,$(PROGRAM_PREFIX
))pyosys
/__init__.py
879 $(INSTALL_SUDO
) rmdir
$(DESTDIR
)$(PYTHON_DESTDIR
)/$(subst -,_
,$(PROGRAM_PREFIX
))pyosys
883 update-manual
: $(TARGETS
) $(EXTRA_TARGETS
)
884 cd manual
&& ..
/$(PROGRAM_PREFIX
)yosys
-p
'help -write-tex-command-reference-manual'
886 manual
: $(TARGETS
) $(EXTRA_TARGETS
)
887 cd manual
&& bash appnotes.sh
888 cd manual
&& bash presentation.sh
889 cd manual
&& bash manual.sh
894 if
test -d manual
; then cd manual
&& sh
clean.sh
; fi
895 rm -f
$(OBJS
) $(GENFILES
) $(TARGETS
) $(EXTRA_TARGETS
) $(EXTRA_OBJS
) $(PY_WRAP_INCLUDES
) $(PY_WRAPPER_FILE
).
cc
896 rm -f kernel
/version_
*.o kernel
/version_
*.
cc
897 rm -f libs
/*/*.d frontends
/*/*.d passes
/*/*.d backends
/*/*.d kernel
/*.d techlibs
/*/*.d
898 rm -rf tests
/asicworld
/*.out tests
/asicworld
/*.log
899 rm -rf tests
/hana
/*.out tests
/hana
/*.log
900 rm -rf tests
/simple
/*.out tests
/simple
/*.log
901 rm -rf tests
/memories
/*.out tests
/memories
/*.log tests
/memories
/*.dmp
902 rm -rf tests
/sat
/*.log tests
/techmap
/*.log tests
/various
/*.log
903 rm -rf tests
/bram
/temp tests
/fsm
/temp tests
/realmath
/temp tests
/share
/temp tests
/smv
/temp
904 rm -rf vloghtb
/Makefile vloghtb
/refdat vloghtb
/rtl vloghtb
/scripts vloghtb
/spec vloghtb
/check_yosys vloghtb
/vloghammer_tb.
tar.bz2 vloghtb
/temp vloghtb
/log_test_
*
905 rm -f tests
/svinterfaces
/*.log_stdout tests
/svinterfaces
/*.log_stderr tests
/svinterfaces
/dut_result.txt tests
/svinterfaces
/reference_result.txt tests
/svinterfaces
/a.out tests
/svinterfaces
/*_syn.v tests
/svinterfaces
/*.diff
906 rm -f tests
/tools
/cmp_tbdata
909 $(MAKE
) -C abc DEP
= clean
910 rm -f
$(PROGRAM_PREFIX
)yosys-abc
$(EXE
) $(PROGRAM_PREFIX
)yosys-libabc.a abc
/abc-
[0-9a-f
]* abc
/libabc-
[0-9a-f
]*.a
916 .
/$(PROGRAM_PREFIX
)yosys
-qp
'help; help -all'
917 rm -rf coverage.
info coverage_html
918 lcov
--capture
-d .
--no-external
-o coverage.
info
919 genhtml coverage.
info --output-directory coverage_html
922 { for file in
$(basename $(OBJS
)); do \
923 for
prefix in
cc y l
; do if
[ -f
$${file}.
$${prefix} ]; then echo
$$file.
$${prefix}; fi
; done \
924 done
; find backends frontends kernel libs passes
-type f \
( -name
'*.h' -o
-name
'*.hh' \
); } > qtcreator.files
925 { echo .
; find backends frontends kernel libs passes
-type f \
( -name
'*.h' -o
-name
'*.hh' \
) -printf
'%h\n' |
sort -u
; } > qtcreator.includes
926 touch qtcreator.config qtcreator.creator
928 vcxsrc
: $(GENFILES
) $(EXTRA_TARGETS
)
929 rm -rf yosys-win32-vcxsrc-
$(YOSYS_VER
){,.zip
}
930 set
-e
; for f in
`ls $(filter %.cc %.cpp,$(GENFILES)) $(addsuffix .cc,$(basename $(OBJS))) $(addsuffix .cpp,$(basename $(OBJS))) 2> /dev/null`; do \
931 echo
"Analyse: $$f" >&2; cpp -std
=c
++11 -MM
-I.
-D_YOSYS_
$$f; done | sed
's,.*:,,; s,//*,/,g; s,/[^/]*/\.\./,/,g; y, \\,\n\n,;' | grep
'^[^/]' |
sort -u | grep
-v kernel
/version_
> srcfiles.txt
932 bash misc
/create_vcxsrc.sh yosys-win32-vcxsrc
$(YOSYS_VER
) $(GIT_REV
)
933 echo
"namespace Yosys { extern const char *yosys_version_str; const char *yosys_version_str=\"Yosys (Version Information Unavailable)\"; }" > kernel
/version.
cc
934 zip yosys-win32-vcxsrc-
$(YOSYS_VER
)/genfiles.zip
$(GENFILES
) kernel
/version.
cc
935 zip
-r yosys-win32-vcxsrc-
$(YOSYS_VER
).zip yosys-win32-vcxsrc-
$(YOSYS_VER
)/
936 rm -f srcfiles.txt kernel
/version.
cc
939 mxebin
: $(TARGETS
) $(EXTRA_TARGETS
)
940 rm -rf yosys-win32-mxebin-
$(YOSYS_VER
){,.zip
}
941 mkdir
-p yosys-win32-mxebin-
$(YOSYS_VER
)
942 cp
-r
$(PROGRAM_PREFIX
)yosys.exe share
/ yosys-win32-mxebin-
$(YOSYS_VER
)/
943 ifeq ($(ENABLE_ABC
),1)
944 cp
-r
$(PROGRAM_PREFIX
)yosys-abc.exe abc
/lib
/x86
/pthreadVC2.dll yosys-win32-mxebin-
$(YOSYS_VER
)/
946 echo
-en
'This is Yosys $(YOSYS_VER) for Win32.\r\n' > yosys-win32-mxebin-
$(YOSYS_VER
)/readme.txt
947 echo
-en
'Documentation at http://www.clifford.at/yosys/.\r\n' >> yosys-win32-mxebin-
$(YOSYS_VER
)/readme.txt
948 zip
-r yosys-win32-mxebin-
$(YOSYS_VER
).zip yosys-win32-mxebin-
$(YOSYS_VER
)/
955 echo
'CONFIG := clang' > Makefile.conf
958 echo
'CONFIG := gcc' > Makefile.conf
960 config-gcc-static
: clean
961 echo
'CONFIG := gcc-static' > Makefile.conf
962 echo
'ENABLE_PLUGINS := 0' >> Makefile.conf
963 echo
'ENABLE_READLINE := 0' >> Makefile.conf
964 echo
'ENABLE_TCL := 0' >> Makefile.conf
966 config-gcc-4.8
: clean
967 echo
'CONFIG := gcc-4.8' > Makefile.conf
969 config-afl-gcc
: clean
970 echo
'CONFIG := afl-gcc' > Makefile.conf
973 echo
'CONFIG := emcc' > Makefile.conf
974 echo
'ENABLE_TCL := 0' >> Makefile.conf
975 echo
'ENABLE_ABC := 0' >> Makefile.conf
976 echo
'ENABLE_PLUGINS := 0' >> Makefile.conf
977 echo
'ENABLE_READLINE := 0' >> Makefile.conf
978 echo
'ENABLE_ZLIB := 0' >> Makefile.conf
981 echo
'CONFIG := wasi' > Makefile.conf
982 echo
'ENABLE_TCL := 0' >> Makefile.conf
983 echo
'ENABLE_ABC := 0' >> Makefile.conf
984 echo
'ENABLE_PLUGINS := 0' >> Makefile.conf
985 echo
'ENABLE_READLINE := 0' >> Makefile.conf
986 echo
'ENABLE_ZLIB := 0' >> Makefile.conf
989 echo
'CONFIG := mxe' > Makefile.conf
990 echo
'ENABLE_PLUGINS := 0' >> Makefile.conf
993 echo
'CONFIG := msys2' > Makefile.conf
994 echo
'ENABLE_PLUGINS := 0' >> Makefile.conf
996 config-msys2-64
: clean
997 echo
'CONFIG := msys2-64' > Makefile.conf
998 echo
'ENABLE_PLUGINS := 0' >> Makefile.conf
1000 config-cygwin
: clean
1001 echo
'CONFIG := cygwin' > Makefile.conf
1004 echo
'CONFIG := gcc' > Makefile.conf
1005 echo
'ENABLE_GCOV := 1' >> Makefile.conf
1006 echo
'ENABLE_DEBUG := 1' >> Makefile.conf
1009 echo
'CONFIG := gcc' > Makefile.conf
1010 echo
'ENABLE_GPROF := 1' >> Makefile.conf
1013 echo
"INSTALL_SUDO := sudo" >> Makefile.conf
1016 @echo
"$(YOSYS_VER)"
1025 -include frontends
/*/*.d
1026 -include passes
/*/*.d
1027 -include backends
/*/*.d
1029 -include techlibs
/*/*.d
1031 .PHONY
: all top-all abc
test install install-abc manual
clean mrproper qtcreator coverage vcxsrc mxebin
1032 .PHONY
: config-clean config-clang config-gcc config-gcc-static config-gcc-4.8 config-afl-gcc config-gprof config-sudo