From: Mariusz Glebocki Date: Mon, 3 Feb 2020 20:48:51 +0000 (+0100) Subject: build/sim: allow to use environment's {C,LD}FLAGS X-Git-Tag: 24jan2021_ls180~693^2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=90fe5850033c7cfb72387458dc272871663bfa83;p=litex.git 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. --- 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 ?= .