diff --git a/Makefile b/Makefile index 8db7d2d..90aed2f 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,13 @@ LOG_REDIR = >& TIME=/usr/bin/time --format "Elapsed: %E, Memory: %M KB [Swaps %W]" +# Enable ccache for Verilator compilation +export OBJCACHE = ccache +export CXX = clang++ +export CC = clang +export OPT_FAST = -O1 +export OPT_SLOW = -O0 + # Makefile variables # Use as many threads as possible while keeping 2 for IO, browsing, etc. # USE_PROCS = $(( $(shell nproc --all) - 2 )) @@ -82,7 +89,7 @@ prepare_area: @if [ ! -d $(PROJ_BASE)/logs ]; then mkdir -p $(PROJ_BASE)/logs; fi # -# C code generation from SystemVerilog +# C code generation from SystemVerilog (optional translation/lint) # build_sv: prepare_area $(SV_OUT) @@ -98,9 +105,9 @@ $(SV_OUT): $(PROJ_BASE)/logs $(SV_DEPS) # # C code build to generate testbench executable # -build_cpp: build_sv $(CPP_OUT) +build_cpp: prepare_area $(CPP_OUT) -$(CPP_OUT): $(SV_OUT) +$(CPP_OUT): $(SV_DEPS) $(info #-------------------------) $(info # Building CPP ($(USE_PROCS) threads)) $(info #-------------------------)