12 # features (the more the better)
21 DISABLE_VERIFIC_EXTENSIONS
:= 0
22 DISABLE_VERIFIC_VHDL
:= 0
31 # other configuration flags
37 # sccache is not always a drop-in replacement for ccache in practice
42 # Needed for environments that can't run executables (i.e. emscripten, wasm)
44 # Needed for environments that don't have proper thread support (i.e. emscripten, wasm--for now)
45 DISABLE_ABC_THREADS
:= 0
51 # SANITIZER = undefined
56 OS
:= $(shell uname
-s
)
60 ifneq ($(wildcard Makefile.conf
),)
64 ifeq ($(ENABLE_PYOSYS
),1)
68 BINDIR
:= $(PREFIX
)/bin
69 LIBDIR
:= $(PREFIX
)/lib
/$(PROGRAM_PREFIX
)yosys
70 DATDIR
:= $(PREFIX
)/share
/$(PROGRAM_PREFIX
)yosys
77 TARGETS
= $(PROGRAM_PREFIX
)yosys
$(EXE
) $(PROGRAM_PREFIX
)yosys-config
83 UNITESTPATH
:= tests
/unit
87 YOSYS_SRC
:= $(dir $(firstword $(MAKEFILE_LIST
)))
91 CXXFLAGS
:= $(CXXFLAGS
) -Wall
-Wextra
-ggdb
-I.
-I
"$(YOSYS_SRC)" -MD
-MP
-D_YOSYS_
-fPIC
-I
$(PREFIX
)/include
92 LDLIBS
:= $(LDLIBS
) -lstdc
++ -lm
95 PKG_CONFIG ?
= pkg-config
102 PLUGIN_LDFLAGS
+= -undefined dynamic_lookup
104 # homebrew search paths
105 ifneq ($(shell :; command
-v brew
),)
106 BREW_PREFIX
:= $(shell brew
--prefix)/opt
107 $(info $$BREW_PREFIX is
[${BREW_PREFIX}])
108 ifeq ($(ENABLE_PYOSYS
),1)
109 CXXFLAGS
+= -I
$(BREW_PREFIX
)/boost
/include/boost
110 LDFLAGS
+= -L
$(BREW_PREFIX
)/boost
/lib
112 CXXFLAGS
+= -I
$(BREW_PREFIX
)/readline
/include
113 LDFLAGS
+= -L
$(BREW_PREFIX
)/readline
/lib
114 PKG_CONFIG_PATH
:= $(BREW_PREFIX
)/libffi
/lib
/pkgconfig
:$(PKG_CONFIG_PATH
)
115 PKG_CONFIG_PATH
:= $(BREW_PREFIX
)/tcl-tk
/lib
/pkgconfig
:$(PKG_CONFIG_PATH
)
116 export PATH
:= $(BREW_PREFIX
)/bison
/bin
:$(BREW_PREFIX
)/gettext
/bin
:$(BREW_PREFIX
)/flex
/bin
:$(PATH
)
118 # macports search paths
119 else ifneq ($(shell :; command
-v port
),)
120 PORT_PREFIX
:= $(patsubst %/bin
/port
,%,$(shell :; command
-v port
))
121 CXXFLAGS
+= -I
$(PORT_PREFIX
)/include
122 LDFLAGS
+= -L
$(PORT_PREFIX
)/lib
123 PKG_CONFIG_PATH
:= $(PORT_PREFIX
)/lib
/pkgconfig
:$(PKG_CONFIG_PATH
)
124 export PATH
:= $(PORT_PREFIX
)/bin
:$(PATH
)
133 GIT_REV
:= $(shell git
-C
$(YOSYS_SRC
) rev-parse
--short HEAD
2> /dev
/null || echo UNKNOWN
)
134 OBJS
= kernel
/version_
$(GIT_REV
).o
137 sed
-i
"/^YOSYS_VER := / s/+[0-9][0-9]*$$/+`git log --oneline 07a4368.. | wc -l`/;" Makefile
139 # set 'ABCREV = default' to use abc/ as it is
141 # Note: If you do ABC development, make sure that 'abc' in this directory
142 # is just a symlink to your actual ABC working directory, as 'make mrproper'
143 # will remove the 'abc' directory and you do not want to accidentally
144 # delete your work on ABC..
147 ABCURL ?
= https
://github.com
/YosysHQ
/abc
148 ABCMKARGS
= CC
="$(CXX)" CXX
="$(CXX)" ABC_USE_LIBSTDCXX
=1 VERBOSE
=$(Q
)
150 # set ABCEXTERNAL = <abc-command> to use an external ABC instance
151 # Note: The in-tree ABC (yosys-abc) will not be installed when ABCEXTERNAL is set.
159 ifneq ($(wildcard Makefile.conf
),)
160 # don't echo Makefile.conf contents when invoked to print source versions
161 ifeq ($(findstring echo-
,$(MAKECMDGOALS
)),)
162 $(info $(subst $$--$$,$(newline
),$(shell sed
's,^,[Makefile.conf] ,; s,$$,$$--$$,;' < Makefile.conf | tr
-d
'\n' | sed
's,\$$--\$$$$,,')))
164 include Makefile.conf
167 PYTHON_EXECUTABLE
:= $(shell if python3
-c
""; then echo
"python3"; else echo
"python"; fi
)
168 ifeq ($(ENABLE_PYOSYS
),1)
169 PYTHON_VERSION_TESTCODE
:= "import sys;t='{v[0]}.{v[1]}'.format(v=list(sys.version_info[:2]));print(t)"
170 PYTHON_VERSION
:= $(shell $(PYTHON_EXECUTABLE
) -c
""$(PYTHON_VERSION_TESTCODE
)"")
171 PYTHON_MAJOR_VERSION
:= $(shell echo
$(PYTHON_VERSION
) | cut
-f1
-d.
)
173 ENABLE_PYTHON_CONFIG_EMBED ?
= $(shell $(PYTHON_EXECUTABLE
)-config
--embed
--libs
> /dev
/null
&& echo
1)
174 ifeq ($(ENABLE_PYTHON_CONFIG_EMBED
),1)
175 PYTHON_CONFIG
:= $(PYTHON_EXECUTABLE
)-config
--embed
177 PYTHON_CONFIG
:= $(PYTHON_EXECUTABLE
)-config
180 PYTHON_DESTDIR
:= $(shell $(PYTHON_EXECUTABLE
) -c
"import site; print(site.getsitepackages()[-1]);")
182 # Reload Makefile.conf to override python specific variables if defined
183 ifneq ($(wildcard Makefile.conf
),)
184 include Makefile.conf
189 ifeq ($(CONFIG
),clang
)
192 CXXFLAGS
+= -std
=$(CXXSTD
) -Os
193 ABCMKARGS
+= ARCHFLAGS
="-DABC_USE_STDINT_H"
195 ifneq ($(SANITIZER
),)
196 $(info [Clang Sanitizer
] $(SANITIZER
))
197 CXXFLAGS
+= -g
-O1
-fno-omit-frame-pointer
-fno-optimize-sibling-calls
-fsanitize
=$(SANITIZER
)
198 LDFLAGS
+= -g
-fsanitize
=$(SANITIZER
)
199 ifneq ($(findstring address
,$(SANITIZER
)),)
202 ifneq ($(findstring memory
,$(SANITIZER
)),)
203 CXXFLAGS
+= -fPIE
-fsanitize-memory-track-origins
204 LDFLAGS
+= -fPIE
-fsanitize-memory-track-origins
206 ifneq ($(findstring cfi
,$(SANITIZER
)),)
212 else ifeq ($(CONFIG
),gcc
)
215 CXXFLAGS
+= -std
=$(CXXSTD
) -Os
216 ABCMKARGS
+= ARCHFLAGS
="-DABC_USE_STDINT_H"
218 else ifeq ($(CONFIG
),gcc-static
)
220 LDFLAGS
:= $(filter-out -rdynamic
,$(LDFLAGS
)) -static
221 LDLIBS
:= $(filter-out -lrt
,$(LDLIBS
))
222 CXXFLAGS
:= $(filter-out -fPIC
,$(CXXFLAGS
))
223 CXXFLAGS
+= -std
=$(CXXSTD
) -Os
224 ABCMKARGS
= CC
="$(CC)" CXX
="$(CXX)" LD
="$(LD)" ABC_USE_LIBSTDCXX
=1 LIBS
="-lm -lpthread -static" OPTFLAGS
="-O" \
225 ARCHFLAGS
="-DABC_USE_STDINT_H -DABC_NO_DYNAMIC_LINKING=1 -Wno-unused-but-set-variable $(ARCHFLAGS)" ABC_USE_NO_READLINE
=1
226 ifeq ($(DISABLE_ABC_THREADS
),1)
227 ABCMKARGS
+= "ABC_USE_NO_PTHREADS=1"
230 else ifeq ($(CONFIG
),gcc-4.8
)
233 CXXFLAGS
+= -std
=$(CXXSTD
) -Os
234 ABCMKARGS
+= ARCHFLAGS
="-DABC_USE_STDINT_H"
236 else ifeq ($(CONFIG
),afl-gcc
)
237 CXX
= AFL_QUIET
=1 AFL_HARDEN
=1 afl-gcc
238 LD
= AFL_QUIET
=1 AFL_HARDEN
=1 afl-gcc
239 CXXFLAGS
+= -std
=$(CXXSTD
) -Os
240 ABCMKARGS
+= ARCHFLAGS
="-DABC_USE_STDINT_H"
242 else ifeq ($(CONFIG
),cygwin
)
245 CXXFLAGS
+= -std
=gnu
++11 -Os
246 ABCMKARGS
+= ARCHFLAGS
="-DABC_USE_STDINT_H"
248 else ifeq ($(CONFIG
),emcc
)
251 CXXFLAGS
:= -std
=$(CXXSTD
) $(filter-out -fPIC
-ggdb
,$(CXXFLAGS
))
252 ABCMKARGS
+= ARCHFLAGS
="-DABC_USE_STDINT_H -DABC_MEMALIGN=8"
253 EMCCFLAGS
:= -Os
-Wno-warn-absolute-paths
254 EMCCFLAGS
+= --memory-init-file
0 --embed-file share
-s NO_EXIT_RUNTIME
=1
255 EMCCFLAGS
+= -s EXPORTED_FUNCTIONS
="['_main','_run','_prompt','_errmsg','_memset']"
256 EMCCFLAGS
+= -s TOTAL_MEMORY
=134217728
257 EMCCFLAGS
+= -s EXTRA_EXPORTED_RUNTIME_METHODS
='["ccall", "cwrap"]'
258 # https://github.com/kripken/emscripten/blob/master/src/settings.js
259 CXXFLAGS
+= $(EMCCFLAGS
)
260 LDFLAGS
+= $(EMCCFLAGS
)
266 TARGETS
:= $(filter-out $(PROGRAM_PREFIX
)yosys-config
,$(TARGETS
))
267 EXTRA_TARGETS
+= yosysjs-
$(YOSYS_VER
).zip
269 ifeq ($(ENABLE_ABC
),1)
271 DISABLE_ABC_THREADS
:= 1
275 wget
-O viz.js.part https
://github.com
/mdaines
/viz.js
/releases
/download
/0.0.3/viz.js
276 mv viz.js.part viz.js
278 yosysjs-
$(YOSYS_VER
).zip
: yosys.js yosys.wasm viz.js misc
/yosysjs
/*
279 rm -rf yosysjs-
$(YOSYS_VER
) yosysjs-
$(YOSYS_VER
).zip
280 mkdir
-p yosysjs-
$(YOSYS_VER
)
281 cp viz.js misc
/yosysjs
/* yosys.js yosys.wasm yosysjs-
$(YOSYS_VER
)/
282 zip
-r yosysjs-
$(YOSYS_VER
).zip yosysjs-
$(YOSYS_VER
)
284 yosys.html
: misc
/yosys.html
285 $(P
) cp misc
/yosys.html yosys.html
287 else ifeq ($(CONFIG
),wasi
)
293 WASIFLAGS
:= -target wasm32-wasi
--sysroot
$(WASI_SYSROOT
) $(WASIFLAGS
)
295 CXX
= $(WASI_SDK
)/bin
/clang
296 LD
= $(WASI_SDK
)/bin
/clang
++
297 AR
= $(WASI_SDK
)/bin
/ar
298 RANLIB
= $(WASI_SDK
)/bin
/ranlib
299 WASIFLAGS
:= --sysroot
$(WASI_SDK
)/share
/wasi-sysroot
$(WASIFLAGS
)
301 CXXFLAGS
:= $(WASIFLAGS
) -std
=$(CXXSTD
) -Os
$(filter-out -fPIC
,$(CXXFLAGS
))
302 LDFLAGS
:= $(WASIFLAGS
) -Wl
,-z
,stack-size
=1048576 $(filter-out -rdynamic
,$(LDFLAGS
))
303 LDLIBS
:= $(filter-out -lrt
,$(LDLIBS
))
304 ABCMKARGS
+= AR
="$(AR)" RANLIB
="$(RANLIB)"
305 ABCMKARGS
+= ARCHFLAGS
="$(WASIFLAGS) -DABC_USE_STDINT_H -DABC_NO_DYNAMIC_LINKING"
306 ABCMKARGS
+= OPTFLAGS
="-Os"
311 ifeq ($(ENABLE_ABC
),1)
313 DISABLE_ABC_THREADS
:= 1
316 else ifeq ($(CONFIG
),mxe
)
317 PKG_CONFIG
= /usr
/local
/src
/mxe
/usr
/bin
/i686-w64-mingw32.static-pkg-config
318 CXX
= /usr
/local
/src
/mxe
/usr
/bin
/i686-w64-mingw32.static-g
++
319 LD
= /usr
/local
/src
/mxe
/usr
/bin
/i686-w64-mingw32.static-g
++
320 CXXFLAGS
+= -std
=$(CXXSTD
) -Os
-D_POSIX_SOURCE
-DYOSYS_MXE_HACKS
-Wno-attributes
321 CXXFLAGS
:= $(filter-out -fPIC
,$(CXXFLAGS
))
322 LDFLAGS
:= $(filter-out -rdynamic
,$(LDFLAGS
)) -s
323 LDLIBS
:= $(filter-out -lrt
,$(LDLIBS
))
324 ABCMKARGS
+= ARCHFLAGS
="-DWIN32_NO_DLL -DHAVE_STRUCT_TIMESPEC -fpermissive -w"
325 # TODO: Try to solve pthread linking issue in more appropriate way
326 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"
329 else ifeq ($(CONFIG
),msys2-32
)
330 CXX
= i686-w64-mingw32-g
++
331 LD
= i686-w64-mingw32-g
++
332 CXXFLAGS
+= -std
=$(CXXSTD
) -Os
-D_POSIX_SOURCE
-DYOSYS_WIN32_UNIX_DIR
333 CXXFLAGS
:= $(filter-out -fPIC
,$(CXXFLAGS
))
334 LDFLAGS
:= $(filter-out -rdynamic
,$(LDFLAGS
)) -s
335 LDLIBS
:= $(filter-out -lrt
,$(LDLIBS
))
336 ABCMKARGS
+= ARCHFLAGS
="-DABC_USE_STDINT_H -DWIN32_NO_DLL -DHAVE_STRUCT_TIMESPEC -fpermissive -w"
337 ABCMKARGS
+= LIBS
="-lpthread -s" ABC_USE_NO_READLINE
=0 CC
="i686-w64-mingw32-gcc" CXX
="$(CXX)"
340 else ifeq ($(CONFIG
),msys2-64
)
341 CXX
= x86_64-w64-mingw32-g
++
342 LD
= x86_64-w64-mingw32-g
++
343 CXXFLAGS
+= -std
=$(CXXSTD
) -Os
-D_POSIX_SOURCE
-DYOSYS_WIN32_UNIX_DIR
344 CXXFLAGS
:= $(filter-out -fPIC
,$(CXXFLAGS
))
345 LDFLAGS
:= $(filter-out -rdynamic
,$(LDFLAGS
)) -s
346 LDLIBS
:= $(filter-out -lrt
,$(LDLIBS
))
347 ABCMKARGS
+= ARCHFLAGS
="-DABC_USE_STDINT_H -DWIN32_NO_DLL -DHAVE_STRUCT_TIMESPEC -fpermissive -w"
348 ABCMKARGS
+= LIBS
="-lpthread -s" ABC_USE_NO_READLINE
=0 CC
="x86_64-w64-mingw32-gcc" CXX
="$(CXX)"
351 else ifneq ($(CONFIG
),none
)
352 $(error Invalid CONFIG setting
'$(CONFIG)'. Valid values
: clang
, gcc
, gcc-4.8
, emcc
, mxe
, msys2-32
, msys2-64
)
355 ifeq ($(ENABLE_LIBYOSYS
),1)
356 TARGETS
+= libyosys.so
359 ifeq ($(ENABLE_PYOSYS
),1)
360 # Detect name of boost_python library. Some distros use boost_python-py<version>, other boost_python<version>, some only use the major version number, some a concatenation of major and minor version numbers
361 CHECK_BOOST_PYTHON
= (echo
"int main(int argc, char ** argv) {return 0;}" |
$(CXX
) -xc
-o
/dev
/null
$(shell $(PYTHON_CONFIG
) --ldflags) -l
$(1) - > /dev
/null
2>&1 && echo
"-l$(1)")
362 BOOST_PYTHON_LIB ?
= $(shell \
363 $(call CHECK_BOOST_PYTHON
,boost_python-py
$(subst .
,,$(PYTHON_VERSION
))) || \
364 $(call CHECK_BOOST_PYTHON
,boost_python-py
$(PYTHON_MAJOR_VERSION
)) || \
365 $(call CHECK_BOOST_PYTHON
,boost_python
$(subst .
,,$(PYTHON_VERSION
))) || \
366 $(call CHECK_BOOST_PYTHON
,boost_python
$(PYTHON_MAJOR_VERSION
)) \
369 ifeq ($(BOOST_PYTHON_LIB
),)
370 $(error BOOST_PYTHON_LIB could not be detected. Please
define manually
)
373 LDLIBS
+= $(shell $(PYTHON_CONFIG
) --libs
) $(BOOST_PYTHON_LIB
) -lboost_system
-lboost_filesystem
374 # python-config --ldflags includes LDLIBS for some reason
375 LDFLAGS
+= $(filter-out -l
%,$(shell $(PYTHON_CONFIG
) --ldflags))
376 CXXFLAGS
+= $(shell $(PYTHON_CONFIG
) --includes
) -DWITH_PYTHON
378 PY_WRAPPER_FILE
= kernel
/python_wrappers
379 OBJS
+= $(PY_WRAPPER_FILE
).o
380 PY_GEN_SCRIPT
= py_wrap_generator
381 PY_WRAP_INCLUDES
:= $(shell python
$(PYTHON_VERSION
) -c
"from misc import $(PY_GEN_SCRIPT); $(PY_GEN_SCRIPT).print_includes()")
382 endif # ENABLE_PYOSYS
384 ifeq ($(ENABLE_READLINE
),1)
385 CXXFLAGS
+= -DYOSYS_ENABLE_READLINE
386 ifeq ($(OS
), FreeBSD
)
387 CXXFLAGS
+= -I
/usr
/local
/include
390 ifeq ($(LINK_CURSES
),1)
392 ABCMKARGS
+= "ABC_READLINE_LIBRARIES=-lcurses -lreadline"
394 ifeq ($(LINK_TERMCAP
),1)
396 ABCMKARGS
+= "ABC_READLINE_LIBRARIES=-lreadline -ltermcap"
402 ifeq ($(ENABLE_EDITLINE
),1)
403 CXXFLAGS
+= -DYOSYS_ENABLE_EDITLINE
404 LDLIBS
+= -ledit
-ltinfo
-lbsd
406 ABCMKARGS
+= "ABC_USE_NO_READLINE=1"
410 ifeq ($(DISABLE_ABC_THREADS
),1)
411 ABCMKARGS
+= "ABC_USE_NO_PTHREADS=1"
414 ifeq ($(DISABLE_SPAWN
),1)
415 CXXFLAGS
+= -DYOSYS_DISABLE_SPAWN
418 ifeq ($(ENABLE_PLUGINS
),1)
419 CXXFLAGS
+= $(shell PKG_CONFIG_PATH
=$(PKG_CONFIG_PATH
) $(PKG_CONFIG
) --silence-errors
--cflags libffi
) -DYOSYS_ENABLE_PLUGINS
420 LDLIBS
+= $(shell PKG_CONFIG_PATH
=$(PKG_CONFIG_PATH
) $(PKG_CONFIG
) --silence-errors
--libs libffi || echo
-lffi
)
421 ifneq ($(OS
), FreeBSD
)
426 ifeq ($(ENABLE_GLOB
),1)
427 CXXFLAGS
+= -DYOSYS_ENABLE_GLOB
430 ifeq ($(ENABLE_ZLIB
),1)
431 CXXFLAGS
+= -DYOSYS_ENABLE_ZLIB
436 ifeq ($(ENABLE_TCL
),1)
437 TCL_VERSION ?
= tcl
$(shell bash
-c
"tclsh <(echo 'puts [info tclversion]')")
438 ifeq ($(OS
), FreeBSD
)
439 TCL_INCLUDE ?
= /usr
/local
/include/$(TCL_VERSION
)
441 TCL_INCLUDE ?
= /usr
/include/$(TCL_VERSION
)
445 CXXFLAGS
+= -DYOSYS_ENABLE_TCL
446 LDLIBS
+= -ltcl86
-lwsock32
-lws2_32
-lnetapi32
-lz
-luserenv
448 CXXFLAGS
+= $(shell PKG_CONFIG_PATH
=$(PKG_CONFIG_PATH
) $(PKG_CONFIG
) --silence-errors
--cflags tcl || echo
-I
$(TCL_INCLUDE
)) -DYOSYS_ENABLE_TCL
449 ifeq ($(OS
), FreeBSD
)
450 # FreeBSD uses tcl8.6, but lib is named "libtcl86"
451 LDLIBS
+= $(shell PKG_CONFIG_PATH
=$(PKG_CONFIG_PATH
) $(PKG_CONFIG
) --silence-errors
--libs tcl || echo
-l
$(TCL_VERSION
) | tr
-d
'.')
453 LDLIBS
+= $(shell PKG_CONFIG_PATH
=$(PKG_CONFIG_PATH
) $(PKG_CONFIG
) --silence-errors
--libs tcl || echo
-l
$(TCL_VERSION
))
458 ifeq ($(ENABLE_GCOV
),1)
459 CXXFLAGS
+= --coverage
460 LDFLAGS
+= --coverage
463 ifeq ($(ENABLE_GPROF
),1)
468 ifeq ($(ENABLE_NDEBUG
),1)
469 CXXFLAGS
:= -O3
-DNDEBUG
$(filter-out -Os
-ggdb
,$(CXXFLAGS
))
472 ifeq ($(ENABLE_DEBUG
),1)
473 ifeq ($(CONFIG
),clang
)
474 CXXFLAGS
:= -O0
-DDEBUG
$(filter-out -Os
,$(CXXFLAGS
))
476 CXXFLAGS
:= -Og
-DDEBUG
$(filter-out -Os
,$(CXXFLAGS
))
480 ifeq ($(ENABLE_ABC
),1)
481 CXXFLAGS
+= -DYOSYS_ENABLE_ABC
483 CXXFLAGS
+= -DYOSYS_LINK_ABC
484 ifeq ($(DISABLE_ABC_THREADS
),0)
488 ifeq ($(ABCEXTERNAL
),)
489 TARGETS
+= $(PROGRAM_PREFIX
)yosys-abc
$(EXE
)
494 ifeq ($(ENABLE_GHDL
),1)
495 GHDL_PREFIX ?
= $(PREFIX
)
496 GHDL_INCLUDE_DIR ?
= $(GHDL_PREFIX
)/include
497 GHDL_LIB_DIR ?
= $(GHDL_PREFIX
)/lib
498 CXXFLAGS
+= -I
$(GHDL_INCLUDE_DIR
) -DYOSYS_ENABLE_GHDL
499 LDLIBS
+= $(GHDL_LIB_DIR
)/libghdl.a
$(file
<$(GHDL_LIB_DIR
)/libghdl.link
)
502 ifeq ($(ENABLE_VERIFIC
),1)
503 VERIFIC_DIR ?
= /usr
/local
/src
/verific_lib
504 VERIFIC_COMPONENTS ?
= verilog database util containers hier_tree
505 ifneq ($(DISABLE_VERIFIC_VHDL
),1)
506 VERIFIC_COMPONENTS
+= vhdl
507 CXXFLAGS
+= -DVERIFIC_VHDL_SUPPORT
509 ifneq ($(wildcard $(VERIFIC_DIR
)/vhdl
),)
510 VERIFIC_COMPONENTS
+= vhdl
513 ifneq ($(DISABLE_VERIFIC_EXTENSIONS
),1)
514 VERIFIC_COMPONENTS
+= extensions
515 CXXFLAGS
+= -DYOSYSHQ_VERIFIC_EXTENSIONS
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
/binding.h
))
584 $(eval
$(call add_include_file
,kernel
/register.h
))
585 $(eval
$(call add_include_file
,kernel
/celltypes.h
))
586 $(eval
$(call add_include_file
,kernel
/celledges.h
))
587 $(eval
$(call add_include_file
,kernel
/consteval.h
))
588 $(eval
$(call add_include_file
,kernel
/constids.inc
))
589 $(eval
$(call add_include_file
,kernel
/sigtools.h
))
590 $(eval
$(call add_include_file
,kernel
/modtools.h
))
591 $(eval
$(call add_include_file
,kernel
/macc.h
))
592 $(eval
$(call add_include_file
,kernel
/utils.h
))
593 $(eval
$(call add_include_file
,kernel
/satgen.h
))
594 $(eval
$(call add_include_file
,kernel
/qcsat.h
))
595 $(eval
$(call add_include_file
,kernel
/ff.h
))
596 $(eval
$(call add_include_file
,kernel
/ffinit.h
))
597 $(eval
$(call add_include_file
,kernel
/fstdata.h
))
598 $(eval
$(call add_include_file
,kernel
/mem.h
))
599 $(eval
$(call add_include_file
,libs
/ezsat
/ezsat.h
))
600 $(eval
$(call add_include_file
,libs
/ezsat
/ezminisat.h
))
601 $(eval
$(call add_include_file
,libs
/fst
/fstapi.h
))
602 $(eval
$(call add_include_file
,libs
/sha1
/sha1.h
))
603 $(eval
$(call add_include_file
,libs
/json11
/json11.hpp
))
604 $(eval
$(call add_include_file
,passes
/fsm
/fsmdata.h
))
605 $(eval
$(call add_include_file
,frontends
/ast
/ast.h
))
606 $(eval
$(call add_include_file
,frontends
/ast
/ast_binding.h
))
607 $(eval
$(call add_include_file
,frontends
/blif
/blifparse.h
))
608 $(eval
$(call add_include_file
,backends
/rtlil
/rtlil_backend.h
))
609 $(eval
$(call add_include_file
,backends
/cxxrtl
/cxxrtl.h
))
610 $(eval
$(call add_include_file
,backends
/cxxrtl
/cxxrtl_vcd.h
))
611 $(eval
$(call add_include_file
,backends
/cxxrtl
/cxxrtl_capi.
cc))
612 $(eval
$(call add_include_file
,backends
/cxxrtl
/cxxrtl_capi.h
))
613 $(eval
$(call add_include_file
,backends
/cxxrtl
/cxxrtl_vcd_capi.
cc))
614 $(eval
$(call add_include_file
,backends
/cxxrtl
/cxxrtl_vcd_capi.h
))
616 OBJS
+= kernel
/driver.o kernel
/register.o kernel
/rtlil.o kernel
/log.o kernel
/calc.o kernel
/yosys.o
617 OBJS
+= kernel
/binding.o
618 ifeq ($(ENABLE_ABC
),1)
619 ifneq ($(ABCEXTERNAL
),)
620 kernel
/yosys.o
: CXXFLAGS
+= -DABCEXTERNAL
='"$(ABCEXTERNAL)"'
623 OBJS
+= kernel
/cellaigs.o kernel
/celledges.o kernel
/satgen.o kernel
/qcsat.o kernel
/mem.o kernel
/ffmerge.o kernel
/ff.o kernel
/fstdata.o
625 kernel
/log.o
: CXXFLAGS
+= -DYOSYS_SRC
='"$(YOSYS_SRC)"'
626 kernel
/yosys.o
: CXXFLAGS
+= -DYOSYS_DATDIR
='"$(DATDIR)"' -DYOSYS_PROGRAM_PREFIX
='"$(PROGRAM_PREFIX)"'
628 OBJS
+= libs
/bigint
/BigIntegerAlgorithms.o libs
/bigint
/BigInteger.o libs
/bigint
/BigIntegerUtils.o
629 OBJS
+= libs
/bigint
/BigUnsigned.o libs
/bigint
/BigUnsignedInABase.o
631 OBJS
+= libs
/sha1
/sha1.o
635 OBJS
+= libs
/json11
/json11.o
637 OBJS
+= libs
/subcircuit
/subcircuit.o
639 OBJS
+= libs
/ezsat
/ezsat.o
640 OBJS
+= libs
/ezsat
/ezminisat.o
642 OBJS
+= libs
/minisat
/Options.o
643 OBJS
+= libs
/minisat
/SimpSolver.o
644 OBJS
+= libs
/minisat
/Solver.o
645 OBJS
+= libs
/minisat
/System.o
647 OBJS
+= libs
/fst
/fstapi.o
648 OBJS
+= libs
/fst
/fastlz.o
649 OBJS
+= libs
/fst
/lz4.o
651 include $(YOSYS_SRC
)/frontends
/*/Makefile.inc
652 include $(YOSYS_SRC
)/passes
/*/Makefile.inc
653 include $(YOSYS_SRC
)/backends
/*/Makefile.inc
654 include $(YOSYS_SRC
)/techlibs
/*/Makefile.inc
658 include $(YOSYS_SRC
)/frontends
/verilog
/Makefile.inc
659 include $(YOSYS_SRC
)/frontends
/rtlil
/Makefile.inc
660 include $(YOSYS_SRC
)/frontends
/ast
/Makefile.inc
661 include $(YOSYS_SRC
)/frontends
/blif
/Makefile.inc
663 OBJS
+= passes
/hierarchy
/hierarchy.o
664 OBJS
+= passes
/cmds
/select.o
665 OBJS
+= passes
/cmds
/show.o
666 OBJS
+= passes
/cmds
/stat.o
667 OBJS
+= passes
/cmds
/cover.o
668 OBJS
+= passes
/cmds
/design.o
669 OBJS
+= passes
/cmds
/plugin.o
671 include $(YOSYS_SRC
)/passes
/proc
/Makefile.inc
672 include $(YOSYS_SRC
)/passes
/opt
/Makefile.inc
673 include $(YOSYS_SRC
)/passes
/techmap
/Makefile.inc
675 include $(YOSYS_SRC
)/backends
/verilog
/Makefile.inc
676 include $(YOSYS_SRC
)/backends
/rtlil
/Makefile.inc
678 include $(YOSYS_SRC
)/techlibs
/common
/Makefile.inc
683 OBJS
+= $(PROGRAM_PREFIX
)yosys-libabc.a
686 # prevent the CXXFLAGS set by this Makefile from reaching abc/Makefile,
687 # especially the -MD flag which will break the build when CXX is clang
690 top-all
: $(TARGETS
) $(EXTRA_TARGETS
)
692 @echo
" Build successful."
695 ifeq ($(CONFIG
),emcc
)
696 yosys.js
: $(filter-out yosysjs-
$(YOSYS_VER
).zip
,$(EXTRA_TARGETS
))
699 $(PROGRAM_PREFIX
)yosys
$(EXE
): $(OBJS
)
700 $(P
) $(LD
) -o
$(PROGRAM_PREFIX
)yosys
$(EXE
) $(LDFLAGS
) $(OBJS
) $(LDLIBS
)
702 libyosys.so
: $(filter-out kernel
/driver.o
,$(OBJS
))
704 $(P
) $(LD
) -o libyosys.so
-shared
-Wl
,-install_name
,$(LIBDIR
)/libyosys.so
$(LDFLAGS
) $^
$(LDLIBS
)
706 $(P
) $(LD
) -o libyosys.so
-shared
-Wl
,-soname
,$(LIBDIR
)/libyosys.so
$(LDFLAGS
) $^
$(LDLIBS
)
710 $(Q
) mkdir
-p
$(dir $@
)
711 $(P
) $(CXX
) -o
$@
-c
$(CPPFLAGS
) $(CXXFLAGS
) $<
714 $(Q
) mkdir
-p
$(dir $@
)
715 $(P
) cat
$< | grep
-E
-v
"#[ ]*(include|error)" |
$(LD
) $(CXXFLAGS
) -x c
++ -o
$@
-E
-P
-
717 ifeq ($(ENABLE_PYOSYS
),1)
718 $(PY_WRAPPER_FILE
).
cc: misc
/$(PY_GEN_SCRIPT
).py
$(PY_WRAP_INCLUDES
)
719 $(Q
) mkdir
-p
$(dir $@
)
720 $(P
) python
$(PYTHON_VERSION
) -c
"from misc import $(PY_GEN_SCRIPT); $(PY_GEN_SCRIPT).gen_wrappers(\"$(PY_WRAPPER_FILE).cc\")"
724 $(Q
) mkdir
-p
$(dir $@
)
725 $(P
) $(CXX
) -o
$@
-c
$(CPPFLAGS
) $(CXXFLAGS
) $<
727 YOSYS_VER_STR
:= Yosys
$(YOSYS_VER
) (git sha1
$(GIT_REV
), $(notdir $(CXX
)) $(shell \
728 $(CXX
) --version | tr
' ()' '\n' | grep
'^[0-9]' | head
-n1
) $(filter -f
% -m
% -O
% -DNDEBUG
,$(CXXFLAGS
)))
730 kernel
/version_
$(GIT_REV
).
cc: $(YOSYS_SRC
)/Makefile
731 $(P
) rm -f kernel
/version_
*.o kernel
/version_
*.d kernel
/version_
*.
cc
732 $(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
734 ifeq ($(ENABLE_VERIFIC
),1)
735 CXXFLAGS_NOVERIFIC
= $(foreach v
,$(CXXFLAGS
),$(if
$(findstring $(VERIFIC_DIR
),$(v
)),,$(v
)))
736 LDLIBS_NOVERIFIC
= $(foreach v
,$(LDLIBS
),$(if
$(findstring $(VERIFIC_DIR
),$(v
)),,$(v
)))
738 CXXFLAGS_NOVERIFIC
= $(CXXFLAGS
)
739 LDLIBS_NOVERIFIC
= $(LDLIBS
)
742 $(PROGRAM_PREFIX
)yosys-config
: misc
/yosys-config.in
743 $(P
) $(SED
) -e
's#@CXXFLAGS@#$(subst -I. -I"$(YOSYS_SRC)",-I"$(DATDIR)/include",$(strip $(CXXFLAGS_NOVERIFIC)))#;' \
744 -e
's#@CXX@#$(strip $(CXX))#;' -e
's#@LDFLAGS@#$(strip $(LDFLAGS) $(PLUGIN_LDFLAGS))#;' -e
's#@LDLIBS@#$(strip $(LDLIBS_NOVERIFIC))#;' \
745 -e
's#@BINDIR@#$(strip $(BINDIR))#;' -e
's#@DATDIR@#$(strip $(DATDIR))#;' < $< > $(PROGRAM_PREFIX
)yosys-config
746 $(Q
) chmod
+x
$(PROGRAM_PREFIX
)yosys-config
748 abc
/abc-
$(ABCREV
)$(EXE
) abc
/libabc-
$(ABCREV
).a
:
750 ifneq ($(ABCREV
),default
)
751 $(Q
) if
test -d abc
/.hg
; then \
752 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
; \
754 $(Q
) if
test -d abc
&& ! git
-C abc diff-index
--quiet HEAD
; then \
755 echo
'REEBE: NOP pbagnvaf ybpny zbqvsvpngvbaf! Frg NOPERI=qrsnhyg va Lbflf Znxrsvyr!' | tr
'A-Za-z' 'N-ZA-Mn-za-m'; false
; \
757 # set a variable so the test fails if git fails to run - when comparing outputs directly, empty string would match empty string
758 $(Q
) if
! (cd abc
2> /dev
/null
&& rev
="`git rev-parse $(ABCREV)`" && test "`git rev-parse HEAD`" == "$$rev"); then \
759 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; }; \
760 echo
"Pulling ABC from $(ABCURL):"; set
-x
; \
761 test -d abc || git clone
$(ABCURL
) abc
; \
762 cd abc
&& $(MAKE
) DEP
= clean && git fetch
$(ABCURL
) && git checkout
$(ABCREV
); \
765 $(Q
) rm -f abc
/abc-
[0-9a-f
]*
766 $(Q
) $(MAKE
) -C abc
$(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
)
768 ifeq ($(ABCREV
),default
)
769 .PHONY
: abc
/abc-
$(ABCREV
)$(EXE
)
770 .PHONY
: abc
/libabc-
$(ABCREV
).a
773 $(PROGRAM_PREFIX
)yosys-abc
$(EXE
): abc
/abc-
$(ABCREV
)$(EXE
)
774 $(P
) cp abc
/abc-
$(ABCREV
)$(EXE
) $(PROGRAM_PREFIX
)yosys-abc
$(EXE
)
776 $(PROGRAM_PREFIX
)yosys-libabc.a
: abc
/libabc-
$(ABCREV
).a
777 $(P
) cp abc
/libabc-
$(ABCREV
).a
$(PROGRAM_PREFIX
)yosys-libabc.a
785 ifneq ($(ABCEXTERNAL
),)
786 ABCOPT
="-A $(ABCEXTERNAL)"
791 test: $(TARGETS
) $(EXTRA_TARGETS
)
792 +cd tests
/simple
&& bash run-test.sh
$(SEEDOPT
)
793 +cd tests
/simple_abc9
&& bash run-test.sh
$(SEEDOPT
)
794 +cd tests
/hana
&& bash run-test.sh
$(SEEDOPT
)
795 +cd tests
/asicworld
&& bash run-test.sh
$(SEEDOPT
)
796 # +cd tests/realmath && bash run-test.sh $(SEEDOPT)
797 +cd tests
/share
&& bash run-test.sh
$(SEEDOPT
)
798 +cd tests
/opt_share
&& bash run-test.sh
$(SEEDOPT
)
799 +cd tests
/fsm
&& bash run-test.sh
$(SEEDOPT
)
800 +cd tests
/techmap
&& bash run-test.sh
801 +cd tests
/memories
&& bash run-test.sh
$(ABCOPT
) $(SEEDOPT
)
802 +cd tests
/bram
&& bash run-test.sh
$(SEEDOPT
)
803 +cd tests
/various
&& bash run-test.sh
804 +cd tests
/select
&& bash run-test.sh
805 +cd tests
/sat
&& bash run-test.sh
806 +cd tests
/sim
&& bash run-test.sh
807 +cd tests
/svinterfaces
&& bash run-test.sh
$(SEEDOPT
)
808 +cd tests
/svtypes
&& bash run-test.sh
$(SEEDOPT
)
809 +cd tests
/proc
&& bash run-test.sh
810 +cd tests
/blif
&& bash run-test.sh
811 +cd tests
/opt
&& bash run-test.sh
812 +cd tests
/aiger
&& bash run-test.sh
$(ABCOPT
)
813 +cd tests
/arch
&& bash run-test.sh
814 +cd tests
/arch
/ice40
&& bash run-test.sh
$(SEEDOPT
)
815 +cd tests
/arch
/xilinx
&& bash run-test.sh
$(SEEDOPT
)
816 +cd tests
/arch
/ecp5
&& bash run-test.sh
$(SEEDOPT
)
817 +cd tests
/arch
/machxo2
&& bash run-test.sh
$(SEEDOPT
)
818 +cd tests
/arch
/efinix
&& bash run-test.sh
$(SEEDOPT
)
819 +cd tests
/arch
/anlogic
&& bash run-test.sh
$(SEEDOPT
)
820 +cd tests
/arch
/gowin
&& bash run-test.sh
$(SEEDOPT
)
821 +cd tests
/arch
/intel_alm
&& bash run-test.sh
$(SEEDOPT
)
822 +cd tests
/arch
/nexus
&& bash run-test.sh
$(SEEDOPT
)
823 +cd tests
/arch
/quicklogic
&& bash run-test.sh
$(SEEDOPT
)
824 +cd tests
/arch
/gatemate
&& bash run-test.sh
$(SEEDOPT
)
825 +cd tests
/rpc
&& bash run-test.sh
826 +cd tests
/memfile
&& bash run-test.sh
827 +cd tests
/verilog
&& bash run-test.sh
829 @echo
" Passed \"make test\"."
832 VALGRIND ?
= valgrind
--error-exitcode
=1 --leak-check
=full
--show-reachable
=yes
--errors-for-leak-kinds
=all
834 vgtest
: $(TARGETS
) $(EXTRA_TARGETS
)
835 $(VALGRIND
) .
/yosys
-p
'setattr -mod -unset top; synth' $$( ls tests
/simple
/*.v | grep
-v repwhile.v
)
837 @echo
" Passed \"make vgtest\"."
840 vloghtb
: $(TARGETS
) $(EXTRA_TARGETS
)
841 +cd tests
/vloghtb
&& bash run-test.sh
843 @echo
" Passed \"make vloghtb\"."
846 ystests
: $(TARGETS
) $(EXTRA_TARGETS
)
848 git clone https
://github.com
/YosysHQ
/yosys-tests.git tests
/ystests
849 +$(MAKE
) PATH
="$$PWD:$$PATH" -C tests
/ystests
851 @echo
" Finished \"make ystests\"."
855 unit-test
: libyosys.so
856 @
$(MAKE
) -C
$(UNITESTPATH
) CXX
="$(CXX)" CPPFLAGS
="$(CPPFLAGS)" \
857 CXXFLAGS
="$(CXXFLAGS)" LDLIBS
="$(LDLIBS)" ROOTPATH
="$(CURDIR)"
860 @
$(MAKE
) -C
$(UNITESTPATH
) clean
862 install: $(TARGETS
) $(EXTRA_TARGETS
)
863 $(INSTALL_SUDO
) mkdir
-p
$(DESTDIR
)$(BINDIR
)
864 $(INSTALL_SUDO
) cp
$(filter-out libyosys.so
,$(TARGETS
)) $(DESTDIR
)$(BINDIR
)
865 ifneq ($(filter $(PROGRAM_PREFIX
)yosys
,$(TARGETS
)),)
866 $(INSTALL_SUDO
) $(STRIP
) -S
$(DESTDIR
)$(BINDIR
)/$(PROGRAM_PREFIX
)yosys
868 ifneq ($(filter $(PROGRAM_PREFIX
)yosys-abc
,$(TARGETS
)),)
869 $(INSTALL_SUDO
) $(STRIP
) $(DESTDIR
)$(BINDIR
)/$(PROGRAM_PREFIX
)yosys-abc
871 ifneq ($(filter $(PROGRAM_PREFIX
)yosys-filterlib
,$(TARGETS
)),)
872 $(INSTALL_SUDO
) $(STRIP
) $(DESTDIR
)$(BINDIR
)/$(PROGRAM_PREFIX
)yosys-filterlib
874 $(INSTALL_SUDO
) mkdir
-p
$(DESTDIR
)$(DATDIR
)
875 $(INSTALL_SUDO
) cp
-r share
/.
$(DESTDIR
)$(DATDIR
)/.
876 ifeq ($(ENABLE_LIBYOSYS
),1)
877 $(INSTALL_SUDO
) mkdir
-p
$(DESTDIR
)$(LIBDIR
)
878 $(INSTALL_SUDO
) cp libyosys.so
$(DESTDIR
)$(LIBDIR
)/
879 $(INSTALL_SUDO
) $(STRIP
) -S
$(DESTDIR
)$(LIBDIR
)/libyosys.so
880 ifeq ($(ENABLE_PYOSYS
),1)
881 $(INSTALL_SUDO
) mkdir
-p
$(DESTDIR
)$(PYTHON_DESTDIR
)/$(subst -,_
,$(PROGRAM_PREFIX
))pyosys
882 $(INSTALL_SUDO
) cp libyosys.so
$(DESTDIR
)$(PYTHON_DESTDIR
)/$(subst -,_
,$(PROGRAM_PREFIX
))pyosys
/libyosys.so
883 $(INSTALL_SUDO
) cp misc
/__init__.py
$(DESTDIR
)$(PYTHON_DESTDIR
)/$(subst -,_
,$(PROGRAM_PREFIX
))pyosys
/
888 $(INSTALL_SUDO
) rm -vf
$(addprefix $(DESTDIR
)$(BINDIR
)/,$(notdir $(TARGETS
)))
889 $(INSTALL_SUDO
) rm -rvf
$(DESTDIR
)$(DATDIR
)
890 ifeq ($(ENABLE_LIBYOSYS
),1)
891 $(INSTALL_SUDO
) rm -vf
$(DESTDIR
)$(LIBDIR
)/libyosys.so
892 ifeq ($(ENABLE_PYOSYS
),1)
893 $(INSTALL_SUDO
) rm -vf
$(DESTDIR
)$(PYTHON_DESTDIR
)/$(subst -,_
,$(PROGRAM_PREFIX
))pyosys
/libyosys.so
894 $(INSTALL_SUDO
) rm -vf
$(DESTDIR
)$(PYTHON_DESTDIR
)/$(subst -,_
,$(PROGRAM_PREFIX
))pyosys
/__init__.py
895 $(INSTALL_SUDO
) rmdir
$(DESTDIR
)$(PYTHON_DESTDIR
)/$(subst -,_
,$(PROGRAM_PREFIX
))pyosys
899 update-manual
: $(TARGETS
) $(EXTRA_TARGETS
)
900 cd manual
&& ..
/$(PROGRAM_PREFIX
)yosys
-p
'help -write-tex-command-reference-manual'
902 manual
: $(TARGETS
) $(EXTRA_TARGETS
)
903 cd manual
&& bash appnotes.sh
904 cd manual
&& bash presentation.sh
905 cd manual
&& bash manual.sh
910 if
test -d manual
; then cd manual
&& sh
clean.sh
; fi
911 rm -f
$(OBJS
) $(GENFILES
) $(TARGETS
) $(EXTRA_TARGETS
) $(EXTRA_OBJS
) $(PY_WRAP_INCLUDES
) $(PY_WRAPPER_FILE
).
cc
912 rm -f kernel
/version_
*.o kernel
/version_
*.
cc
913 rm -f libs
/*/*.d frontends
/*/*.d passes
/*/*.d backends
/*/*.d kernel
/*.d techlibs
/*/*.d
914 rm -rf tests
/asicworld
/*.out tests
/asicworld
/*.log
915 rm -rf tests
/hana
/*.out tests
/hana
/*.log
916 rm -rf tests
/simple
/*.out tests
/simple
/*.log
917 rm -rf tests
/memories
/*.out tests
/memories
/*.log tests
/memories
/*.dmp
918 rm -rf tests
/sat
/*.log tests
/techmap
/*.log tests
/various
/*.log
919 rm -rf tests
/bram
/temp tests
/fsm
/temp tests
/realmath
/temp tests
/share
/temp tests
/smv
/temp
920 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_
*
921 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
922 rm -f tests
/tools
/cmp_tbdata
925 $(MAKE
) -C abc DEP
= clean
926 rm -f
$(PROGRAM_PREFIX
)yosys-abc
$(EXE
) $(PROGRAM_PREFIX
)yosys-libabc.a abc
/abc-
[0-9a-f
]* abc
/libabc-
[0-9a-f
]*.a
932 .
/$(PROGRAM_PREFIX
)yosys
-qp
'help; help -all'
933 rm -rf coverage.
info coverage_html
934 lcov
--capture
-d .
--no-external
-o coverage.
info
935 genhtml coverage.
info --output-directory coverage_html
938 { for file in
$(basename $(OBJS
)); do \
939 for
prefix in
cc y l
; do if
[ -f
$${file}.
$${prefix} ]; then echo
$$file.
$${prefix}; fi
; done \
940 done
; find backends frontends kernel libs passes
-type f \
( -name
'*.h' -o
-name
'*.hh' \
); } > qtcreator.files
941 { echo .
; find backends frontends kernel libs passes
-type f \
( -name
'*.h' -o
-name
'*.hh' \
) -printf
'%h\n' |
sort -u
; } > qtcreator.includes
942 touch qtcreator.config qtcreator.creator
944 vcxsrc
: $(GENFILES
) $(EXTRA_TARGETS
)
945 rm -rf yosys-win32-vcxsrc-
$(YOSYS_VER
){,.zip
}
946 set
-e
; for f in
`ls $(filter %.cc %.cpp,$(GENFILES)) $(addsuffix .cc,$(basename $(OBJS))) $(addsuffix .cpp,$(basename $(OBJS))) 2> /dev/null`; do \
947 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
948 bash misc
/create_vcxsrc.sh yosys-win32-vcxsrc
$(YOSYS_VER
) $(GIT_REV
)
949 echo
"namespace Yosys { extern const char *yosys_version_str; const char *yosys_version_str=\"Yosys (Version Information Unavailable)\"; }" > kernel
/version.
cc
950 zip yosys-win32-vcxsrc-
$(YOSYS_VER
)/genfiles.zip
$(GENFILES
) kernel
/version.
cc
951 zip
-r yosys-win32-vcxsrc-
$(YOSYS_VER
).zip yosys-win32-vcxsrc-
$(YOSYS_VER
)/
952 rm -f srcfiles.txt kernel
/version.
cc
955 mxebin
: $(TARGETS
) $(EXTRA_TARGETS
)
956 rm -rf yosys-win32-mxebin-
$(YOSYS_VER
){,.zip
}
957 mkdir
-p yosys-win32-mxebin-
$(YOSYS_VER
)
958 cp
-r
$(PROGRAM_PREFIX
)yosys.exe share
/ yosys-win32-mxebin-
$(YOSYS_VER
)/
959 ifeq ($(ENABLE_ABC
),1)
960 cp
-r
$(PROGRAM_PREFIX
)yosys-abc.exe abc
/lib
/x86
/pthreadVC2.dll yosys-win32-mxebin-
$(YOSYS_VER
)/
962 echo
-en
'This is Yosys $(YOSYS_VER) for Win32.\r\n' > yosys-win32-mxebin-
$(YOSYS_VER
)/readme.txt
963 echo
-en
'Documentation at https://yosyshq.net/yosys/.\r\n' >> yosys-win32-mxebin-
$(YOSYS_VER
)/readme.txt
964 zip
-r yosys-win32-mxebin-
$(YOSYS_VER
).zip yosys-win32-mxebin-
$(YOSYS_VER
)/
971 echo
'CONFIG := clang' > Makefile.conf
974 echo
'CONFIG := gcc' > Makefile.conf
976 config-gcc-static
: clean
977 echo
'CONFIG := gcc-static' > Makefile.conf
978 echo
'ENABLE_PLUGINS := 0' >> Makefile.conf
979 echo
'ENABLE_READLINE := 0' >> Makefile.conf
980 echo
'ENABLE_TCL := 0' >> Makefile.conf
982 config-gcc-4.8
: clean
983 echo
'CONFIG := gcc-4.8' > Makefile.conf
985 config-afl-gcc
: clean
986 echo
'CONFIG := afl-gcc' > Makefile.conf
989 echo
'CONFIG := emcc' > Makefile.conf
990 echo
'ENABLE_TCL := 0' >> Makefile.conf
991 echo
'ENABLE_ABC := 0' >> Makefile.conf
992 echo
'ENABLE_PLUGINS := 0' >> Makefile.conf
993 echo
'ENABLE_READLINE := 0' >> Makefile.conf
994 echo
'ENABLE_ZLIB := 0' >> Makefile.conf
997 echo
'CONFIG := wasi' > Makefile.conf
998 echo
'ENABLE_TCL := 0' >> Makefile.conf
999 echo
'ENABLE_ABC := 0' >> Makefile.conf
1000 echo
'ENABLE_PLUGINS := 0' >> Makefile.conf
1001 echo
'ENABLE_READLINE := 0' >> Makefile.conf
1002 echo
'ENABLE_ZLIB := 0' >> Makefile.conf
1005 echo
'CONFIG := mxe' > Makefile.conf
1006 echo
'ENABLE_PLUGINS := 0' >> Makefile.conf
1008 config-msys2-32
: clean
1009 echo
'CONFIG := msys2-32' > Makefile.conf
1010 echo
'ENABLE_PLUGINS := 0' >> Makefile.conf
1011 echo
"PREFIX := $(MINGW_PREFIX)" >> Makefile.conf
1013 config-msys2-64
: clean
1014 echo
'CONFIG := msys2-64' > Makefile.conf
1015 echo
'ENABLE_PLUGINS := 0' >> Makefile.conf
1016 echo
"PREFIX := $(MINGW_PREFIX)" >> Makefile.conf
1018 config-cygwin
: clean
1019 echo
'CONFIG := cygwin' > Makefile.conf
1022 echo
'CONFIG := gcc' > Makefile.conf
1023 echo
'ENABLE_GCOV := 1' >> Makefile.conf
1024 echo
'ENABLE_DEBUG := 1' >> Makefile.conf
1027 echo
'CONFIG := gcc' > Makefile.conf
1028 echo
'ENABLE_GPROF := 1' >> Makefile.conf
1031 echo
"INSTALL_SUDO := sudo" >> Makefile.conf
1034 @echo
"$(YOSYS_VER)"
1043 -include frontends
/*/*.d
1044 -include passes
/*/*.d
1045 -include backends
/*/*.d
1047 -include techlibs
/*/*.d
1049 .PHONY
: all top-all abc
test install install-abc manual
clean mrproper qtcreator coverage vcxsrc mxebin
1050 .PHONY
: config-clean config-clang config-gcc config-gcc-static config-gcc-4.8 config-afl-gcc config-gprof config-sudo