build/sim: allow to use environment's {C,LD}FLAGS
authorMariusz Glebocki <mglebocki@antmicro.com>
Mon, 3 Feb 2020 20:48:51 +0000 (21:48 +0100)
committerMariusz Glebocki <mglebocki@antmicro.com>
Tue, 4 Feb 2020 16:31:31 +0000 (17:31 +0100)
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
litex/build/sim/core/modules/variables.mak

index c486e7782e2d2837e5255ff9fb8aacdc1000b1dc..b1c880280296c624af1cbf03f61236be7c35bed5 100644 (file)
@@ -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"
 
index 764417645666a29260df51596739184b62c3e3c5..6c504f3c46ad8f4f8a98e39d3ea5d95b25b3e363 100644 (file)
@@ -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 ?= .