9 # features (the more the better)
18 # other configuration flags
29 # SANITIZER = undefined
36 BINDIR
:= $(PREFIX
)/bin
37 LIBDIR
:= $(PREFIX
)/lib
38 DATDIR
:= $(PREFIX
)/share
/yosys
45 TARGETS
= yosys
$(EXE
) yosys-config
51 UNITESTPATH
:= tests
/unit
55 YOSYS_SRC
:= $(dir $(firstword $(MAKEFILE_LIST
)))
58 CXXFLAGS
:= $(CXXFLAGS
) -Wall
-Wextra
-ggdb
-I.
-I
"$(YOSYS_SRC)" -MD
-D_YOSYS_
-fPIC
-I
$(PREFIX
)/include
59 LDFLAGS
:= $(LDFLAGS
) -L
$(LIBDIR
)
60 LDLIBS
:= $(LDLIBS
) -lstdc
++ -lm
63 PKG_CONFIG ?
= pkg-config
67 ifeq (Darwin
,$(findstring Darwin
,$(shell uname
)))
68 PLUGIN_LDFLAGS
+= -undefined dynamic_lookup
70 # homebrew search paths
71 ifneq ($(shell which brew
),)
72 BREW_PREFIX
:= $(shell brew
--prefix)/opt
73 CXXFLAGS
+= -I
$(BREW_PREFIX
)/readline
/include
74 LDFLAGS
+= -L
$(BREW_PREFIX
)/readline
/lib
75 PKG_CONFIG_PATH
:= $(BREW_PREFIX
)/libffi
/lib
/pkgconfig
:$(PKG_CONFIG_PATH
)
76 PKG_CONFIG_PATH
:= $(BREW_PREFIX
)/tcl-tk
/lib
/pkgconfig
:$(PKG_CONFIG_PATH
)
77 export PATH
:= $(BREW_PREFIX
)/bison
/bin
:$(BREW_PREFIX
)/gettext
/bin
:$(BREW_PREFIX
)/flex
/bin
:$(PATH
)
79 # macports search paths
80 else ifneq ($(shell which port
),)
81 PORT_PREFIX
:= $(patsubst %/bin
/port
,%,$(shell which port
))
82 CXXFLAGS
+= -I
$(PORT_PREFIX
)/include
83 LDFLAGS
+= -L
$(PORT_PREFIX
)/lib
84 PKG_CONFIG_PATH
:= $(PORT_PREFIX
)/lib
/pkgconfig
:$(PKG_CONFIG_PATH
)
85 export PATH
:= $(PORT_PREFIX
)/bin
:$(PATH
)
93 YOSYS_VER
:= 0.7+$(shell cd
$(YOSYS_SRC
) && test -e .git
&& { git log
--author
=clifford@clifford.at
--oneline
61f6811.. | wc
-l
; })
94 GIT_REV
:= $(shell cd
$(YOSYS_SRC
) && git rev-parse
--short HEAD
2> /dev
/null || echo UNKNOWN
)
95 OBJS
= kernel
/version_
$(GIT_REV
).o
97 # set 'ABCREV = default' to use abc/ as it is
99 # Note: If you do ABC development, make sure that 'abc' in this directory
100 # is just a symlink to your actual ABC working directory, as 'make mrproper'
101 # will remove the 'abc' directory and you do not want to accidentally
102 # delete your work on ABC..
103 ABCREV
= f6838749f234
105 ABCURL ?
= https
://bitbucket.org
/alanmi
/abc
106 ABCMKARGS
= CC
="$(CXX)" CXX
="$(CXX)" ABC_USE_LIBSTDCXX
=1
108 # set ABCEXTERNAL = <abc-command> to use an external ABC instance
109 # Note: The in-tree ABC (yosys-abc) will not be installed when ABCEXTERNAL is set.
117 ifneq ($(wildcard Makefile.conf
),)
118 $(info $(subst $$--$$,$(newline
),$(shell sed
's,^,[Makefile.conf] ,; s,$$,$$--$$,;' < Makefile.conf | tr
-d
'\n' | sed
's,\$$--\$$$$,,')))
119 include Makefile.conf
122 ifeq ($(CONFIG
),clang
)
125 CXXFLAGS
+= -std
=c
++11 -Os
127 ifneq ($(SANITIZER
),)
128 $(info [Clang Sanitizer
] $(SANITIZER
))
129 CXXFLAGS
+= -g
-O1
-fno-omit-frame-pointer
-fno-optimize-sibling-calls
-fsanitize
=$(SANITIZER
)
130 LDFLAGS
+= -g
-fsanitize
=$(SANITIZER
)
131 ifeq ($(SANITIZER
),address
)
134 ifeq ($(SANITIZER
),memory
)
135 CXXFLAGS
+= -fPIE
-fsanitize-memory-track-origins
136 LDFLAGS
+= -fPIE
-fsanitize-memory-track-origins
138 ifeq ($(SANITIZER
),cfi
)
144 else ifeq ($(CONFIG
),gcc
)
147 CXXFLAGS
+= -std
=c
++11 -Os
149 else ifeq ($(CONFIG
),gcc-4.8
)
152 CXXFLAGS
+= -std
=c
++11 -Os
154 else ifeq ($(CONFIG
),emcc
)
157 CXXFLAGS
:= -std
=c
++11 $(filter-out -fPIC
-ggdb
,$(CXXFLAGS
))
158 EMCCFLAGS
:= -Os
-Wno-warn-absolute-paths
159 EMCCFLAGS
+= --memory-init-file
0 --embed-file share
-s NO_EXIT_RUNTIME
=1
160 EMCCFLAGS
+= -s EXPORTED_FUNCTIONS
="['_main','_run','_prompt','_errmsg']"
161 EMCCFLAGS
+= -s TOTAL_MEMORY
=128*1024*1024
162 # https://github.com/kripken/emscripten/blob/master/src/settings.js
163 CXXFLAGS
+= $(EMCCFLAGS
)
164 LDFLAGS
+= $(EMCCFLAGS
)
168 TARGETS
:= $(filter-out yosys-config
,$(TARGETS
))
169 EXTRA_TARGETS
+= yosysjs-
$(YOSYS_VER
).zip
172 wget
-O viz.js.part https
://github.com
/mdaines
/viz.js
/releases
/download
/0.0.3/viz.js
173 mv viz.js.part viz.js
175 yosysjs-
$(YOSYS_VER
).zip
: yosys.js viz.js misc
/yosysjs
/*
176 rm -rf yosysjs-
$(YOSYS_VER
) yosysjs-
$(YOSYS_VER
).zip
177 mkdir
-p yosysjs-
$(YOSYS_VER
)
178 cp viz.js misc
/yosysjs
/* yosys.js yosysjs-
$(YOSYS_VER
)/
179 zip
-r yosysjs-
$(YOSYS_VER
).zip yosysjs-
$(YOSYS_VER
)
181 yosys.html
: misc
/yosys.html
182 $(P
) cp misc
/yosys.html yosys.html
184 else ifeq ($(CONFIG
),mxe
)
185 PKG_CONFIG
= /usr
/local
/src
/mxe
/usr
/bin
/i686-w64-mingw32.static-pkg-config
186 CXX
= /usr
/local
/src
/mxe
/usr
/bin
/i686-w64-mingw32.static-gcc
187 LD
= /usr
/local
/src
/mxe
/usr
/bin
/i686-w64-mingw32.static-gcc
188 CXXFLAGS
+= -std
=c
++11 -Os
-D_POSIX_SOURCE
-DYOSYS_MXE_HACKS
-Wno-attributes
189 CXXFLAGS
:= $(filter-out -fPIC
,$(CXXFLAGS
))
190 LDFLAGS
:= $(filter-out -rdynamic
,$(LDFLAGS
)) -s
191 LDLIBS
:= $(filter-out -lrt
,$(LDLIBS
))
192 ABCMKARGS
+= ARCHFLAGS
="-DSIZEOF_VOID_P=4 -DSIZEOF_LONG=4 -DSIZEOF_INT=4 -DWIN32_NO_DLL -DHAVE_STRUCT_TIMESPEC -fpermissive -w"
193 ABCMKARGS
+= LIBS
="lib/x86/pthreadVC2.lib -s" ABC_USE_NO_READLINE
=1 CC
="$(CXX)" CXX
="$(CXX)"
196 else ifeq ($(CONFIG
),msys2
)
197 CXX
= i686-w64-mingw32-gcc
198 LD
= i686-w64-mingw32-gcc
199 CXXFLAGS
+= -std
=c
++11 -Os
-D_POSIX_SOURCE
-DYOSYS_WIN32_UNIX_DIR
200 CXXFLAGS
:= $(filter-out -fPIC
,$(CXXFLAGS
))
201 LDFLAGS
:= $(filter-out -rdynamic
,$(LDFLAGS
)) -s
202 LDLIBS
:= $(filter-out -lrt
,$(LDLIBS
))
203 ABCMKARGS
+= ARCHFLAGS
="-DSIZEOF_VOID_P=4 -DSIZEOF_LONG=4 -DSIZEOF_INT=4 -DWIN32_NO_DLL -DHAVE_STRUCT_TIMESPEC -fpermissive -w"
204 ABCMKARGS
+= LIBS
="lib/x86/pthreadVC2.lib -s" ABC_USE_NO_READLINE
=0 CC
="$(CXX)" CXX
="$(CXX)"
207 else ifneq ($(CONFIG
),none
)
208 $(error Invalid CONFIG setting
'$(CONFIG)'. Valid values
: clang
, gcc
, gcc-4.8
, emcc
, mxe
, msys2
)
211 ifeq ($(ENABLE_LIBYOSYS
),1)
212 TARGETS
+= libyosys.so
215 ifeq ($(ENABLE_READLINE
),1)
216 CXXFLAGS
+= -DYOSYS_ENABLE_READLINE
218 ifeq ($(LINK_CURSES
),1)
220 ABCMKARGS
+= "ABC_READLINE_LIBRARIES=-lcurses -lreadline"
222 ifeq ($(LINK_TERMCAP
),1)
224 ABCMKARGS
+= "ABC_READLINE_LIBRARIES=-lreadline -ltermcap"
231 ifeq ($(ENABLE_PLUGINS
),1)
232 CXXFLAGS
+= $(shell PKG_CONFIG_PATH
=$(PKG_CONFIG_PATH
) $(PKG_CONFIG
) --silence-errors
--cflags libffi
) -DYOSYS_ENABLE_PLUGINS
233 LDLIBS
+= $(shell PKG_CONFIG_PATH
=$(PKG_CONFIG_PATH
) $(PKG_CONFIG
) --silence-errors
--libs libffi || echo
-lffi
) -ldl
236 ifeq ($(ENABLE_TCL
),1)
237 TCL_VERSION ?
= tcl
$(shell bash
-c
"tclsh <(echo 'puts [info tclversion]')")
238 TCL_INCLUDE ?
= /usr
/include/$(TCL_VERSION
)
241 CXXFLAGS
+= -DYOSYS_ENABLE_TCL
242 LDLIBS
+= -ltcl86
-lwsock32
-lws2_32
-lnetapi32
244 CXXFLAGS
+= $(shell PKG_CONFIG_PATH
=$(PKG_CONFIG_PATH
) $(PKG_CONFIG
) --silence-errors
--cflags tcl || echo
-I
$(TCL_INCLUDE
)) -DYOSYS_ENABLE_TCL
245 LDLIBS
+= $(shell PKG_CONFIG_PATH
=$(PKG_CONFIG_PATH
) $(PKG_CONFIG
) --silence-errors
--libs tcl || echo
-l
$(TCL_VERSION
))
249 ifeq ($(ENABLE_GPROF
),1)
254 ifeq ($(ENABLE_NDEBUG
),1)
255 CXXFLAGS
:= -O3
-DNDEBUG
$(filter-out -Os
-ggdb
,$(CXXFLAGS
))
258 ifeq ($(ENABLE_DEBUG
),1)
259 ifeq ($(CONFIG
),clang
)
260 CXXFLAGS
:= -O0
$(filter-out -Os
,$(CXXFLAGS
))
262 CXXFLAGS
:= -Og
$(filter-out -Os
,$(CXXFLAGS
))
266 ifeq ($(ENABLE_ABC
),1)
267 CXXFLAGS
+= -DYOSYS_ENABLE_ABC
268 ifeq ($(ABCEXTERNAL
),)
269 TARGETS
+= yosys-abc
$(EXE
)
273 ifeq ($(ENABLE_VERIFIC
),1)
274 VERIFIC_DIR ?
= /usr
/local
/src
/verific_lib_eval
275 VERIFIC_COMPONENTS ?
= verilog vhdl database util containers sdf
276 CXXFLAGS
+= $(patsubst %,-I
$(VERIFIC_DIR
)/%,$(VERIFIC_COMPONENTS
)) -DYOSYS_ENABLE_VERIFIC
277 LDLIBS
+= $(patsubst %,$(VERIFIC_DIR
)/%/*-linux.a
,$(VERIFIC_COMPONENTS
))
280 ifeq ($(ENABLE_COVER
),1)
281 CXXFLAGS
+= -DYOSYS_ENABLE_COVER
284 define add_share_file
285 EXTRA_TARGETS
+= $(subst //,/,$(1)/$(notdir $(2)))
286 $(subst //,/,$(1)/$(notdir $(2))): $(2)
288 $$(Q
) cp
"$(YOSYS_SRC)"/$(2) $(subst //,/,$(1)/$(notdir $(2)))
291 define add_gen_share_file
292 EXTRA_TARGETS
+= $(subst //,/,$(1)/$(notdir $(2)))
293 $(subst //,/,$(1)/$(notdir $(2))): $(2)
295 $$(Q
) cp
$(2) $(subst //,/,$(1)/$(notdir $(2)))
298 define add_include_file
299 $(eval
$(call add_share_file
,$(dir share
/include/$(1)),$(1)))
305 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; }'))
306 P_SHOW
= [$(shell gawk
"BEGIN { N=$(words $(OBJS) yosys$(EXE)); printf \"%3d\", $(P_OFFSET)+90*$(P_STATUS)/N; exit; }")%]
307 P
= @echo
"$(if $(findstring $@,$(TARGETS) $(EXTRA_TARGETS)),$(eval P_OFFSET = 10))$(call P_UPDATE)$(call P_SHOW) Building $@";
317 $(eval
$(call add_include_file
,kernel
/yosys.h
))
318 $(eval
$(call add_include_file
,kernel
/hashlib.h
))
319 $(eval
$(call add_include_file
,kernel
/log.h
))
320 $(eval
$(call add_include_file
,kernel
/rtlil.h
))
321 $(eval
$(call add_include_file
,kernel
/register.h
))
322 $(eval
$(call add_include_file
,kernel
/celltypes.h
))
323 $(eval
$(call add_include_file
,kernel
/celledges.h
))
324 $(eval
$(call add_include_file
,kernel
/consteval.h
))
325 $(eval
$(call add_include_file
,kernel
/sigtools.h
))
326 $(eval
$(call add_include_file
,kernel
/modtools.h
))
327 $(eval
$(call add_include_file
,kernel
/macc.h
))
328 $(eval
$(call add_include_file
,kernel
/utils.h
))
329 $(eval
$(call add_include_file
,kernel
/satgen.h
))
330 $(eval
$(call add_include_file
,libs
/ezsat
/ezsat.h
))
331 $(eval
$(call add_include_file
,libs
/ezsat
/ezminisat.h
))
332 $(eval
$(call add_include_file
,libs
/sha1
/sha1.h
))
333 $(eval
$(call add_include_file
,passes
/fsm
/fsmdata.h
))
334 $(eval
$(call add_include_file
,frontends
/ast
/ast.h
))
335 $(eval
$(call add_include_file
,backends
/ilang
/ilang_backend.h
))
337 OBJS
+= kernel
/driver.o kernel
/register.o kernel
/rtlil.o kernel
/log.o kernel
/calc.o kernel
/yosys.o
338 OBJS
+= kernel
/cellaigs.o kernel
/celledges.o
340 kernel
/log.o
: CXXFLAGS
+= -DYOSYS_SRC
='"$(YOSYS_SRC)"'
341 kernel
/yosys.o
: CXXFLAGS
+= -DYOSYS_DATDIR
='"$(DATDIR)"'
343 OBJS
+= libs
/bigint
/BigIntegerAlgorithms.o libs
/bigint
/BigInteger.o libs
/bigint
/BigIntegerUtils.o
344 OBJS
+= libs
/bigint
/BigUnsigned.o libs
/bigint
/BigUnsignedInABase.o
346 OBJS
+= libs
/sha1
/sha1.o
350 OBJS
+= libs
/subcircuit
/subcircuit.o
352 OBJS
+= libs
/ezsat
/ezsat.o
353 OBJS
+= libs
/ezsat
/ezminisat.o
355 OBJS
+= libs
/minisat
/Options.o
356 OBJS
+= libs
/minisat
/SimpSolver.o
357 OBJS
+= libs
/minisat
/Solver.o
358 OBJS
+= libs
/minisat
/System.o
360 include $(YOSYS_SRC
)/frontends
/*/Makefile.inc
361 include $(YOSYS_SRC
)/passes
/*/Makefile.inc
362 include $(YOSYS_SRC
)/backends
/*/Makefile.inc
363 include $(YOSYS_SRC
)/techlibs
/*/Makefile.inc
367 include frontends
/verilog
/Makefile.inc
368 include frontends
/ilang
/Makefile.inc
369 include frontends
/ast
/Makefile.inc
370 include frontends
/blif
/Makefile.inc
372 OBJS
+= passes
/hierarchy
/hierarchy.o
373 OBJS
+= passes
/cmds
/select.o
374 OBJS
+= passes
/cmds
/show.o
375 OBJS
+= passes
/cmds
/stat.o
376 OBJS
+= passes
/cmds
/cover.o
377 OBJS
+= passes
/cmds
/design.o
378 OBJS
+= passes
/cmds
/plugin.o
380 include passes
/proc
/Makefile.inc
381 include passes
/opt
/Makefile.inc
382 include passes
/techmap
/Makefile.inc
384 include backends
/verilog
/Makefile.inc
385 include backends
/ilang
/Makefile.inc
387 include techlibs
/common
/Makefile.inc
391 top-all
: $(TARGETS
) $(EXTRA_TARGETS
)
393 @echo
" Build successful."
396 ifeq ($(CONFIG
),emcc
)
397 yosys.js
: $(filter-out yosysjs-
$(YOSYS_VER
).zip
,$(EXTRA_TARGETS
))
401 $(P
) $(LD
) -o yosys
$(EXE
) $(LDFLAGS
) $(OBJS
) $(LDLIBS
)
403 libyosys.so
: $(filter-out kernel
/driver.o
,$(OBJS
))
404 $(P
) $(LD
) -o libyosys.so
-shared
-Wl
,-soname
,libyosys.so
$(LDFLAGS
) $^
$(LDLIBS
)
407 $(Q
) mkdir
-p
$(dir $@
)
408 $(P
) $(CXX
) -o
$@
-c
$(CPPFLAGS
) $(CXXFLAGS
) $<
411 $(Q
) mkdir
-p
$(dir $@
)
412 $(P
) $(CXX
) -o
$@
-c
$(CPPFLAGS
) $(CXXFLAGS
) $<
414 YOSYS_VER_STR
:= Yosys
$(YOSYS_VER
) (git sha1
$(GIT_REV
), $(notdir $(CXX
)) $(shell \
415 $(CXX
) --version | tr
' ()' '\n' | grep
'^[0-9]' | head
-n1
) $(filter -f
% -m
% -O
% -DNDEBUG
,$(CXXFLAGS
)))
417 kernel
/version_
$(GIT_REV
).
cc: $(YOSYS_SRC
)/Makefile
418 $(P
) rm -f kernel
/version_
*.o kernel
/version_
*.d kernel
/version_
*.
cc
419 $(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
421 yosys-config
: misc
/yosys-config.in
422 $(P
) $(SED
) -e
's#@CXXFLAGS@#$(subst -I. -I"$(YOSYS_SRC)",-I"$(DATDIR)/include",$(CXXFLAGS))#;' \
423 -e
's#@CXX@#$(CXX)#;' -e
's#@LDFLAGS@#$(LDFLAGS) $(PLUGIN_LDFLAGS)#;' -e
's#@LDLIBS@#$(LDLIBS)#;' \
424 -e
's#@BINDIR@#$(BINDIR)#;' -e
's#@DATDIR@#$(DATDIR)#;' < $< > yosys-config
425 $(Q
) chmod
+x yosys-config
427 abc
/abc-
$(ABCREV
)$(EXE
):
429 ifneq ($(ABCREV
),default
)
430 $(Q
) if
( cd abc
2> /dev
/null
&& hg identify
; ) | grep
-q
+; then \
431 echo
'REEBE: NOP pbagnvaf ybpny zbqvsvpngvbaf! Frg NOPERI=qrsnhyg va Lbflf Znxrsvyr!' | tr
'A-Za-z' 'N-ZA-Mn-za-m'; false
; \
433 $(Q
) if
test "`cd abc 2> /dev/null && hg identify | cut -f1 -d' '`" != "$(ABCREV)"; then \
434 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; }; \
435 echo
"Pulling ABC from $(ABCURL):"; set
-x
; \
436 test -d abc || hg clone
$(ABCURL
) abc
; \
437 cd abc
&& $(MAKE
) DEP
= clean && hg pull
&& hg update
-r
$(ABCREV
); \
440 $(Q
) rm -f abc
/abc-
[0-9a-f
]*
441 $(Q
) cd abc
&& $(MAKE
) $(S
) $(ABCMKARGS
) PROG
="abc-$(ABCREV)$(EXE)" MSG_PREFIX
="$(eval P_OFFSET = 5)$(call P_SHOW)$(eval P_OFFSET = 10) ABC: "
443 ifeq ($(ABCREV
),default
)
444 .PHONY
: abc
/abc-
$(ABCREV
)$(EXE
)
447 yosys-abc
$(EXE
): abc
/abc-
$(ABCREV
)$(EXE
)
448 $(P
) cp abc
/abc-
$(ABCREV
)$(EXE
) yosys-abc
$(EXE
)
456 test: $(TARGETS
) $(EXTRA_TARGETS
)
457 +cd tests
/simple
&& bash run-test.sh
$(SEEDOPT
)
458 +cd tests
/hana
&& bash run-test.sh
$(SEEDOPT
)
459 +cd tests
/asicworld
&& bash run-test.sh
$(SEEDOPT
)
460 +cd tests
/realmath
&& bash run-test.sh
$(SEEDOPT
)
461 +cd tests
/share
&& bash run-test.sh
$(SEEDOPT
)
462 +cd tests
/fsm
&& bash run-test.sh
$(SEEDOPT
)
463 +cd tests
/techmap
&& bash run-test.sh
464 +cd tests
/memories
&& bash run-test.sh
$(SEEDOPT
)
465 +cd tests
/bram
&& bash run-test.sh
$(SEEDOPT
)
466 +cd tests
/various
&& bash run-test.sh
467 +cd tests
/sat
&& bash run-test.sh
469 @echo
" Passed \"make test\"."
472 VALGRIND ?
= valgrind
--error-exitcode
=1 --leak-check
=full
--show-reachable
=yes
--errors-for-leak-kinds
=all
474 vgtest
: $(TARGETS
) $(EXTRA_TARGETS
)
475 $(VALGRIND
) .
/yosys
-p
'setattr -mod -unset top; synth' $$( ls tests
/simple
/*.v | grep
-v repwhile.v
)
477 @echo
" Passed \"make vgtest\"."
480 vloghtb
: $(TARGETS
) $(EXTRA_TARGETS
)
481 +cd tests
/vloghtb
&& bash run-test.sh
483 @echo
" Passed \"make vloghtb\"."
487 unit-test
: libyosys.so
488 @
$(MAKE
) -C
$(UNITESTPATH
) CXX
="$(CXX)" CPPFLAGS
="$(CPPFLAGS)" \
489 CXXFLAGS
="$(CXXFLAGS)" LDLIBS
="$(LDLIBS)" ROOTPATH
="$(CURDIR)"
492 @
$(MAKE
) -C
$(UNITESTPATH
) clean
494 install: $(TARGETS
) $(EXTRA_TARGETS
)
495 $(INSTALL_SUDO
) mkdir
-p
$(DESTDIR
)$(BINDIR
)
496 $(INSTALL_SUDO
) install $(TARGETS
) $(DESTDIR
)$(BINDIR
)
497 $(INSTALL_SUDO
) mkdir
-p
$(DESTDIR
)$(DATDIR
)
498 $(INSTALL_SUDO
) cp
-r share
/.
$(DESTDIR
)$(DATDIR
)/.
499 ifeq ($(ENABLE_LIBYOSYS
),1)
500 $(INSTALL_SUDO
) cp libyosys.so
$(DESTDIR
)$(LIBDIR
)
501 $(INSTALL_SUDO
) ldconfig
505 $(INSTALL_SUDO
) rm -vf
$(addprefix $(DESTDIR
)$(BINDIR
)/,$(notdir $(TARGETS
)))
506 $(INSTALL_SUDO
) rm -rvf
$(DESTDIR
)$(DATDIR
)
507 ifeq ($(ENABLE_LIBYOSYS
),1)
508 $(INSTALL_SUDO
) rm -vf
$(DESTDIR
)$(LIBDIR
)/libyosys.so
511 update-manual
: $(TARGETS
) $(EXTRA_TARGETS
)
512 cd manual
&& ..
/yosys
-p
'help -write-tex-command-reference-manual'
514 manual
: $(TARGETS
) $(EXTRA_TARGETS
)
515 cd manual
&& bash appnotes.sh
516 cd manual
&& bash presentation.sh
517 cd manual
&& bash manual.sh
521 if
test -d manual
; then cd manual
&& sh
clean.sh
; fi
522 rm -f
$(OBJS
) $(GENFILES
) $(TARGETS
) $(EXTRA_TARGETS
) $(EXTRA_OBJS
)
523 rm -f kernel
/version_
*.o kernel
/version_
*.
cc abc
/abc-
[0-9a-f
]*
524 rm -f libs
/*/*.d frontends
/*/*.d passes
/*/*.d backends
/*/*.d kernel
/*.d techlibs
/*/*.d
525 rm -rf tests
/asicworld
/*.out tests
/asicworld
/*.log
526 rm -rf tests
/hana
/*.out tests
/hana
/*.log
527 rm -rf tests
/simple
/*.out tests
/simple
/*.log
528 rm -rf tests
/memories
/*.out tests
/memories
/*.log tests
/memories
/*.dmp
529 rm -rf tests
/sat
/*.log tests
/techmap
/*.log tests
/various
/*.log
530 rm -rf tests
/bram
/temp tests
/fsm
/temp tests
/realmath
/temp tests
/share
/temp tests
/smv
/temp
531 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_
*
532 rm -f tests
/tools
/cmp_tbdata
535 $(MAKE
) -C abc DEP
= clean
536 rm -f yosys-abc
$(EXE
) abc
/abc-
[0-9a-f
]*
542 { for file in
$(basename $(OBJS
)); do \
543 for
prefix in
cc y l
; do if
[ -f
$${file}.
$${prefix} ]; then echo
$$file.
$${prefix}; fi
; done \
544 done
; find backends frontends kernel libs passes
-type f \
( -name
'*.h' -o
-name
'*.hh' \
); } > qtcreator.files
545 { echo .
; find backends frontends kernel libs passes
-type f \
( -name
'*.h' -o
-name
'*.hh' \
) -printf
'%h\n' |
sort -u
; } > qtcreator.includes
546 touch qtcreator.config qtcreator.creator
548 vcxsrc
: $(GENFILES
) $(EXTRA_TARGETS
)
549 rm -rf yosys-win32-vcxsrc-
$(YOSYS_VER
){,.zip
}
550 set
-e
; for f in
`ls $(filter %.cc %.cpp,$(GENFILES)) $(addsuffix .cc,$(basename $(OBJS))) $(addsuffix .cpp,$(basename $(OBJS))) 2> /dev/null`; do \
551 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
552 bash misc
/create_vcxsrc.sh yosys-win32-vcxsrc
$(YOSYS_VER
) $(GIT_REV
)
553 echo
"namespace Yosys { extern const char *yosys_version_str; const char *yosys_version_str=\"Yosys (Version Information Unavailable)\"; }" > kernel
/version.
cc
554 zip yosys-win32-vcxsrc-
$(YOSYS_VER
)/genfiles.zip
$(GENFILES
) kernel
/version.
cc
555 zip
-r yosys-win32-vcxsrc-
$(YOSYS_VER
).zip yosys-win32-vcxsrc-
$(YOSYS_VER
)/
556 rm -f srcfiles.txt kernel
/version.
cc
559 mxebin
: $(TARGETS
) $(EXTRA_TARGETS
)
560 rm -rf yosys-win32-mxebin-
$(YOSYS_VER
){,.zip
}
561 mkdir
-p yosys-win32-mxebin-
$(YOSYS_VER
)
562 cp
-r yosys.exe share
/ yosys-win32-mxebin-
$(YOSYS_VER
)/
563 ifeq ($(ENABLE_ABC
),1)
564 cp
-r yosys-abc.exe abc
/lib
/x86
/pthreadVC2.dll yosys-win32-mxebin-
$(YOSYS_VER
)/
566 echo
-en
'This is Yosys $(YOSYS_VER) for Win32.\r\n' > yosys-win32-mxebin-
$(YOSYS_VER
)/readme.txt
567 echo
-en
'Documentation at http://www.clifford.at/yosys/.\r\n' >> yosys-win32-mxebin-
$(YOSYS_VER
)/readme.txt
568 zip
-r yosys-win32-mxebin-
$(YOSYS_VER
).zip yosys-win32-mxebin-
$(YOSYS_VER
)/
575 echo
'CONFIG := clang' > Makefile.conf
578 echo
'CONFIG := gcc' > Makefile.conf
580 config-gcc-4.8
: clean
581 echo
'CONFIG := gcc-4.8' > Makefile.conf
584 echo
'CONFIG := emcc' > Makefile.conf
585 echo
'ENABLE_TCL := 0' >> Makefile.conf
586 echo
'ENABLE_ABC := 0' >> Makefile.conf
587 echo
'ENABLE_PLUGINS := 0' >> Makefile.conf
588 echo
'ENABLE_READLINE := 0' >> Makefile.conf
591 echo
'CONFIG := mxe' > Makefile.conf
592 echo
'ENABLE_PLUGINS := 0' >> Makefile.conf
595 echo
'CONFIG := msys2' > Makefile.conf
598 echo
'CONFIG := gcc' > Makefile.conf
599 echo
'ENABLE_GPROF := 1' >> Makefile.conf
602 echo
"INSTALL_SUDO := sudo" >> Makefile.conf
611 -include frontends
/*/*.d
612 -include passes
/*/*.d
613 -include backends
/*/*.d
615 -include techlibs
/*/*.d
617 .PHONY
: all top-all abc
test install install-abc manual
clean mrproper qtcreator
618 .PHONY
: config-clean config-clang config-gcc config-gcc-4.8 config-gprof config-sudo