9 # features (the more the better)
19 # other configuration flags
30 # SANITIZER = undefined
37 BINDIR
:= $(PREFIX
)/bin
38 LIBDIR
:= $(PREFIX
)/lib
39 DATDIR
:= $(PREFIX
)/share
/yosys
46 TARGETS
= yosys
$(EXE
) yosys-config
52 UNITESTPATH
:= tests
/unit
56 YOSYS_SRC
:= $(dir $(firstword $(MAKEFILE_LIST
)))
59 CXXFLAGS
:= $(CXXFLAGS
) -Wall
-Wextra
-ggdb
-I.
-I
"$(YOSYS_SRC)" -MD
-D_YOSYS_
-fPIC
-I
$(PREFIX
)/include
60 LDFLAGS
:= $(LDFLAGS
) -L
$(LIBDIR
)
61 LDLIBS
:= $(LDLIBS
) -lstdc
++ -lm
64 PKG_CONFIG ?
= pkg-config
68 ifeq (Darwin
,$(findstring Darwin
,$(shell uname
)))
69 PLUGIN_LDFLAGS
+= -undefined dynamic_lookup
71 # homebrew search paths
72 ifneq ($(shell which brew
),)
73 BREW_PREFIX
:= $(shell brew
--prefix)/opt
74 CXXFLAGS
+= -I
$(BREW_PREFIX
)/readline
/include
75 LDFLAGS
+= -L
$(BREW_PREFIX
)/readline
/lib
76 PKG_CONFIG_PATH
:= $(BREW_PREFIX
)/libffi
/lib
/pkgconfig
:$(PKG_CONFIG_PATH
)
77 PKG_CONFIG_PATH
:= $(BREW_PREFIX
)/tcl-tk
/lib
/pkgconfig
:$(PKG_CONFIG_PATH
)
78 export PATH
:= $(BREW_PREFIX
)/bison
/bin
:$(BREW_PREFIX
)/gettext
/bin
:$(BREW_PREFIX
)/flex
/bin
:$(PATH
)
80 # macports search paths
81 else ifneq ($(shell which port
),)
82 PORT_PREFIX
:= $(patsubst %/bin
/port
,%,$(shell which port
))
83 CXXFLAGS
+= -I
$(PORT_PREFIX
)/include
84 LDFLAGS
+= -L
$(PORT_PREFIX
)/lib
85 PKG_CONFIG_PATH
:= $(PORT_PREFIX
)/lib
/pkgconfig
:$(PKG_CONFIG_PATH
)
86 export PATH
:= $(PORT_PREFIX
)/bin
:$(PATH
)
94 YOSYS_VER
:= 0.7+$(shell cd
$(YOSYS_SRC
) && test -e .git
&& { git log
--author
=clifford@clifford.at
--oneline
61f6811.. | wc
-l
; })
95 GIT_REV
:= $(shell cd
$(YOSYS_SRC
) && git rev-parse
--short HEAD
2> /dev
/null || echo UNKNOWN
)
96 OBJS
= kernel
/version_
$(GIT_REV
).o
98 # set 'ABCREV = default' to use abc/ as it is
100 # Note: If you do ABC development, make sure that 'abc' in this directory
101 # is just a symlink to your actual ABC working directory, as 'make mrproper'
102 # will remove the 'abc' directory and you do not want to accidentally
103 # delete your work on ABC..
104 ABCREV
= f6838749f234
106 ABCURL ?
= https
://bitbucket.org
/alanmi
/abc
107 ABCMKARGS
= CC
="$(CXX)" CXX
="$(CXX)" ABC_USE_LIBSTDCXX
=1
109 # set ABCEXTERNAL = <abc-command> to use an external ABC instance
110 # Note: The in-tree ABC (yosys-abc) will not be installed when ABCEXTERNAL is set.
118 ifneq ($(wildcard Makefile.conf
),)
119 $(info $(subst $$--$$,$(newline
),$(shell sed
's,^,[Makefile.conf] ,; s,$$,$$--$$,;' < Makefile.conf | tr
-d
'\n' | sed
's,\$$--\$$$$,,')))
120 include Makefile.conf
123 ifeq ($(CONFIG
),clang
)
126 CXXFLAGS
+= -std
=c
++11 -Os
128 ifneq ($(SANITIZER
),)
129 $(info [Clang Sanitizer
] $(SANITIZER
))
130 CXXFLAGS
+= -g
-O1
-fno-omit-frame-pointer
-fno-optimize-sibling-calls
-fsanitize
=$(SANITIZER
)
131 LDFLAGS
+= -g
-fsanitize
=$(SANITIZER
)
132 ifeq ($(SANITIZER
),address
)
135 ifeq ($(SANITIZER
),memory
)
136 CXXFLAGS
+= -fPIE
-fsanitize-memory-track-origins
137 LDFLAGS
+= -fPIE
-fsanitize-memory-track-origins
139 ifeq ($(SANITIZER
),cfi
)
145 else ifeq ($(CONFIG
),gcc
)
148 CXXFLAGS
+= -std
=c
++11 -Os
150 else ifeq ($(CONFIG
),gcc-4.8
)
153 CXXFLAGS
+= -std
=c
++11 -Os
155 else ifeq ($(CONFIG
),emcc
)
158 CXXFLAGS
:= -std
=c
++11 $(filter-out -fPIC
-ggdb
,$(CXXFLAGS
))
159 EMCCFLAGS
:= -Os
-Wno-warn-absolute-paths
160 EMCCFLAGS
+= --memory-init-file
0 --embed-file share
-s NO_EXIT_RUNTIME
=1
161 EMCCFLAGS
+= -s EXPORTED_FUNCTIONS
="['_main','_run','_prompt','_errmsg']"
162 EMCCFLAGS
+= -s TOTAL_MEMORY
=128*1024*1024
163 # https://github.com/kripken/emscripten/blob/master/src/settings.js
164 CXXFLAGS
+= $(EMCCFLAGS
)
165 LDFLAGS
+= $(EMCCFLAGS
)
169 TARGETS
:= $(filter-out yosys-config
,$(TARGETS
))
170 EXTRA_TARGETS
+= yosysjs-
$(YOSYS_VER
).zip
173 wget
-O viz.js.part https
://github.com
/mdaines
/viz.js
/releases
/download
/0.0.3/viz.js
174 mv viz.js.part viz.js
176 yosysjs-
$(YOSYS_VER
).zip
: yosys.js viz.js misc
/yosysjs
/*
177 rm -rf yosysjs-
$(YOSYS_VER
) yosysjs-
$(YOSYS_VER
).zip
178 mkdir
-p yosysjs-
$(YOSYS_VER
)
179 cp viz.js misc
/yosysjs
/* yosys.js yosysjs-
$(YOSYS_VER
)/
180 zip
-r yosysjs-
$(YOSYS_VER
).zip yosysjs-
$(YOSYS_VER
)
182 yosys.html
: misc
/yosys.html
183 $(P
) cp misc
/yosys.html yosys.html
185 else ifeq ($(CONFIG
),mxe
)
186 PKG_CONFIG
= /usr
/local
/src
/mxe
/usr
/bin
/i686-w64-mingw32.static-pkg-config
187 CXX
= /usr
/local
/src
/mxe
/usr
/bin
/i686-w64-mingw32.static-gcc
188 LD
= /usr
/local
/src
/mxe
/usr
/bin
/i686-w64-mingw32.static-gcc
189 CXXFLAGS
+= -std
=c
++11 -Os
-D_POSIX_SOURCE
-DYOSYS_MXE_HACKS
-Wno-attributes
190 CXXFLAGS
:= $(filter-out -fPIC
,$(CXXFLAGS
))
191 LDFLAGS
:= $(filter-out -rdynamic
,$(LDFLAGS
)) -s
192 LDLIBS
:= $(filter-out -lrt
,$(LDLIBS
))
193 ABCMKARGS
+= ARCHFLAGS
="-DSIZEOF_VOID_P=4 -DSIZEOF_LONG=4 -DSIZEOF_INT=4 -DWIN32_NO_DLL -DHAVE_STRUCT_TIMESPEC -fpermissive -w"
194 ABCMKARGS
+= LIBS
="lib/x86/pthreadVC2.lib -s" ABC_USE_NO_READLINE
=1 CC
="$(CXX)" CXX
="$(CXX)"
197 else ifeq ($(CONFIG
),msys2
)
198 CXX
= i686-w64-mingw32-gcc
199 LD
= i686-w64-mingw32-gcc
200 CXXFLAGS
+= -std
=c
++11 -Os
-D_POSIX_SOURCE
-DYOSYS_WIN32_UNIX_DIR
201 CXXFLAGS
:= $(filter-out -fPIC
,$(CXXFLAGS
))
202 LDFLAGS
:= $(filter-out -rdynamic
,$(LDFLAGS
)) -s
203 LDLIBS
:= $(filter-out -lrt
,$(LDLIBS
))
204 ABCMKARGS
+= ARCHFLAGS
="-DSIZEOF_VOID_P=4 -DSIZEOF_LONG=4 -DSIZEOF_INT=4 -DWIN32_NO_DLL -DHAVE_STRUCT_TIMESPEC -fpermissive -w"
205 ABCMKARGS
+= LIBS
="lib/x86/pthreadVC2.lib -s" ABC_USE_NO_READLINE
=0 CC
="$(CXX)" CXX
="$(CXX)"
208 else ifneq ($(CONFIG
),none
)
209 $(error Invalid CONFIG setting
'$(CONFIG)'. Valid values
: clang
, gcc
, gcc-4.8
, emcc
, mxe
, msys2
)
212 ifeq ($(ENABLE_LIBYOSYS
),1)
213 TARGETS
+= libyosys.so
216 ifeq ($(ENABLE_READLINE
),1)
217 CXXFLAGS
+= -DYOSYS_ENABLE_READLINE
219 ifeq ($(LINK_CURSES
),1)
221 ABCMKARGS
+= "ABC_READLINE_LIBRARIES=-lcurses -lreadline"
223 ifeq ($(LINK_TERMCAP
),1)
225 ABCMKARGS
+= "ABC_READLINE_LIBRARIES=-lreadline -ltermcap"
231 ifeq ($(ENABLE_EDITLINE
),1)
232 CXXFLAGS
+= -DYOSYS_ENABLE_EDITLINE
233 LDLIBS
+= -ledit
-ltinfo
-lbsd
237 ifeq ($(ENABLE_PLUGINS
),1)
238 CXXFLAGS
+= $(shell PKG_CONFIG_PATH
=$(PKG_CONFIG_PATH
) $(PKG_CONFIG
) --silence-errors
--cflags libffi
) -DYOSYS_ENABLE_PLUGINS
239 LDLIBS
+= $(shell PKG_CONFIG_PATH
=$(PKG_CONFIG_PATH
) $(PKG_CONFIG
) --silence-errors
--libs libffi || echo
-lffi
) -ldl
242 ifeq ($(ENABLE_TCL
),1)
243 TCL_VERSION ?
= tcl
$(shell bash
-c
"tclsh <(echo 'puts [info tclversion]')")
244 TCL_INCLUDE ?
= /usr
/include/$(TCL_VERSION
)
247 CXXFLAGS
+= -DYOSYS_ENABLE_TCL
248 LDLIBS
+= -ltcl86
-lwsock32
-lws2_32
-lnetapi32
250 CXXFLAGS
+= $(shell PKG_CONFIG_PATH
=$(PKG_CONFIG_PATH
) $(PKG_CONFIG
) --silence-errors
--cflags tcl || echo
-I
$(TCL_INCLUDE
)) -DYOSYS_ENABLE_TCL
251 LDLIBS
+= $(shell PKG_CONFIG_PATH
=$(PKG_CONFIG_PATH
) $(PKG_CONFIG
) --silence-errors
--libs tcl || echo
-l
$(TCL_VERSION
))
255 ifeq ($(ENABLE_GPROF
),1)
260 ifeq ($(ENABLE_NDEBUG
),1)
261 CXXFLAGS
:= -O3
-DNDEBUG
$(filter-out -Os
-ggdb
,$(CXXFLAGS
))
264 ifeq ($(ENABLE_DEBUG
),1)
265 ifeq ($(CONFIG
),clang
)
266 CXXFLAGS
:= -O0
$(filter-out -Os
,$(CXXFLAGS
))
268 CXXFLAGS
:= -Og
$(filter-out -Os
,$(CXXFLAGS
))
272 ifeq ($(ENABLE_ABC
),1)
273 CXXFLAGS
+= -DYOSYS_ENABLE_ABC
274 ifeq ($(ABCEXTERNAL
),)
275 TARGETS
+= yosys-abc
$(EXE
)
279 ifeq ($(ENABLE_VERIFIC
),1)
280 VERIFIC_DIR ?
= /usr
/local
/src
/verific_lib_eval
281 VERIFIC_COMPONENTS ?
= verilog vhdl database util containers sdf
282 CXXFLAGS
+= $(patsubst %,-I
$(VERIFIC_DIR
)/%,$(VERIFIC_COMPONENTS
)) -DYOSYS_ENABLE_VERIFIC
283 LDLIBS
+= $(patsubst %,$(VERIFIC_DIR
)/%/*-linux.a
,$(VERIFIC_COMPONENTS
))
286 ifeq ($(ENABLE_COVER
),1)
287 CXXFLAGS
+= -DYOSYS_ENABLE_COVER
290 define add_share_file
291 EXTRA_TARGETS
+= $(subst //,/,$(1)/$(notdir $(2)))
292 $(subst //,/,$(1)/$(notdir $(2))): $(2)
294 $$(Q
) cp
"$(YOSYS_SRC)"/$(2) $(subst //,/,$(1)/$(notdir $(2)))
297 define add_gen_share_file
298 EXTRA_TARGETS
+= $(subst //,/,$(1)/$(notdir $(2)))
299 $(subst //,/,$(1)/$(notdir $(2))): $(2)
301 $$(Q
) cp
$(2) $(subst //,/,$(1)/$(notdir $(2)))
304 define add_include_file
305 $(eval
$(call add_share_file
,$(dir share
/include/$(1)),$(1)))
311 P_UPDATE
= $(eval P_STATUS
=$(shell echo
$(OBJS
) yosys
$(EXE
) | gawk
'BEGIN { RS = " "; I = $(P_STATUS)+0; } $$1 == "$@" && NR > I { I = NR; } END { print I; }'))
312 P_SHOW
= [$(shell gawk
"BEGIN { N=$(words $(OBJS) yosys$(EXE)); printf \"%3d\", $(P_OFFSET)+90*$(P_STATUS)/N; exit; }")%]
313 P
= @echo
"$(if $(findstring $@,$(TARGETS) $(EXTRA_TARGETS)),$(eval P_OFFSET = 10))$(call P_UPDATE)$(call P_SHOW) Building $@";
323 $(eval
$(call add_include_file
,kernel
/yosys.h
))
324 $(eval
$(call add_include_file
,kernel
/hashlib.h
))
325 $(eval
$(call add_include_file
,kernel
/log.h
))
326 $(eval
$(call add_include_file
,kernel
/rtlil.h
))
327 $(eval
$(call add_include_file
,kernel
/register.h
))
328 $(eval
$(call add_include_file
,kernel
/celltypes.h
))
329 $(eval
$(call add_include_file
,kernel
/celledges.h
))
330 $(eval
$(call add_include_file
,kernel
/consteval.h
))
331 $(eval
$(call add_include_file
,kernel
/sigtools.h
))
332 $(eval
$(call add_include_file
,kernel
/modtools.h
))
333 $(eval
$(call add_include_file
,kernel
/macc.h
))
334 $(eval
$(call add_include_file
,kernel
/utils.h
))
335 $(eval
$(call add_include_file
,kernel
/satgen.h
))
336 $(eval
$(call add_include_file
,libs
/ezsat
/ezsat.h
))
337 $(eval
$(call add_include_file
,libs
/ezsat
/ezminisat.h
))
338 $(eval
$(call add_include_file
,libs
/sha1
/sha1.h
))
339 $(eval
$(call add_include_file
,passes
/fsm
/fsmdata.h
))
340 $(eval
$(call add_include_file
,frontends
/ast
/ast.h
))
341 $(eval
$(call add_include_file
,backends
/ilang
/ilang_backend.h
))
343 OBJS
+= kernel
/driver.o kernel
/register.o kernel
/rtlil.o kernel
/log.o kernel
/calc.o kernel
/yosys.o
344 OBJS
+= kernel
/cellaigs.o kernel
/celledges.o
346 kernel
/log.o
: CXXFLAGS
+= -DYOSYS_SRC
='"$(YOSYS_SRC)"'
347 kernel
/yosys.o
: CXXFLAGS
+= -DYOSYS_DATDIR
='"$(DATDIR)"'
349 OBJS
+= libs
/bigint
/BigIntegerAlgorithms.o libs
/bigint
/BigInteger.o libs
/bigint
/BigIntegerUtils.o
350 OBJS
+= libs
/bigint
/BigUnsigned.o libs
/bigint
/BigUnsignedInABase.o
352 OBJS
+= libs
/sha1
/sha1.o
356 OBJS
+= libs
/subcircuit
/subcircuit.o
358 OBJS
+= libs
/ezsat
/ezsat.o
359 OBJS
+= libs
/ezsat
/ezminisat.o
361 OBJS
+= libs
/minisat
/Options.o
362 OBJS
+= libs
/minisat
/SimpSolver.o
363 OBJS
+= libs
/minisat
/Solver.o
364 OBJS
+= libs
/minisat
/System.o
366 include $(YOSYS_SRC
)/frontends
/*/Makefile.inc
367 include $(YOSYS_SRC
)/passes
/*/Makefile.inc
368 include $(YOSYS_SRC
)/backends
/*/Makefile.inc
369 include $(YOSYS_SRC
)/techlibs
/*/Makefile.inc
373 include frontends
/verilog
/Makefile.inc
374 include frontends
/ilang
/Makefile.inc
375 include frontends
/ast
/Makefile.inc
376 include frontends
/blif
/Makefile.inc
378 OBJS
+= passes
/hierarchy
/hierarchy.o
379 OBJS
+= passes
/cmds
/select.o
380 OBJS
+= passes
/cmds
/show.o
381 OBJS
+= passes
/cmds
/stat.o
382 OBJS
+= passes
/cmds
/cover.o
383 OBJS
+= passes
/cmds
/design.o
384 OBJS
+= passes
/cmds
/plugin.o
386 include passes
/proc
/Makefile.inc
387 include passes
/opt
/Makefile.inc
388 include passes
/techmap
/Makefile.inc
390 include backends
/verilog
/Makefile.inc
391 include backends
/ilang
/Makefile.inc
393 include techlibs
/common
/Makefile.inc
397 top-all
: $(TARGETS
) $(EXTRA_TARGETS
)
399 @echo
" Build successful."
402 ifeq ($(CONFIG
),emcc
)
403 yosys.js
: $(filter-out yosysjs-
$(YOSYS_VER
).zip
,$(EXTRA_TARGETS
))
407 $(P
) $(LD
) -o yosys
$(EXE
) $(LDFLAGS
) $(OBJS
) $(LDLIBS
)
409 libyosys.so
: $(filter-out kernel
/driver.o
,$(OBJS
))
410 $(P
) $(LD
) -o libyosys.so
-shared
-Wl
,-soname
,libyosys.so
$(LDFLAGS
) $^
$(LDLIBS
)
413 $(Q
) mkdir
-p
$(dir $@
)
414 $(P
) $(CXX
) -o
$@
-c
$(CPPFLAGS
) $(CXXFLAGS
) $<
417 $(Q
) mkdir
-p
$(dir $@
)
418 $(P
) $(CXX
) -o
$@
-c
$(CPPFLAGS
) $(CXXFLAGS
) $<
420 YOSYS_VER_STR
:= Yosys
$(YOSYS_VER
) (git sha1
$(GIT_REV
), $(notdir $(CXX
)) $(shell \
421 $(CXX
) --version | tr
' ()' '\n' | grep
'^[0-9]' | head
-n1
) $(filter -f
% -m
% -O
% -DNDEBUG
,$(CXXFLAGS
)))
423 kernel
/version_
$(GIT_REV
).
cc: $(YOSYS_SRC
)/Makefile
424 $(P
) rm -f kernel
/version_
*.o kernel
/version_
*.d kernel
/version_
*.
cc
425 $(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
427 yosys-config
: misc
/yosys-config.in
428 $(P
) $(SED
) -e
's#@CXXFLAGS@#$(subst -I. -I"$(YOSYS_SRC)",-I"$(DATDIR)/include",$(CXXFLAGS))#;' \
429 -e
's#@CXX@#$(CXX)#;' -e
's#@LDFLAGS@#$(LDFLAGS) $(PLUGIN_LDFLAGS)#;' -e
's#@LDLIBS@#$(LDLIBS)#;' \
430 -e
's#@BINDIR@#$(BINDIR)#;' -e
's#@DATDIR@#$(DATDIR)#;' < $< > yosys-config
431 $(Q
) chmod
+x yosys-config
433 abc
/abc-
$(ABCREV
)$(EXE
):
435 ifneq ($(ABCREV
),default
)
436 $(Q
) if
( cd abc
2> /dev
/null
&& hg identify
; ) | grep
-q
+; then \
437 echo
'REEBE: NOP pbagnvaf ybpny zbqvsvpngvbaf! Frg NOPERI=qrsnhyg va Lbflf Znxrsvyr!' | tr
'A-Za-z' 'N-ZA-Mn-za-m'; false
; \
439 $(Q
) if
test "`cd abc 2> /dev/null && hg identify | cut -f1 -d' '`" != "$(ABCREV)"; then \
440 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; }; \
441 echo
"Pulling ABC from $(ABCURL):"; set
-x
; \
442 test -d abc || hg clone
$(ABCURL
) abc
; \
443 cd abc
&& $(MAKE
) DEP
= clean && hg pull
&& hg update
-r
$(ABCREV
); \
446 $(Q
) rm -f abc
/abc-
[0-9a-f
]*
447 $(Q
) cd abc
&& $(MAKE
) $(S
) $(ABCMKARGS
) PROG
="abc-$(ABCREV)$(EXE)" MSG_PREFIX
="$(eval P_OFFSET = 5)$(call P_SHOW)$(eval P_OFFSET = 10) ABC: "
449 ifeq ($(ABCREV
),default
)
450 .PHONY
: abc
/abc-
$(ABCREV
)$(EXE
)
453 yosys-abc
$(EXE
): abc
/abc-
$(ABCREV
)$(EXE
)
454 $(P
) cp abc
/abc-
$(ABCREV
)$(EXE
) yosys-abc
$(EXE
)
462 test: $(TARGETS
) $(EXTRA_TARGETS
)
463 +cd tests
/simple
&& bash run-test.sh
$(SEEDOPT
)
464 +cd tests
/hana
&& bash run-test.sh
$(SEEDOPT
)
465 +cd tests
/asicworld
&& bash run-test.sh
$(SEEDOPT
)
466 +cd tests
/realmath
&& bash run-test.sh
$(SEEDOPT
)
467 +cd tests
/share
&& bash run-test.sh
$(SEEDOPT
)
468 +cd tests
/fsm
&& bash run-test.sh
$(SEEDOPT
)
469 +cd tests
/techmap
&& bash run-test.sh
470 +cd tests
/memories
&& bash run-test.sh
$(SEEDOPT
)
471 +cd tests
/bram
&& bash run-test.sh
$(SEEDOPT
)
472 +cd tests
/various
&& bash run-test.sh
473 +cd tests
/sat
&& bash run-test.sh
475 @echo
" Passed \"make test\"."
478 VALGRIND ?
= valgrind
--error-exitcode
=1 --leak-check
=full
--show-reachable
=yes
--errors-for-leak-kinds
=all
480 vgtest
: $(TARGETS
) $(EXTRA_TARGETS
)
481 $(VALGRIND
) .
/yosys
-p
'setattr -mod -unset top; synth' $$( ls tests
/simple
/*.v | grep
-v repwhile.v
)
483 @echo
" Passed \"make vgtest\"."
486 vloghtb
: $(TARGETS
) $(EXTRA_TARGETS
)
487 +cd tests
/vloghtb
&& bash run-test.sh
489 @echo
" Passed \"make vloghtb\"."
493 unit-test
: libyosys.so
494 @
$(MAKE
) -C
$(UNITESTPATH
) CXX
="$(CXX)" CPPFLAGS
="$(CPPFLAGS)" \
495 CXXFLAGS
="$(CXXFLAGS)" LDLIBS
="$(LDLIBS)" ROOTPATH
="$(CURDIR)"
498 @
$(MAKE
) -C
$(UNITESTPATH
) clean
500 install: $(TARGETS
) $(EXTRA_TARGETS
)
501 $(INSTALL_SUDO
) mkdir
-p
$(DESTDIR
)$(BINDIR
)
502 $(INSTALL_SUDO
) install $(TARGETS
) $(DESTDIR
)$(BINDIR
)
503 $(INSTALL_SUDO
) mkdir
-p
$(DESTDIR
)$(DATDIR
)
504 $(INSTALL_SUDO
) cp
-r share
/.
$(DESTDIR
)$(DATDIR
)/.
505 ifeq ($(ENABLE_LIBYOSYS
),1)
506 $(INSTALL_SUDO
) cp libyosys.so
$(DESTDIR
)$(LIBDIR
)
507 $(INSTALL_SUDO
) ldconfig
511 $(INSTALL_SUDO
) rm -vf
$(addprefix $(DESTDIR
)$(BINDIR
)/,$(notdir $(TARGETS
)))
512 $(INSTALL_SUDO
) rm -rvf
$(DESTDIR
)$(DATDIR
)
513 ifeq ($(ENABLE_LIBYOSYS
),1)
514 $(INSTALL_SUDO
) rm -vf
$(DESTDIR
)$(LIBDIR
)/libyosys.so
517 update-manual
: $(TARGETS
) $(EXTRA_TARGETS
)
518 cd manual
&& ..
/yosys
-p
'help -write-tex-command-reference-manual'
520 manual
: $(TARGETS
) $(EXTRA_TARGETS
)
521 cd manual
&& bash appnotes.sh
522 cd manual
&& bash presentation.sh
523 cd manual
&& bash manual.sh
527 if
test -d manual
; then cd manual
&& sh
clean.sh
; fi
528 rm -f
$(OBJS
) $(GENFILES
) $(TARGETS
) $(EXTRA_TARGETS
) $(EXTRA_OBJS
)
529 rm -f kernel
/version_
*.o kernel
/version_
*.
cc abc
/abc-
[0-9a-f
]*
530 rm -f libs
/*/*.d frontends
/*/*.d passes
/*/*.d backends
/*/*.d kernel
/*.d techlibs
/*/*.d
531 rm -rf tests
/asicworld
/*.out tests
/asicworld
/*.log
532 rm -rf tests
/hana
/*.out tests
/hana
/*.log
533 rm -rf tests
/simple
/*.out tests
/simple
/*.log
534 rm -rf tests
/memories
/*.out tests
/memories
/*.log tests
/memories
/*.dmp
535 rm -rf tests
/sat
/*.log tests
/techmap
/*.log tests
/various
/*.log
536 rm -rf tests
/bram
/temp tests
/fsm
/temp tests
/realmath
/temp tests
/share
/temp tests
/smv
/temp
537 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_
*
538 rm -f tests
/tools
/cmp_tbdata
541 $(MAKE
) -C abc DEP
= clean
542 rm -f yosys-abc
$(EXE
) abc
/abc-
[0-9a-f
]*
548 { for file in
$(basename $(OBJS
)); do \
549 for
prefix in
cc y l
; do if
[ -f
$${file}.
$${prefix} ]; then echo
$$file.
$${prefix}; fi
; done \
550 done
; find backends frontends kernel libs passes
-type f \
( -name
'*.h' -o
-name
'*.hh' \
); } > qtcreator.files
551 { echo .
; find backends frontends kernel libs passes
-type f \
( -name
'*.h' -o
-name
'*.hh' \
) -printf
'%h\n' |
sort -u
; } > qtcreator.includes
552 touch qtcreator.config qtcreator.creator
554 vcxsrc
: $(GENFILES
) $(EXTRA_TARGETS
)
555 rm -rf yosys-win32-vcxsrc-
$(YOSYS_VER
){,.zip
}
556 set
-e
; for f in
`ls $(filter %.cc %.cpp,$(GENFILES)) $(addsuffix .cc,$(basename $(OBJS))) $(addsuffix .cpp,$(basename $(OBJS))) 2> /dev/null`; do \
557 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
558 bash misc
/create_vcxsrc.sh yosys-win32-vcxsrc
$(YOSYS_VER
) $(GIT_REV
)
559 echo
"namespace Yosys { extern const char *yosys_version_str; const char *yosys_version_str=\"Yosys (Version Information Unavailable)\"; }" > kernel
/version.
cc
560 zip yosys-win32-vcxsrc-
$(YOSYS_VER
)/genfiles.zip
$(GENFILES
) kernel
/version.
cc
561 zip
-r yosys-win32-vcxsrc-
$(YOSYS_VER
).zip yosys-win32-vcxsrc-
$(YOSYS_VER
)/
562 rm -f srcfiles.txt kernel
/version.
cc
565 mxebin
: $(TARGETS
) $(EXTRA_TARGETS
)
566 rm -rf yosys-win32-mxebin-
$(YOSYS_VER
){,.zip
}
567 mkdir
-p yosys-win32-mxebin-
$(YOSYS_VER
)
568 cp
-r yosys.exe share
/ yosys-win32-mxebin-
$(YOSYS_VER
)/
569 ifeq ($(ENABLE_ABC
),1)
570 cp
-r yosys-abc.exe abc
/lib
/x86
/pthreadVC2.dll yosys-win32-mxebin-
$(YOSYS_VER
)/
572 echo
-en
'This is Yosys $(YOSYS_VER) for Win32.\r\n' > yosys-win32-mxebin-
$(YOSYS_VER
)/readme.txt
573 echo
-en
'Documentation at http://www.clifford.at/yosys/.\r\n' >> yosys-win32-mxebin-
$(YOSYS_VER
)/readme.txt
574 zip
-r yosys-win32-mxebin-
$(YOSYS_VER
).zip yosys-win32-mxebin-
$(YOSYS_VER
)/
581 echo
'CONFIG := clang' > Makefile.conf
584 echo
'CONFIG := gcc' > Makefile.conf
586 config-gcc-4.8
: clean
587 echo
'CONFIG := gcc-4.8' > Makefile.conf
590 echo
'CONFIG := emcc' > Makefile.conf
591 echo
'ENABLE_TCL := 0' >> Makefile.conf
592 echo
'ENABLE_ABC := 0' >> Makefile.conf
593 echo
'ENABLE_PLUGINS := 0' >> Makefile.conf
594 echo
'ENABLE_READLINE := 0' >> Makefile.conf
597 echo
'CONFIG := mxe' > Makefile.conf
598 echo
'ENABLE_PLUGINS := 0' >> Makefile.conf
601 echo
'CONFIG := msys2' > Makefile.conf
604 echo
'CONFIG := gcc' > Makefile.conf
605 echo
'ENABLE_GPROF := 1' >> Makefile.conf
608 echo
"INSTALL_SUDO := sudo" >> Makefile.conf
617 -include frontends
/*/*.d
618 -include passes
/*/*.d
619 -include backends
/*/*.d
621 -include techlibs
/*/*.d
623 .PHONY
: all top-all abc
test install install-abc manual
clean mrproper qtcreator
624 .PHONY
: config-clean config-clang config-gcc config-gcc-4.8 config-gprof config-sudo