"fsm_export" pass: fix KISS file generation.
[yosys.git] / Makefile
1
2 CONFIG := clang-debug
3 # CONFIG := gcc-debug
4 # CONFIG := release
5
6 OBJS = kernel/driver.o kernel/register.o kernel/rtlil.o kernel/log.o kernel/sha1.o kernel/calc.o kernel/select.o kernel/show.o
7 OBJS += bigint/BigIntegerAlgorithms.o bigint/BigInteger.o bigint/BigIntegerUtils.o bigint/BigUnsigned.o bigint/BigUnsignedInABase.o
8
9 GENFILES =
10 TARGETS = yosys
11
12 all: top-all
13
14 CXXFLAGS = -Wall -Wextra -ggdb -I$(shell pwd) -MD
15 LDFLAGS =
16 LDLIBS = -lstdc++ -lreadline -lm
17
18 -include Makefile.conf
19
20 ifeq ($(CONFIG),clang-debug)
21 CXX = clang
22 CXXFLAGS += -std=c++11 -O0
23 endif
24
25 ifeq ($(CONFIG),gcc-debug)
26 CXX = gcc
27 CXXFLAGS += -std=gnu++0x -O0
28 endif
29
30 ifeq ($(CONFIG),release)
31 CXX = gcc
32 CXXFLAGS += -std=gnu++0x -march=native -O3 -DNDEBUG
33 endif
34
35 include frontends/*/Makefile.inc
36 include passes/*/Makefile.inc
37 include backends/*/Makefile.inc
38 include techlibs/Makefile.inc
39
40 top-all: $(TARGETS)
41
42 yosys: $(OBJS)
43 $(CXX) -o yosys $(LDFLAGS) $(OBJS) $(LDLIBS)
44
45 test: yosys
46 cd tests/simple && bash run-test.sh
47 cd tests/hana && bash run-test.sh
48 cd tests/asicworld && bash run-test.sh
49
50 help:
51 @find -name '*.cc' | xargs egrep -h '(Pass|Frontend|Backend)\(".*"\)' | \
52 sed 's,.*: ,,; s, .*,,;' | sort | tr '\n' '\t' | expand -t25 | fmt
53
54 install: yosys
55 install yosys /usr/local/bin/yosys
56
57 clean:
58 rm -f $(OBJS) $(GENFILES) $(TARGETS)
59 rm -f bigint/*.d frontends/*/*.d passes/*/*.d backends/*/*.d kernel/*.d
60
61 mrproper: clean
62 git clean -xdf
63
64 qtcreator:
65 { for file in $(basename $(OBJS)); do \
66 for prefix in cc y l; do if [ -f $${file}.$${prefix} ]; then echo $$file.$${prefix}; fi; done \
67 done; find backends bigint frontends kernel passes -type f \( -name '*.h' -o -name '*.hh' \); } > qtcreator.files
68 { echo .; find backends bigint frontends kernel passes -type f \( -name '*.h' -o -name '*.hh' \) -printf '%h\n' | sort -u; } > qtcreator.includes
69 touch qtcreator.config qtcreator.creator
70
71 -include bigint/*.d
72 -include frontends/*/*.d
73 -include passes/*/*.d
74 -include backends/*/*.d
75 -include kernel/*.d
76