9 # features (the more the better)
18 # other configuration flags
28 # SANITIZER = undefined
35 BINDIR
:= $(PREFIX
)/bin
36 LIBDIR
:= $(PREFIX
)/lib
37 DATDIR
:= $(PREFIX
)/share
/yosys
44 TARGETS
= yosys
$(EXE
) yosys-config
50 UNITESTPATH
:= tests
/unit
54 YOSYS_SRC
:= $(dir $(firstword $(MAKEFILE_LIST
)))
57 CXXFLAGS
:= $(CXXFLAGS
) -Wall
-Wextra
-ggdb
-I.
-I
"$(YOSYS_SRC)" -MD
-D_YOSYS_
-fPIC
-I
$(PREFIX
)/include
58 LDFLAGS
:= $(LDFLAGS
) -L
$(LIBDIR
)
59 LDLIBS
:= $(LDLIBS
) -lstdc
++ -lm
62 PKG_CONFIG ?
= pkg-config
66 ifeq (Darwin
,$(findstring Darwin
,$(shell uname
)))
67 PLUGIN_LDFLAGS
+= -undefined dynamic_lookup
69 # homebrew search paths
70 ifneq ($(shell which brew
),)
71 BREW_PREFIX
:= $(shell brew
--prefix)/opt
72 CXXFLAGS
+= -I
$(BREW_PREFIX
)/readline
/include
73 LDFLAGS
+= -L
$(BREW_PREFIX
)/readline
/lib
74 PKG_CONFIG_PATH
:= $(BREW_PREFIX
)/libffi
/lib
/pkgconfig
:$(PKG_CONFIG_PATH
)
75 PKG_CONFIG_PATH
:= $(BREW_PREFIX
)/tcl-tk
/lib
/pkgconfig
:$(PKG_CONFIG_PATH
)
76 export PATH
:= $(BREW_PREFIX
)/bison
/bin
:$(BREW_PREFIX
)/gettext
/bin
:$(BREW_PREFIX
)/flex
/bin
:$(PATH
)
78 # macports search paths
79 else ifneq ($(shell which port
),)
80 PORT_PREFIX
:= $(patsubst %/bin
/port
,%,$(shell which port
))
81 CXXFLAGS
+= -I
$(PORT_PREFIX
)/include
82 LDFLAGS
+= -L
$(PORT_PREFIX
)/lib
83 PKG_CONFIG_PATH
:= $(PORT_PREFIX
)/lib
/pkgconfig
:$(PKG_CONFIG_PATH
)
84 export PATH
:= $(PORT_PREFIX
)/bin
:$(PATH
)
92 YOSYS_VER
:= 0.7+$(shell cd
$(YOSYS_SRC
) && test -e .git
&& { git log
--author
=clifford@clifford.at
--oneline
61f6811.. | wc
-l
; })
93 GIT_REV
:= $(shell cd
$(YOSYS_SRC
) && git rev-parse
--short HEAD
2> /dev
/null || echo UNKNOWN
)
94 OBJS
= kernel
/version_
$(GIT_REV
).o
96 # set 'ABCREV = default' to use abc/ as it is
98 # Note: If you do ABC development, make sure that 'abc' in this directory
99 # is just a symlink to your actual ABC working directory, as 'make mrproper'
100 # will remove the 'abc' directory and you do not want to accidentally
101 # delete your work on ABC..
102 ABCREV
= efbf7f13ea9e
104 ABCURL ?
= https
://bitbucket.org
/alanmi
/abc
105 ABCMKARGS
= CC
="$(CXX)" CXX
="$(CXX)"
107 # set ABCEXTERNAL = <abc-command> to use an external ABC instance
108 # Note: The in-tree ABC (yosys-abc) will not be installed when ABCEXTERNAL is set.
116 ifneq ($(wildcard Makefile.conf
),)
117 $(info $(subst $$--$$,$(newline
),$(shell sed
's,^,[Makefile.conf] ,; s,$$,$$--$$,;' < Makefile.conf | tr
-d
'\n' | sed
's,\$$--\$$$$,,')))
118 include Makefile.conf
121 ifeq ($(CONFIG
),clang
)
124 CXXFLAGS
+= -std
=c
++11 -Os
126 ifneq ($(SANITIZER
),)
127 $(info [Clang Sanitizer
] $(SANITIZER
))
128 CXXFLAGS
+= -g
-O1
-fno-omit-frame-pointer
-fno-optimize-sibling-calls
-fsanitize
=$(SANITIZER
)
129 LDFLAGS
+= -g
-fsanitize
=$(SANITIZER
)
130 ifeq ($(SANITIZER
),address
)
133 ifeq ($(SANITIZER
),memory
)
134 CXXFLAGS
+= -fPIE
-fsanitize-memory-track-origins
135 LDFLAGS
+= -fPIE
-fsanitize-memory-track-origins
137 ifeq ($(SANITIZER
),cfi
)
143 else ifeq ($(CONFIG
),gcc
)
146 CXXFLAGS
+= -std
=c
++11 -Os
148 else ifeq ($(CONFIG
),gcc-4.8
)
151 CXXFLAGS
+= -std
=c
++11 -Os
153 else ifeq ($(CONFIG
),emcc
)
156 CXXFLAGS
:= -std
=c
++11 $(filter-out -fPIC
-ggdb
,$(CXXFLAGS
))
157 EMCCFLAGS
:= -Os
-Wno-warn-absolute-paths
158 EMCCFLAGS
+= --memory-init-file
0 --embed-file share
-s NO_EXIT_RUNTIME
=1
159 EMCCFLAGS
+= -s EXPORTED_FUNCTIONS
="['_main','_run','_prompt','_errmsg']"
160 EMCCFLAGS
+= -s TOTAL_MEMORY
=128*1024*1024
161 # https://github.com/kripken/emscripten/blob/master/src/settings.js
162 CXXFLAGS
+= $(EMCCFLAGS
)
163 LDFLAGS
+= $(EMCCFLAGS
)
167 TARGETS
:= $(filter-out yosys-config
,$(TARGETS
))
168 EXTRA_TARGETS
+= yosysjs-
$(YOSYS_VER
).zip
171 wget
-O viz.js.part https
://github.com
/mdaines
/viz.js
/releases
/download
/0.0.3/viz.js
172 mv viz.js.part viz.js
174 yosysjs-
$(YOSYS_VER
).zip
: yosys.js viz.js misc
/yosysjs
/*
175 rm -rf yosysjs-
$(YOSYS_VER
) yosysjs-
$(YOSYS_VER
).zip
176 mkdir
-p yosysjs-
$(YOSYS_VER
)
177 cp viz.js misc
/yosysjs
/* yosys.js yosysjs-
$(YOSYS_VER
)/
178 zip
-r yosysjs-
$(YOSYS_VER
).zip yosysjs-
$(YOSYS_VER
)
180 yosys.html
: misc
/yosys.html
181 $(P
) cp misc
/yosys.html yosys.html
183 else ifeq ($(CONFIG
),mxe
)
184 PKG_CONFIG
= /usr
/local
/src
/mxe
/usr
/bin
/i686-w64-mingw32.static-pkg-config
185 CXX
= /usr
/local
/src
/mxe
/usr
/bin
/i686-w64-mingw32.static-gcc
186 LD
= /usr
/local
/src
/mxe
/usr
/bin
/i686-w64-mingw32.static-gcc
187 CXXFLAGS
+= -std
=c
++11 -Os
-D_POSIX_SOURCE
-DYOSYS_MXE_HACKS
-Wno-attributes
188 CXXFLAGS
:= $(filter-out -fPIC
,$(CXXFLAGS
))
189 LDFLAGS
:= $(filter-out -rdynamic
,$(LDFLAGS
)) -s
190 LDLIBS
:= $(filter-out -lrt
,$(LDLIBS
))
191 ABCMKARGS
+= ARCHFLAGS
="-DSIZEOF_VOID_P=4 -DSIZEOF_LONG=4 -DSIZEOF_INT=4 -DWIN32_NO_DLL -DHAVE_STRUCT_TIMESPEC -fpermissive -w"
192 ABCMKARGS
+= LIBS
="lib/x86/pthreadVC2.lib -s" ABC_USE_NO_READLINE
=1 CC
="$(CXX)" CXX
="$(CXX)"
195 else ifeq ($(CONFIG
),msys2
)
196 CXX
= i686-w64-mingw32-gcc
197 LD
= i686-w64-mingw32-gcc
198 CXXFLAGS
+= -std
=c
++11 -Os
-D_POSIX_SOURCE
-DYOSYS_WIN32_UNIX_DIR
199 CXXFLAGS
:= $(filter-out -fPIC
,$(CXXFLAGS
))
200 LDFLAGS
:= $(filter-out -rdynamic
,$(LDFLAGS
)) -s
201 LDLIBS
:= $(filter-out -lrt
,$(LDLIBS
))
202 ABCMKARGS
+= ARCHFLAGS
="-DSIZEOF_VOID_P=4 -DSIZEOF_LONG=4 -DSIZEOF_INT=4 -DWIN32_NO_DLL -DHAVE_STRUCT_TIMESPEC -fpermissive -w"
203 ABCMKARGS
+= LIBS
="lib/x86/pthreadVC2.lib -s" ABC_USE_NO_READLINE
=0 CC
="$(CXX)" CXX
="$(CXX)"
206 else ifneq ($(CONFIG
),none
)
207 $(error Invalid CONFIG setting
'$(CONFIG)'. Valid values
: clang
, gcc
, gcc-4.8
, emcc
, mxe
, msys2
)
210 ifeq ($(ENABLE_LIBYOSYS
),1)
211 TARGETS
+= libyosys.so
214 ifeq ($(ENABLE_READLINE
),1)
215 CXXFLAGS
+= -DYOSYS_ENABLE_READLINE
217 ifeq ($(LINK_CURSES
),1)
219 ABCMKARGS
+= "ABC_READLINE_LIBRARIES=-lcurses -lreadline"
221 ifeq ($(LINK_TERMCAP
),1)
223 ABCMKARGS
+= "ABC_READLINE_LIBRARIES=-lreadline -ltermcap"
230 ifeq ($(ENABLE_PLUGINS
),1)
231 CXXFLAGS
+= $(shell PKG_CONFIG_PATH
=$(PKG_CONFIG_PATH
) $(PKG_CONFIG
) --silence-errors
--cflags libffi
) -DYOSYS_ENABLE_PLUGINS
232 LDLIBS
+= $(shell PKG_CONFIG_PATH
=$(PKG_CONFIG_PATH
) $(PKG_CONFIG
) --silence-errors
--libs libffi || echo
-lffi
) -ldl
235 ifeq ($(ENABLE_TCL
),1)
236 TCL_VERSION ?
= tcl
$(shell bash
-c
"tclsh <(echo 'puts [info tclversion]')")
237 TCL_INCLUDE ?
= /usr
/include/$(TCL_VERSION
)
240 CXXFLAGS
+= -DYOSYS_ENABLE_TCL
241 LDLIBS
+= -ltcl86
-lwsock32
-lws2_32
-lnetapi32
243 CXXFLAGS
+= $(shell PKG_CONFIG_PATH
=$(PKG_CONFIG_PATH
) $(PKG_CONFIG
) --silence-errors
--cflags tcl || echo
-I
$(TCL_INCLUDE
)) -DYOSYS_ENABLE_TCL
244 LDLIBS
+= $(shell PKG_CONFIG_PATH
=$(PKG_CONFIG_PATH
) $(PKG_CONFIG
) --silence-errors
--libs tcl || echo
-l
$(TCL_VERSION
))
248 ifeq ($(ENABLE_GPROF
),1)
253 ifeq ($(ENABLE_NDEBUG
),1)
254 CXXFLAGS
:= -O3
-DNDEBUG
$(filter-out -Os
,$(CXXFLAGS
))
257 ifeq ($(ENABLE_ABC
),1)
258 CXXFLAGS
+= -DYOSYS_ENABLE_ABC
259 ifeq ($(ABCEXTERNAL
),)
260 TARGETS
+= yosys-abc
$(EXE
)
264 ifeq ($(ENABLE_VERIFIC
),1)
265 VERIFIC_DIR ?
= /usr
/local
/src
/verific_lib_eval
266 VERIFIC_COMPONENTS ?
= verilog vhdl database util containers sdf
267 CXXFLAGS
+= $(patsubst %,-I
$(VERIFIC_DIR
)/%,$(VERIFIC_COMPONENTS
)) -DYOSYS_ENABLE_VERIFIC
268 LDLIBS
+= $(patsubst %,$(VERIFIC_DIR
)/%/*-linux.a
,$(VERIFIC_COMPONENTS
))
271 ifeq ($(ENABLE_COVER
),1)
272 CXXFLAGS
+= -DYOSYS_ENABLE_COVER
275 define add_share_file
276 EXTRA_TARGETS
+= $(subst //,/,$(1)/$(notdir $(2)))
277 $(subst //,/,$(1)/$(notdir $(2))): $(2)
279 $$(Q
) cp
"$(YOSYS_SRC)"/$(2) $(subst //,/,$(1)/$(notdir $(2)))
282 define add_gen_share_file
283 EXTRA_TARGETS
+= $(subst //,/,$(1)/$(notdir $(2)))
284 $(subst //,/,$(1)/$(notdir $(2))): $(2)
286 $$(Q
) cp
$(2) $(subst //,/,$(1)/$(notdir $(2)))
289 define add_include_file
290 $(eval
$(call add_share_file
,$(dir share
/include/$(1)),$(1)))
296 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; }'))
297 P_SHOW
= [$(shell gawk
"BEGIN { N=$(words $(OBJS) yosys$(EXE)); printf \"%3d\", $(P_OFFSET)+90*$(P_STATUS)/N; exit; }")%]
298 P
= @echo
"$(if $(findstring $@,$(TARGETS) $(EXTRA_TARGETS)),$(eval P_OFFSET = 10))$(call P_UPDATE)$(call P_SHOW) Building $@";
308 $(eval
$(call add_include_file
,kernel
/yosys.h
))
309 $(eval
$(call add_include_file
,kernel
/hashlib.h
))
310 $(eval
$(call add_include_file
,kernel
/log.h
))
311 $(eval
$(call add_include_file
,kernel
/rtlil.h
))
312 $(eval
$(call add_include_file
,kernel
/register.h
))
313 $(eval
$(call add_include_file
,kernel
/celltypes.h
))
314 $(eval
$(call add_include_file
,kernel
/celledges.h
))
315 $(eval
$(call add_include_file
,kernel
/consteval.h
))
316 $(eval
$(call add_include_file
,kernel
/sigtools.h
))
317 $(eval
$(call add_include_file
,kernel
/modtools.h
))
318 $(eval
$(call add_include_file
,kernel
/macc.h
))
319 $(eval
$(call add_include_file
,kernel
/utils.h
))
320 $(eval
$(call add_include_file
,kernel
/satgen.h
))
321 $(eval
$(call add_include_file
,libs
/ezsat
/ezsat.h
))
322 $(eval
$(call add_include_file
,libs
/ezsat
/ezminisat.h
))
323 $(eval
$(call add_include_file
,libs
/sha1
/sha1.h
))
324 $(eval
$(call add_include_file
,passes
/fsm
/fsmdata.h
))
325 $(eval
$(call add_include_file
,frontends
/ast
/ast.h
))
326 $(eval
$(call add_include_file
,backends
/ilang
/ilang_backend.h
))
328 OBJS
+= kernel
/driver.o kernel
/register.o kernel
/rtlil.o kernel
/log.o kernel
/calc.o kernel
/yosys.o
329 OBJS
+= kernel
/cellaigs.o kernel
/celledges.o
331 kernel
/log.o
: CXXFLAGS
+= -DYOSYS_SRC
='"$(YOSYS_SRC)"'
332 kernel
/yosys.o
: CXXFLAGS
+= -DYOSYS_DATDIR
='"$(DATDIR)"'
334 OBJS
+= libs
/bigint
/BigIntegerAlgorithms.o libs
/bigint
/BigInteger.o libs
/bigint
/BigIntegerUtils.o
335 OBJS
+= libs
/bigint
/BigUnsigned.o libs
/bigint
/BigUnsignedInABase.o
337 OBJS
+= libs
/sha1
/sha1.o
341 OBJS
+= libs
/subcircuit
/subcircuit.o
343 OBJS
+= libs
/ezsat
/ezsat.o
344 OBJS
+= libs
/ezsat
/ezminisat.o
346 OBJS
+= libs
/minisat
/Options.o
347 OBJS
+= libs
/minisat
/SimpSolver.o
348 OBJS
+= libs
/minisat
/Solver.o
349 OBJS
+= libs
/minisat
/System.o
351 include $(YOSYS_SRC
)/frontends
/*/Makefile.inc
352 include $(YOSYS_SRC
)/passes
/*/Makefile.inc
353 include $(YOSYS_SRC
)/backends
/*/Makefile.inc
354 include $(YOSYS_SRC
)/techlibs
/*/Makefile.inc
358 include frontends
/verilog
/Makefile.inc
359 include frontends
/ilang
/Makefile.inc
360 include frontends
/ast
/Makefile.inc
361 include frontends
/blif
/Makefile.inc
363 OBJS
+= passes
/hierarchy
/hierarchy.o
364 OBJS
+= passes
/cmds
/select.o
365 OBJS
+= passes
/cmds
/show.o
366 OBJS
+= passes
/cmds
/stat.o
367 OBJS
+= passes
/cmds
/cover.o
368 OBJS
+= passes
/cmds
/design.o
369 OBJS
+= passes
/cmds
/plugin.o
371 include passes
/proc
/Makefile.inc
372 include passes
/opt
/Makefile.inc
373 include passes
/techmap
/Makefile.inc
375 include backends
/verilog
/Makefile.inc
376 include backends
/ilang
/Makefile.inc
378 include techlibs
/common
/Makefile.inc
382 top-all
: $(TARGETS
) $(EXTRA_TARGETS
)
384 @echo
" Build successful."
387 ifeq ($(CONFIG
),emcc
)
388 yosys.js
: $(filter-out yosysjs-
$(YOSYS_VER
).zip
,$(EXTRA_TARGETS
))
392 $(P
) $(LD
) -o yosys
$(EXE
) $(LDFLAGS
) $(OBJS
) $(LDLIBS
)
394 libyosys.so
: $(filter-out kernel
/driver.o
,$(OBJS
))
395 $(P
) $(LD
) -o libyosys.so
-shared
-Wl
,-soname
,libyosys.so
$(LDFLAGS
) $^
$(LDLIBS
)
398 $(Q
) mkdir
-p
$(dir $@
)
399 $(P
) $(CXX
) -o
$@
-c
$(CPPFLAGS
) $(CXXFLAGS
) $<
402 $(Q
) mkdir
-p
$(dir $@
)
403 $(P
) $(CXX
) -o
$@
-c
$(CPPFLAGS
) $(CXXFLAGS
) $<
405 YOSYS_VER_STR
:= Yosys
$(YOSYS_VER
) (git sha1
$(GIT_REV
), $(notdir $(CXX
)) $(shell \
406 $(CXX
) --version | tr
' ()' '\n' | grep
'^[0-9]' | head
-n1
) $(filter -f
% -m
% -O
% -DNDEBUG
,$(CXXFLAGS
)))
408 kernel
/version_
$(GIT_REV
).
cc: $(YOSYS_SRC
)/Makefile
409 $(P
) rm -f kernel
/version_
*.o kernel
/version_
*.d kernel
/version_
*.
cc
410 $(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
412 yosys-config
: misc
/yosys-config.in
413 $(P
) $(SED
) -e
's#@CXXFLAGS@#$(subst -I. -I"$(YOSYS_SRC)",-I"$(DATDIR)/include",$(CXXFLAGS))#;' \
414 -e
's#@CXX@#$(CXX)#;' -e
's#@LDFLAGS@#$(LDFLAGS) $(PLUGIN_LDFLAGS)#;' -e
's#@LDLIBS@#$(LDLIBS)#;' \
415 -e
's#@BINDIR@#$(BINDIR)#;' -e
's#@DATDIR@#$(DATDIR)#;' < $< > yosys-config
416 $(Q
) chmod
+x yosys-config
418 abc
/abc-
$(ABCREV
)$(EXE
):
420 ifneq ($(ABCREV
),default
)
421 $(Q
) if
( cd abc
2> /dev
/null
&& hg identify
; ) | grep
-q
+; then \
422 echo
'REEBE: NOP pbagnvaf ybpny zbqvsvpngvbaf! Frg NOPERI=qrsnhyg va Lbflf Znxrsvyr!' | tr
'A-Za-z' 'N-ZA-Mn-za-m'; false
; \
424 $(Q
) if
test "`cd abc 2> /dev/null && hg identify | cut -f1 -d' '`" != "$(ABCREV)"; then \
425 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; }; \
426 echo
"Pulling ABC from $(ABCURL):"; set
-x
; \
427 test -d abc || hg clone
$(ABCURL
) abc
; \
428 cd abc
&& $(MAKE
) DEP
= clean && hg pull
&& hg update
-r
$(ABCREV
); \
431 $(Q
) rm -f abc
/abc-
[0-9a-f
]*
432 $(Q
) cd abc
&& $(MAKE
) $(S
) $(ABCMKARGS
) PROG
="abc-$(ABCREV)$(EXE)" MSG_PREFIX
="$(eval P_OFFSET = 5)$(call P_SHOW)$(eval P_OFFSET = 10) ABC: "
434 ifeq ($(ABCREV
),default
)
435 .PHONY
: abc
/abc-
$(ABCREV
)$(EXE
)
438 yosys-abc
$(EXE
): abc
/abc-
$(ABCREV
)$(EXE
)
439 $(P
) cp abc
/abc-
$(ABCREV
)$(EXE
) yosys-abc
$(EXE
)
447 test: $(TARGETS
) $(EXTRA_TARGETS
)
448 +cd tests
/simple
&& bash run-test.sh
$(SEEDOPT
)
449 +cd tests
/hana
&& bash run-test.sh
$(SEEDOPT
)
450 +cd tests
/asicworld
&& bash run-test.sh
$(SEEDOPT
)
451 +cd tests
/realmath
&& bash run-test.sh
$(SEEDOPT
)
452 +cd tests
/share
&& bash run-test.sh
$(SEEDOPT
)
453 +cd tests
/fsm
&& bash run-test.sh
$(SEEDOPT
)
454 +cd tests
/techmap
&& bash run-test.sh
455 +cd tests
/memories
&& bash run-test.sh
$(SEEDOPT
)
456 +cd tests
/bram
&& bash run-test.sh
$(SEEDOPT
)
457 +cd tests
/various
&& bash run-test.sh
458 +cd tests
/sat
&& bash run-test.sh
460 @echo
" Passed \"make test\"."
463 VALGRIND ?
= valgrind
--error-exitcode
=1 --leak-check
=full
--show-reachable
=yes
--errors-for-leak-kinds
=all
465 vgtest
: $(TARGETS
) $(EXTRA_TARGETS
)
466 $(VALGRIND
) .
/yosys
-p
'setattr -mod -unset top; synth' $$( ls tests
/simple
/*.v | grep
-v repwhile.v
)
468 @echo
" Passed \"make vgtest\"."
471 vloghtb
: $(TARGETS
) $(EXTRA_TARGETS
)
472 +cd tests
/vloghtb
&& bash run-test.sh
474 @echo
" Passed \"make vloghtb\"."
478 unit-test
: libyosys.so
479 @
$(MAKE
) -C
$(UNITESTPATH
) CXX
="$(CXX)" CPPFLAGS
="$(CPPFLAGS)" \
480 CXXFLAGS
="$(CXXFLAGS)" LDLIBS
="$(LDLIBS)" ROOTPATH
="$(CURDIR)"
483 @
$(MAKE
) -C
$(UNITESTPATH
) clean
485 install: $(TARGETS
) $(EXTRA_TARGETS
)
486 $(INSTALL_SUDO
) mkdir
-p
$(DESTDIR
)$(BINDIR
)
487 $(INSTALL_SUDO
) install $(TARGETS
) $(DESTDIR
)$(BINDIR
)
488 $(INSTALL_SUDO
) mkdir
-p
$(DESTDIR
)$(DATDIR
)
489 $(INSTALL_SUDO
) cp
-r share
/.
$(DESTDIR
)$(DATDIR
)/.
490 ifeq ($(ENABLE_LIBYOSYS
),1)
491 $(INSTALL_SUDO
) cp libyosys.so
$(DESTDIR
)$(LIBDIR
)
492 $(INSTALL_SUDO
) ldconfig
496 $(INSTALL_SUDO
) rm -vf
$(addprefix $(DESTDIR
)$(BINDIR
)/,$(notdir $(TARGETS
)))
497 $(INSTALL_SUDO
) rm -rvf
$(DESTDIR
)$(DATDIR
)
498 ifeq ($(ENABLE_LIBYOSYS
),1)
499 $(INSTALL_SUDO
) rm -vf
$(DESTDIR
)$(LIBDIR
)/libyosys.so
502 update-manual
: $(TARGETS
) $(EXTRA_TARGETS
)
503 cd manual
&& ..
/yosys
-p
'help -write-tex-command-reference-manual'
505 manual
: $(TARGETS
) $(EXTRA_TARGETS
)
506 cd manual
&& bash appnotes.sh
507 cd manual
&& bash presentation.sh
508 cd manual
&& bash manual.sh
512 if
test -d manual
; then cd manual
&& sh
clean.sh
; fi
513 rm -f
$(OBJS
) $(GENFILES
) $(TARGETS
) $(EXTRA_TARGETS
) $(EXTRA_OBJS
)
514 rm -f kernel
/version_
*.o kernel
/version_
*.
cc abc
/abc-
[0-9a-f
]*
515 rm -f libs
/*/*.d frontends
/*/*.d passes
/*/*.d backends
/*/*.d kernel
/*.d techlibs
/*/*.d
516 rm -rf tests
/asicworld
/*.out tests
/asicworld
/*.log
517 rm -rf tests
/hana
/*.out tests
/hana
/*.log
518 rm -rf tests
/simple
/*.out tests
/simple
/*.log
519 rm -rf tests
/memories
/*.out tests
/memories
/*.log tests
/memories
/*.dmp
520 rm -rf tests
/sat
/*.log tests
/techmap
/*.log tests
/various
/*.log
521 rm -rf tests
/bram
/temp tests
/fsm
/temp tests
/realmath
/temp tests
/share
/temp tests
/smv
/temp
522 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_
*
523 rm -f tests
/tools
/cmp_tbdata
526 $(MAKE
) -C abc DEP
= clean
527 rm -f yosys-abc
$(EXE
) abc
/abc-
[0-9a-f
]*
533 { for file in
$(basename $(OBJS
)); do \
534 for
prefix in
cc y l
; do if
[ -f
$${file}.
$${prefix} ]; then echo
$$file.
$${prefix}; fi
; done \
535 done
; find backends frontends kernel libs passes
-type f \
( -name
'*.h' -o
-name
'*.hh' \
); } > qtcreator.files
536 { echo .
; find backends frontends kernel libs passes
-type f \
( -name
'*.h' -o
-name
'*.hh' \
) -printf
'%h\n' |
sort -u
; } > qtcreator.includes
537 touch qtcreator.config qtcreator.creator
539 vcxsrc
: $(GENFILES
) $(EXTRA_TARGETS
)
540 rm -rf yosys-win32-vcxsrc-
$(YOSYS_VER
){,.zip
}
541 set
-e
; for f in
`ls $(filter %.cc %.cpp,$(GENFILES)) $(addsuffix .cc,$(basename $(OBJS))) $(addsuffix .cpp,$(basename $(OBJS))) 2> /dev/null`; do \
542 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
543 bash misc
/create_vcxsrc.sh yosys-win32-vcxsrc
$(YOSYS_VER
) $(GIT_REV
)
544 echo
"namespace Yosys { extern const char *yosys_version_str; const char *yosys_version_str=\"Yosys (Version Information Unavailable)\"; }" > kernel
/version.
cc
545 zip yosys-win32-vcxsrc-
$(YOSYS_VER
)/genfiles.zip
$(GENFILES
) kernel
/version.
cc
546 zip
-r yosys-win32-vcxsrc-
$(YOSYS_VER
).zip yosys-win32-vcxsrc-
$(YOSYS_VER
)/
547 rm -f srcfiles.txt kernel
/version.
cc
550 mxebin
: $(TARGETS
) $(EXTRA_TARGETS
)
551 rm -rf yosys-win32-mxebin-
$(YOSYS_VER
){,.zip
}
552 mkdir
-p yosys-win32-mxebin-
$(YOSYS_VER
)
553 cp
-r yosys.exe share
/ yosys-win32-mxebin-
$(YOSYS_VER
)/
554 ifeq ($(ENABLE_ABC
),1)
555 cp
-r yosys-abc.exe abc
/lib
/x86
/pthreadVC2.dll yosys-win32-mxebin-
$(YOSYS_VER
)/
557 echo
-en
'This is Yosys $(YOSYS_VER) for Win32.\r\n' > yosys-win32-mxebin-
$(YOSYS_VER
)/readme.txt
558 echo
-en
'Documentation at http://www.clifford.at/yosys/.\r\n' >> yosys-win32-mxebin-
$(YOSYS_VER
)/readme.txt
559 zip
-r yosys-win32-mxebin-
$(YOSYS_VER
).zip yosys-win32-mxebin-
$(YOSYS_VER
)/
566 echo
'CONFIG := clang' > Makefile.conf
569 echo
'CONFIG := gcc' > Makefile.conf
571 config-gcc-4.8
: clean
572 echo
'CONFIG := gcc-4.8' > Makefile.conf
575 echo
'CONFIG := emcc' > Makefile.conf
576 echo
'ENABLE_TCL := 0' >> Makefile.conf
577 echo
'ENABLE_ABC := 0' >> Makefile.conf
578 echo
'ENABLE_PLUGINS := 0' >> Makefile.conf
579 echo
'ENABLE_READLINE := 0' >> Makefile.conf
582 echo
'CONFIG := mxe' > Makefile.conf
583 echo
'ENABLE_PLUGINS := 0' >> Makefile.conf
586 echo
'CONFIG := msys2' > Makefile.conf
589 echo
'CONFIG := gcc' > Makefile.conf
590 echo
'ENABLE_GPROF := 1' >> Makefile.conf
593 echo
"INSTALL_SUDO := sudo" >> Makefile.conf
602 -include frontends
/*/*.d
603 -include passes
/*/*.d
604 -include backends
/*/*.d
606 -include techlibs
/*/*.d
608 .PHONY
: all top-all abc
test install install-abc manual
clean mrproper qtcreator
609 .PHONY
: config-clean config-clang config-gcc config-gcc-4.8 config-gprof config-sudo