Browse files

Some more generic fixes for building in a remote directory

This patch fixes a few more issues related to building
in a remote directory. The start of the problem was
that the version file was not getting built correctly.
This necessitated using vpath instead of VPATH to only
allow the files. After that a few other places
needed to have $(srcdir) added.

The distclean target was also enhance so that when
building from a remote directory (srcdir != .) we
remove all the extra files and directories.
  • Loading branch information...
1 parent 8abe0d7 commit 6909737bf24fbde8260cebc266f770320893b5de @caryr caryr committed with Nov 29, 2009
Showing with 11 additions and 4 deletions.
  1. +11 −4
@@ -40,10 +40,13 @@ datarootdir = @datarootdir@
SUBDIRS = ivlpp vvp vpi libveriuser cadpli tgt-null tgt-stub tgt-vvp \
tgt-vhdl driver
-# Only run distclean for these driectories.
+# Only run distclean for these directories.
NOTUSED = tgt-fpga tgt-pal tgt-verilog
-VPATH = $(srcdir)
+# To get the version headers to build correctly we only want to look
+# for C++ files in the source directory. All other files will require
+# an explicit $(srcdir).
+vpath $(srcdir)
bindir = @bindir@
libdir = @libdir@
@@ -112,6 +115,10 @@ endif
rm -f Makefile config.status config.log config.cache
rm -f stamp-config-h config.h
rm -f stamp-_pli_types-h _pli_types.h
+ifneq (@srcdir@,.)
+ rm -f version.h version_tag.h check.conf
+ rmdir $(SUBDIRS) $(NOTUSED)
rm -rf autom4te.cache
TT = t-dll.o t-dll-api.o t-dll-expr.o t-dll-proc.o t-dll-analog.o
@@ -175,7 +182,7 @@ SUBDIRS += driver-vpi
all: dep iverilog-vpi
-iverilog-vpi: Makefile
+iverilog-vpi: $(srcdir)/ Makefile
sed -e 's;@SHARED@;@shared@;' -e 's;@PIC@;@PICFLAG@;' \
-e 's;@SUFFIX@;$(suffix);' \
-e 's;@IVCC@;$(CC);' \
@@ -213,7 +220,7 @@ $(srcdir)/lexor.lex
lexor_keyword.o: parse.h lexor_keyword.gperf $(srcdir)/lexor_keyword.gperf
gperf -o -i 7 -C -k 1-4,$$ -L ANSI-C -H keyword_hash -N check_identifier -t $(srcdir)/lexor_keyword.gperf > || (rm -f ; false) $(srcdir)/ version.exe

0 comments on commit 6909737

Please sign in to comment.