From eff8c68dd94cf90e2026db5a0bbb99b02a9fd8c2 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Thu, 28 Mar 2013 16:50:50 +0100 Subject: [PATCH] Improved Makefile: Added ENABLE_* switches --- Makefile | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index c2477fe7a..d59ca1d60 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,10 @@ CONFIG := clang-debug # CONFIG := gcc-debug # CONFIG := release +ENABLE_TCL := 1 +ENABLE_QT4 := 1 +ENABLE_GPROF := 0 + OBJS = kernel/driver.o kernel/register.o kernel/rtlil.o kernel/log.o kernel/calc.o kernel/select.o kernel/show.o OBJS += libs/bigint/BigIntegerAlgorithms.o libs/bigint/BigInteger.o libs/bigint/BigIntegerUtils.o @@ -12,7 +16,7 @@ OBJS += libs/sha1/sha1.o OBJS += libs/subcircuit/subcircuit.o GENFILES = -TARGETS = yosys yosys-config yosys-svgviewer +TARGETS = yosys yosys-config all: top-all @@ -37,8 +41,19 @@ CXX = gcc CXXFLAGS += -std=gnu++0x -march=native -O3 -DNDEBUG endif +ifeq ($(ENABLE_TCL),1) CXXFLAGS += -I/usr/include/tcl8.5 -DYOSYS_ENABLE_TCL LDLIBS += -ltcl8.5 +endif + +ifeq ($(ENABLE_GPROF),1) +CXXFLAGS += -pg +LDFLAGS += -pg +endif + +ifeq ($(ENABLE_QT4),1) +TARGETS += yosys-svgviewer +endif include frontends/*/Makefile.inc include passes/*/Makefile.inc @@ -55,19 +70,16 @@ yosys-config: yosys-config.in chmod +x yosys-config yosys-svgviewer: libs/svgviewer/*.h libs/svgviewer/*.cpp - -cd libs/svgviewer && qmake-qt4 && make - -cp libs/svgviewer/svgviewer yosys-svgviewer + cd libs/svgviewer && qmake-qt4 && make + cp libs/svgviewer/svgviewer yosys-svgviewer test: yosys cd tests/simple && bash run-test.sh cd tests/hana && bash run-test.sh cd tests/asicworld && bash run-test.sh -install: yosys - install yosys /usr/local/bin/yosys - install yosys-config /usr/local/bin/yosys-config - -install yosys-svgviewer /usr/local/bin/yosys-svgviewer - install yosys-filterlib /usr/local/bin/yosys-filterlib +install: $(TARGETS) + install $(TARGETS) /usr/local/bin/ clean: rm -f $(OBJS) $(GENFILES) $(TARGETS) @@ -96,6 +108,10 @@ config-gcc-debug: clean config-release: clean echo 'CONFIG := release' > Makefile.conf +config-gprof: clean + echo 'CONFIG := release' > Makefile.conf + echo 'ENABLE_GPROF := 1' >> Makefile.conf + -include libs/*/*.d -include frontends/*/*.d -include passes/*/*.d -- 2.30.2