GIT_REV := $(shell git rev-parse --short HEAD || echo UNKOWN)
OBJS = kernel/version_$(GIT_REV).o
+PRETTY = 0
+P =
+Q =
+S =
+
# set 'ABCREV = default' to use abc/ as it is
#
# Note: If you do ABC development, make sure that 'abc' in this directory
LDLIBS += $(patsubst %,$(VERIFIC_DIR)/%/*-linux.a,$(VERIFIC_COMPONENTS))
endif
+ifeq ($(PRETTY), 1)
+P = @echo "Building $@";
+Q = @
+S = -s
+endif
+
OBJS += kernel/driver.o kernel/register.o kernel/rtlil.o kernel/log.o kernel/calc.o
OBJS += kernel/compatibility.o
top-all: $(TARGETS) $(EXTRA_TARGETS)
yosys: $(OBJS)
- $(CXX) -o yosys $(LDFLAGS) $(OBJS) $(LDLIBS)
+ $(P) $(CXX) -o yosys $(LDFLAGS) $(OBJS) $(LDLIBS)
+
+%.o: %.cc
+ $(P) $(CXX) -o $@ -c $(CXXFLAGS) $<
+
+%.o: %.cpp
+ $(P) $(CXX) -o $@ -c $(CXXFLAGS) $<
kernel/version_$(GIT_REV).cc: Makefile
- rm -f kernel/version_*.o kernel/version_*.d kernel/version_*.cc
- echo "extern const char *yosys_version_str; const char *yosys_version_str=\"Yosys $(YOSYS_VER) (git sha1 $(GIT_REV))\";" > kernel/version_$(GIT_REV).cc
+ $(P) rm -f kernel/version_*.o kernel/version_*.d kernel/version_*.cc
+ $(Q) echo "extern const char *yosys_version_str; const char *yosys_version_str=\"Yosys $(YOSYS_VER) (git sha1 $(GIT_REV))\";" > kernel/version_$(GIT_REV).cc
yosys-config: yosys-config.in
- $(SED) -e 's,@CXX@,$(CXX),;' -e 's,@CXXFLAGS@,$(CXXFLAGS),;' -e 's,@LDFLAGS@,$(LDFLAGS),;' -e 's,@LDLIBS@,$(LDLIBS),;' \
+ $(P) $(SED) -e 's,@CXX@,$(CXX),;' -e 's,@CXXFLAGS@,$(CXXFLAGS),;' -e 's,@LDFLAGS@,$(LDFLAGS),;' -e 's,@LDLIBS@,$(LDLIBS),;' \
-e 's,@BINDIR@,$(DESTDIR)/bin,;' -e 's,@DATDIR@,$(DESTDIR)/share/yosys,;' < yosys-config.in > yosys-config
- chmod +x yosys-config
+ $(Q) chmod +x yosys-config
yosys-svgviewer: libs/svgviewer/*.h libs/svgviewer/*.cpp
- cd libs/svgviewer && $(QMAKE) && make
- cp `find libs/svgviewer -name svgviewer -type f` yosys-svgviewer
+ $(P) cd libs/svgviewer && $(QMAKE) && $(MAKE) $(S)
+ $(Q) cp `find libs/svgviewer -name svgviewer -type f` yosys-svgviewer
abc/abc-$(ABCREV):
+ $(P)
ifneq ($(ABCREV),default)
- if ( cd abc && hg identify; ) | grep -q +; then \
+ $(Q) if ( cd abc && hg identify; ) | grep -q +; then \
echo 'REEBE: NOP pbagnvaf ybpny zbqvsvpngvbaf! Frg NOPERI=qrsnhyg va Lbflf Znxrsvyr!' | tr 'A-Za-z' 'N-ZA-Mn-za-m'; false; \
fi
- if test "`cd abc && hg identify | cut -f1 -d' '`" != "$(ABCREV)"; then \
+ $(Q) if test "`cd abc && hg identify | cut -f1 -d' '`" != "$(ABCREV)"; then \
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; }; \
test -d abc || hg clone https://bitbucket.org/alanmi/abc abc; \
cd abc && hg pull && hg update -r $(ABCREV); \
fi
endif
- rm -f abc/abc-[0-9a-f]*
- cd abc && $(MAKE) PROG="abc-$(ABCREV)" MSG_PREFIX="YOSYS-ABC: "
+ $(Q) rm -f abc/abc-[0-9a-f]*
+ $(Q) cd abc && $(MAKE) $(S) PROG="abc-$(ABCREV)" MSG_PREFIX="YOSYS-ABC: "
ifeq ($(ABCREV),default)
.PHONY: abc/abc-$(ABCREV)
endif
yosys-abc: abc/abc-$(ABCREV)
- cp abc/abc-$(ABCREV) yosys-abc
+ $(P) cp abc/abc-$(ABCREV) yosys-abc
test: $(TARGETS) $(EXTRA_TARGETS)
cd tests/simple && bash run-test.sh
GENFILES += frontends/ilang/lexer.cc
frontends/ilang/parser.tab.cc: frontends/ilang/parser.y
- bison -d -r all -b frontends/ilang/parser frontends/ilang/parser.y
- mv frontends/ilang/parser.tab.c frontends/ilang/parser.tab.cc
+ $(P) bison -d -r all -b frontends/ilang/parser frontends/ilang/parser.y
+ $(Q) mv frontends/ilang/parser.tab.c frontends/ilang/parser.tab.cc
frontends/ilang/parser.tab.h: frontends/ilang/parser.tab.cc
frontends/ilang/lexer.cc: frontends/ilang/lexer.l
- flex -o frontends/ilang/lexer.cc frontends/ilang/lexer.l
+ $(P) flex -o frontends/ilang/lexer.cc frontends/ilang/lexer.l
OBJS += frontends/ilang/parser.tab.o frontends/ilang/lexer.o
OBJS += frontends/ilang/ilang_frontend.o
GENFILES += frontends/verilog/lexer.cc
frontends/verilog/parser.tab.cc: frontends/verilog/parser.y
- bison -d -r all -b frontends/verilog/parser frontends/verilog/parser.y
- mv frontends/verilog/parser.tab.c frontends/verilog/parser.tab.cc
+ $(P) bison -d -r all -b frontends/verilog/parser frontends/verilog/parser.y
+ $(Q) mv frontends/verilog/parser.tab.c frontends/verilog/parser.tab.cc
frontends/verilog/parser.tab.h: frontends/verilog/parser.tab.cc
frontends/verilog/lexer.cc: frontends/verilog/lexer.l
- flex -o frontends/verilog/lexer.cc frontends/verilog/lexer.l
+ $(P) flex -o frontends/verilog/lexer.cc frontends/verilog/lexer.l
OBJS += frontends/verilog/parser.tab.o
OBJS += frontends/verilog/lexer.o
GENFILES += passes/techmap/stdcells.inc
passes/techmap/stdcells.inc: techlibs/common/stdcells.v
- echo "// autogenerated from $<" > $@.new
- echo "static char stdcells_code[] = {" >> $@.new
- od -v -td1 -An $< | $(SED) -e 's/[0-9][0-9]*/&,/g' >> $@.new
- echo "0};" >> $@.new
- mv $@.new $@
+ $(P) echo "// autogenerated from $<" > $@.new
+ $(Q) echo "static char stdcells_code[] = {" >> $@.new
+ $(Q) od -v -td1 -An $< | $(SED) -e 's/[0-9][0-9]*/&,/g' >> $@.new
+ $(Q) echo "0};" >> $@.new
+ $(Q) mv $@.new $@
passes/techmap/techmap.o: passes/techmap/stdcells.inc
GENFILES += passes/techmap/filterlib.o
yosys-filterlib: passes/techmap/filterlib.o
- $(CXX) -o yosys-filterlib $(LDFLAGS) $^ $(LDLIBS)
+ $(P) $(CXX) -o yosys-filterlib $(LDFLAGS) $^ $(LDLIBS)
EXTRA_TARGETS += techlibs/common/blackbox.v
techlibs/common/blackbox.v: techlibs/common/blackbox.sed techlibs/common/simlib.v techlibs/common/simcells.v
- cat techlibs/common/simlib.v techlibs/common/simcells.v | $(SED) -rf techlibs/common/blackbox.sed > techlibs/common/blackbox.v.new
- mv techlibs/common/blackbox.v.new techlibs/common/blackbox.v
+ $(P) cat techlibs/common/simlib.v techlibs/common/simcells.v | $(SED) -rf techlibs/common/blackbox.sed > techlibs/common/blackbox.v.new
+ $(Q) mv techlibs/common/blackbox.v.new techlibs/common/blackbox.v
EXTRA_TARGETS += share/simlib.v share/simcells.v share/blackbox.v share/pmux2mux.v
share/simlib.v: techlibs/common/simlib.v
- mkdir -p share
- cp techlibs/common/simlib.v share/simlib.v
+ $(P) mkdir -p share
+ $(Q) cp techlibs/common/simlib.v share/simlib.v
share/simcells.v: techlibs/common/simcells.v
- mkdir -p share
- cp techlibs/common/simcells.v share/simcells.v
+ $(P) mkdir -p share
+ $(Q) cp techlibs/common/simcells.v share/simcells.v
share/blackbox.v: techlibs/common/blackbox.v
- mkdir -p share
- cp techlibs/common/blackbox.v share/blackbox.v
+ $(P) mkdir -p share
+ $(Q) cp techlibs/common/blackbox.v share/blackbox.v
share/pmux2mux.v: techlibs/common/pmux2mux.v
- mkdir -p share
- cp techlibs/common/pmux2mux.v share/pmux2mux.v
+ $(P) mkdir -p share
+ $(Q) cp techlibs/common/pmux2mux.v share/pmux2mux.v