From 90fe5850033c7cfb72387458dc272871663bfa83 Mon Sep 17 00:00:00 2001 From: Mariusz Glebocki Date: Mon, 3 Feb 2020 21:48:51 +0100 Subject: [PATCH] build/sim: allow to use environment's {C,LD}FLAGS There are use cases where additional flags should be added to CFLAGS or LDFLAGS, e.g. when using Conda environment. --- litex/build/sim/core/Makefile | 6 +++--- litex/build/sim/core/modules/variables.mak | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/litex/build/sim/core/Makefile b/litex/build/sim/core/Makefile index c486e778..b1c88028 100644 --- a/litex/build/sim/core/Makefile +++ b/litex/build/sim/core/Makefile @@ -1,8 +1,8 @@ include variables.mak -CC = gcc -CFLAGS = -Wall -$(OPT_LEVEL) -ggdb $(if $(COVERAGE), -DVM_COVERAGE) -LDFLAGS = -lpthread -Wl,--no-as-needed -ljson-c -lm -lstdc++ -Wl,--no-as-needed -ldl -levent +CC ?= gcc +CFLAGS += -Wall -$(OPT_LEVEL) -ggdb $(if $(COVERAGE), -DVM_COVERAGE) +LDFLAGS += -lpthread -Wl,--no-as-needed -ljson-c -lm -lstdc++ -Wl,--no-as-needed -ldl -levent CC_SRCS ?= "--cc dut.v" diff --git a/litex/build/sim/core/modules/variables.mak b/litex/build/sim/core/modules/variables.mak index 76441764..6c504f3c 100644 --- a/litex/build/sim/core/modules/variables.mak +++ b/litex/build/sim/core/modules/variables.mak @@ -1,5 +1,5 @@ -CC = gcc -CFLAGS = -Wall -O3 -ggdb -fPIC -Werror -LDFLAGS = -levent -shared -fPIC +CC ?= gcc +CFLAGS += -Wall -O3 -ggdb -fPIC -Werror +LDFLAGS += -levent -shared -fPIC OBJ_DIR ?= . -- 2.30.2