17 TARGETS
= yosys yosys-config
21 CXXFLAGS
= -Wall
-Wextra
-ggdb
-I
"$(shell pwd)" -MD
-D_YOSYS_
-fPIC
23 LDLIBS
= -lstdc
++ -lreadline
-lm
-ldl
27 GIT_REV
:= $(shell git rev-parse
--short HEAD || echo UNKOWN
)
28 OBJS
= kernel
/version_
$(GIT_REV
).o
33 -include Makefile.conf
35 ifeq ($(CONFIG
),clang-debug
)
37 CXXFLAGS
+= -std
=c
++11 -O0
40 ifeq ($(CONFIG
),gcc-debug
)
42 CXXFLAGS
+= -std
=gnu
++0x
-O0
45 ifeq ($(CONFIG
),release
)
47 CXXFLAGS
+= -std
=gnu
++0x
-march
=native
-O3
-DNDEBUG
50 ifeq ($(ENABLE_TCL
),1)
51 CXXFLAGS
+= -I
/usr
/include/tcl8.5
-DYOSYS_ENABLE_TCL
55 ifeq ($(ENABLE_GPROF
),1)
60 ifeq ($(ENABLE_QT4
),1)
61 TARGETS
+= yosys-svgviewer
64 OBJS
+= kernel
/driver.o kernel
/register.o kernel
/rtlil.o kernel
/log.o kernel
/calc.o
66 OBJS
+= libs
/bigint
/BigIntegerAlgorithms.o libs
/bigint
/BigInteger.o libs
/bigint
/BigIntegerUtils.o
67 OBJS
+= libs
/bigint
/BigUnsigned.o libs
/bigint
/BigUnsignedInABase.o
69 OBJS
+= libs
/sha1
/sha1.o
70 OBJS
+= libs
/subcircuit
/subcircuit.o
71 OBJS
+= libs
/ezsat
/ezsat.o
73 ifeq ($(ENABLE_MINISAT
),1)
74 CXXFLAGS
+= -DYOSYS_ENABLE_MINISAT
75 OBJS
+= libs
/ezsat
/ezminisat.o
79 include frontends
/*/Makefile.inc
80 include passes
/*/Makefile.inc
81 include backends
/*/Makefile.inc
82 include techlibs
/*/Makefile.inc
84 top-all
: $(TARGETS
) $(EXTRA_TARGETS
)
87 $(CXX
) -o yosys
$(LDFLAGS
) $(OBJS
) $(LDLIBS
)
89 kernel
/version_
$(GIT_REV
).
cc: Makefile
90 rm -f kernel
/version_
*.o kernel
/version_
*.d kernel
/version_
*.
cc
91 echo
"extern const char *yosys_version_str; const char *yosys_version_str=\"Yosys $(YOSYS_VER) (git sha1 $(GIT_REV))\";" > kernel
/version_
$(GIT_REV
).
cc
93 yosys-config
: yosys-config.in
94 sed
-e
's,@CXX@,$(CXX),;' -e
's,@CXXFLAGS@,$(CXXFLAGS),;' -e
's,@LDFLAGS@,$(LDFLAGS),;' -e
's,@LDLIBS@,$(LDLIBS),;' \
95 -e
's,@BINDIR@,$(DESTDIR)/bin,;' -e
's,@DATDIR@,$(DESTDIR)/share/yosys,;' < yosys-config.in
> yosys-config
98 yosys-svgviewer
: libs
/svgviewer
/*.h libs
/svgviewer
/*.
cpp
99 cd libs
/svgviewer
&& $(QMAKE
) && make
100 cp libs
/svgviewer
/svgviewer yosys-svgviewer
104 test -d abc || hg clone https
://bitbucket.org
/alanmi
/abc abc
105 cd abc
&& hg pull
&& hg update
-r
$(ABCREV
)
111 cd tests
/simple
&& bash run-test.sh
112 cd tests
/hana
&& bash run-test.sh
113 cd tests
/asicworld
&& bash run-test.sh
116 $(INSTALL_SUDO
) mkdir
-p
$(DESTDIR
)/bin
117 $(INSTALL_SUDO
) install $(TARGETS
) $(DESTDIR
)/bin
/
118 $(INSTALL_SUDO
) mkdir
-p
$(DESTDIR
)/share
/yosys
119 $(INSTALL_SUDO
) cp
-r share
/.
$(DESTDIR
)/share
/yosys
/.
122 $(INSTALL_SUDO
) install yosys-abc
$(DESTDIR
)/bin
/
125 cd manual
&& bash make.sh
129 rm -f
$(OBJS
) $(GENFILES
) $(TARGETS
)
130 rm -f kernel
/version_
*.o kernel
/version_
*.
cc
131 rm -f libs
/*/*.d frontends
/*/*.d passes
/*/*.d backends
/*/*.d kernel
/*.d
132 cd manual
&& rm -f
*.aux
*.bbl
*.blg
*.idx
*.log
*.out
*.pdf
*.toc
133 test ! -f libs
/svgviewer
/Makefile || make
-C libs
/svgviewer
distclean
139 { for file in
$(basename $(OBJS
)); do \
140 for
prefix in
cc y l
; do if
[ -f
$${file}.
$${prefix} ]; then echo
$$file.
$${prefix}; fi
; done \
141 done
; find backends frontends kernel libs passes
-type f \
( -name
'*.h' -o
-name
'*.hh' \
); } > qtcreator.files
142 { echo .
; find backends frontends kernel libs passes
-type f \
( -name
'*.h' -o
-name
'*.hh' \
) -printf
'%h\n' |
sort -u
; } > qtcreator.includes
143 touch qtcreator.config qtcreator.creator
148 config-clang-debug
: clean
149 echo
'CONFIG := clang-debug' > Makefile.conf
151 config-gcc-debug
: clean
152 echo
'CONFIG := gcc-debug' > Makefile.conf
154 config-release
: clean
155 echo
'CONFIG := release' > Makefile.conf
158 echo
'CONFIG := release' > Makefile.conf
159 echo
'ENABLE_GPROF := 1' >> Makefile.conf
162 echo
"INSTALL_SUDO := sudo" >> Makefile.conf
165 -include frontends
/*/*.d
166 -include passes
/*/*.d
167 -include backends
/*/*.d
170 .PHONY
: all top-all abc
test install install-abc manual
clean mrproper qtcreator
171 .PHONY
: config-clean config-clang-debug config-gcc-debug config-release