From 23ee0342c66a42901403b8a85f07afd96bf9b3c2 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Tue, 24 Jun 2008 14:50:34 -0400 Subject: [PATCH] Fix Makefile to find headers/libraries under prefix. --- Changes | 2 ++ bin/verilator | 10 +++++++--- configure.ac | 8 +++++++- src/Makefile_obj.in | 23 ++++++++++++----------- 4 files changed, 28 insertions(+), 15 deletions(-) diff --git a/Changes b/Changes index f30ceedac..a7e0af4f8 100644 --- a/Changes +++ b/Changes @@ -17,6 +17,8 @@ indicates the contributor was also the author of the fix; Thanks! **** Fix compile errors under Fedora 9, GCC 4.3.0. [by Jeremy Bennett] +**** Fix Makefile to find headers/libraries under prefix. [by Holger_Waechtler] + * Verilator 3.664 2008/05/08 **** Fix missing file in kit. diff --git a/bin/verilator b/bin/verilator index f0386032b..0d7be1a15 100755 --- a/bin/verilator +++ b/bin/verilator @@ -516,9 +516,13 @@ designs with only one top. =item --trace -Adds waveform tracing code to the model, this will create additional -{prefix}__Trace*.cpp files you will need to add to your Makefiles, if -you're not using the ones generated for you. +Adds waveform tracing code to the model. Verilator will generate +additional {prefix}__Trace*.cpp files that will need to be compiled. In +addition Sp.cpp (for SystemC traces) or SpTraceVcdC.c (for C++ only) from +the SystemPerl kit's src directory must be compiled and linked in. If +using the Verilator generated Makefiles, these will be added as source +targets for you. If you're not using the Verilator makefiles, you will +need to add these to your Makefile manually. Having tracing compiled in may result in some small performance losses, even when waveforms are not turned on during model execution. diff --git a/configure.ac b/configure.ac index d370d8a38..94c83de1b 100644 --- a/configure.ac +++ b/configure.ac @@ -13,8 +13,14 @@ AC_ARG_ENABLE(defenv, CFG_WITH_DEFENV=yes) AC_SUBST(CFG_WITH_DEFENV) -dnl Checks for programs. +dnl Compiler flags CXX=g++ +CFLAGS=-I${includedir} +CPPFLAGS=-I${includedir} +CXXFLAGS=-I${includedir} +LDFLAGS=-L${libdir} + +dnl Checks for programs. AC_PROG_CC AC_PROG_CXX AC_PROG_INSTALL diff --git a/src/Makefile_obj.in b/src/Makefile_obj.in index 9b2338a48..7735d870d 100644 --- a/src/Makefile_obj.in +++ b/src/Makefile_obj.in @@ -23,14 +23,15 @@ srcdir = .. incdir = ../../include -PERL = @PERL@ +# Programs CC = @CC@ CXX = @CXX@ LINK = @CXX@ - -LDFLAGS += @LDFLAGS@ - -CFG_WITH_DEFENV = @CFG_WITH_DEFENV@ +LEX = @LEX@ +LFLAGS = -d +PERL = @PERL@ +YACC = @YACC@ +YFLAGS = -y -d -v prefix = @prefix@ @@ -41,6 +42,11 @@ datarootdir = @datarootdir@ # Generally ${prefix}/share/verilator pkgdatadir = @pkgdatadir@ +# Compile options +CFG_WITH_DEFENV = @CFG_WITH_DEFENV@ +CPPFLAGSNOWALL += @CPPFLAGS@ +LDFLAGS += @LDFLAGS@ + #### End of system configuration section. #### VPATH += . $(srcdir) @@ -59,17 +65,12 @@ COPT = -ggdb -DVL_DEBUG endif ################# -LEX = @LEX@ -LFLAGS = -d -YACC = @YACC@ -YFLAGS = -y -d -v - #LIBS += -ldl #CCMALLOC = /usr/local/lib/ccmalloc-gcc.o -lccmalloc -ldl LIBS = -lm -lfl -CPPFLAGSNOWALL = -MMD +CPPFLAGSNOWALL += -MMD CPPFLAGSNOWALL += -I. -I$(srcdir) -I$(incdir) CPPFLAGSNOWALL += -DYYDEBUG # Required to get nice error messages #CPPFLAGSNOWALL += -DVL_LEAK_CHECKS # If running valgrind or other hunting tool