From 02c74b5bee114d4eefed0ddceb3ca83b5e8e115b Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sun, 13 Dec 2009 11:46:29 -0500 Subject: [PATCH] Document OBJCACHE and OBJCACHE_JOBS --- Makefile.in | 6 +++--- bin/verilator | 15 ++++++++++++++- src/Makefile.in | 11 +++++------ 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/Makefile.in b/Makefile.in index 24aec54e2..578da68a2 100644 --- a/Makefile.in +++ b/Makefile.in @@ -145,11 +145,11 @@ DISTFILES := $(DISTFILES_INC) VL_INST_MAN_FILES = verilator.1 -ifeq ($(OBJCACHE_HOSTS),) -export OBJCACHE_JOBS := -else +ifeq ($(OBJCACHE_JOBS),) +ifneq ($(OBJCACHE_HOSTS),) export OBJCACHE_JOBS := -j $(shell objcache --jobs "$(OBJCACHE_HOSTS)") endif +endif default: all all: all_nomsg msg_test diff --git a/bin/verilator b/bin/verilator index 9fe7c4a2f..cb9546fef 100755 --- a/bin/verilator +++ b/bin/verilator @@ -1004,6 +1004,18 @@ After running Make, the C++ compiler should produce the following: =over 4 +=item OBJCACHE + +Optionally specifies a caching or distribution program to place in front of +all runs of the C++ Compiler. For example, "objcache --read --write", or +"ccache". If using distcc, it would generally be run under either objcache +or ccache; see the documentation for those programs. + +=item OBJCACHE_JOBS + +Optionally lists Make flags that specifies parallel make jobs. For example +a 4 CPU system may use "-j 6" to request 6 parallel compiles when making. + =item SYSTEMC Required for SystemC output mode. If set, specifies the directory @@ -2525,7 +2537,8 @@ to compile on parallel machines and avoid compilations altogether. See the --output-split option, and the web for the ccache, distcc and icecream packages, and the Make::Cache package available from L. Make::Cache will skip GCC runs between -identical source builds, even across different users. +identical source builds, even across different users. You can use the +OBJCACHE environment variable to use these CC wrappers. =item Why do so many files need to recompile when I add a signal? diff --git a/src/Makefile.in b/src/Makefile.in index 79a3e702a..cebdc6591 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -40,11 +40,10 @@ export OBJCACHE_HOSTS := $(shell rschedule --no-allow-reserved --similar hostnam endif endif -ifeq ($(OBJCACHE_HOSTS),) -export OBJCACHE := -else +ifeq ($(OBJCACHE_JOBS),) +ifneq ($(OBJCACHE_HOSTS),) export OBJCACHE_JOBS := -j $(shell objcache --jobs "$(OBJCACHE_HOSTS)") -export OBJCACHE := @objcache --read --write +endif endif UNDER_GIT = $(wildcard ../.git/logs/HEAD) @@ -65,13 +64,13 @@ ifeq ($(VERILATOR_NO_OPT_BUILD),1) # Faster laptop development... One build @-cp -p $<.exe $@.exe else ../verilator_bin: obj_opt prefiles - cd obj_opt && $(MAKE) TGT=../$@ -f ../Makefile_obj serial + cd obj_opt && $(MAKE) -j 1 TGT=../$@ -f ../Makefile_obj serial cd obj_opt && $(MAKE) $(OBJCACHE_JOBS) TGT=../$@ -f ../Makefile_obj endif dbg: ../verilator_bin_dbg ../verilator_bin_dbg: obj_dbg prefiles - cd obj_dbg && $(MAKE) TGT=../$@ VL_DEBUG=1 -f ../Makefile_obj serial + cd obj_dbg && $(MAKE) -j 1 TGT=../$@ VL_DEBUG=1 -f ../Makefile_obj serial cd obj_dbg && $(MAKE) $(OBJCACHE_JOBS) TGT=../$@ VL_DEBUG=1 -f ../Makefile_obj prefiles::