From f1e2f373ae8bd50fd29c084ec6555770023d9ef0 Mon Sep 17 00:00:00 2001 From: Cary R Date: Fri, 12 Dec 2008 15:30:15 -0800 Subject: [PATCH] Fix MinGW make distclean and add .in dependencies. This patch fixes the crash in MinGW make distclean. The problem was that vpi/ and driver-vpi/ were being called twice and the MinGW make was failing on the second call since the Makefile was already removed. Add a dependency on config.h and _pli_types.h in the make all target. It is likely that only _pli_types.h was needed, but this makes it clear that they need to be rebuilt if the .in files change. The lower directories that depend on the top level config.status now have a target to rebuild the local Makefile file it the corresponding Makefile.in changes. --- Makefile.in | 22 +++++++++++++++++----- driver-vpi/Makefile.in | 3 +++ driver/Makefile.in | 3 +++ ivlpp/Makefile.in | 3 +++ tgt-null/Makefile.in | 3 +++ tgt-pal/Makefile.in | 3 +++ tgt-verilog/Makefile.in | 3 +++ 7 files changed, 35 insertions(+), 5 deletions(-) diff --git a/Makefile.in b/Makefile.in index 58638d592..b0e5aab8b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -82,7 +82,7 @@ CXXFLAGS = -Wall @CXXFLAGS@ PICFLAGS = @PICFLAG@ LDFLAGS = @rdynamic@ @LDFLAGS@ -all: dep version.h ivl@EXEEXT@ +all: dep config.h _pli_types.h version.h ivl@EXEEXT@ for dir in $(SUBDIRS); do (cd $$dir ; $(MAKE) VERSION=$(VERSION) $@); done for dir in ivlpp ; \ do (cd $$dir ; $(MAKE) VERSION=$(VERSION) $@); done @@ -106,8 +106,11 @@ check: all clean: for dir in $(SUBDIRS); do (cd $$dir ; $(MAKE) $@); done - for dir in vpi ivlpp tgt-verilog tgt-pal driver driver-vpi; \ + for dir in ivlpp tgt-verilog tgt-pal driver; \ do (cd $$dir ; $(MAKE) $@); done +ifeq (@MINGW32@,no) + (cd driver-vpi ; $(MAKE) $@) +endif rm -f *.o parse.cc parse.cc.output parse.h lexor.cc rm -f ivl.exp iverilog-vpi.pdf iverilog-vpi.ps parse.output rm -f syn-rules.output dosify.exe ivl@EXEEXT@ check.vvp @@ -116,8 +119,11 @@ clean: distclean: clean for dir in $(SUBDIRS); do (cd $$dir ; $(MAKE) $@); done - for dir in vpi ivlpp tgt-verilog tgt-pal driver driver-vpi; \ + for dir in ivlpp tgt-verilog tgt-pal driver; \ do (cd $$dir ; $(MAKE) $@); done +ifeq (@MINGW32@,no) + (cd driver-vpi ; $(MAKE) $@) +endif rm -f Makefile config.status config.log config.cache config.h rm -f _pli_types.h @@ -142,8 +148,14 @@ PExpr.o PGate.o PGenerate.o PScope.o PSpec.o \ PTask.o PUdp.o PFunction.o PWire.o Statement.o AStatement.o StringHeap.o \ $(FF) $(TT) -Makefile: Makefile.in config.h.in config.status - ./config.status +Makefile: $(srcdir)/Makefile.in config.status + ./config.status --file=$@ + +config.h: $(srcdir)/config.h.in config.status + ./config.status --header=$@ + +_pli_types.h: $(srcdir)/_pli_types.h.in config.status + ./config.status --header=$@ ifeq (@WIN32@,yes) diff --git a/driver-vpi/Makefile.in b/driver-vpi/Makefile.in index 46d937906..325dc39f7 100644 --- a/driver-vpi/Makefile.in +++ b/driver-vpi/Makefile.in @@ -58,6 +58,9 @@ clean: distclean: clean rm -f Makefile +Makefile: $(srcdir)/Makefile.in ../config.status + ../config.status --file=$@ + O = main.o res.o iverilog-vpi@EXEEXT@: $O diff --git a/driver/Makefile.in b/driver/Makefile.in index 8e9c6ee03..2aaf34c7b 100644 --- a/driver/Makefile.in +++ b/driver/Makefile.in @@ -57,6 +57,9 @@ clean: distclean: clean rm -f Makefile +Makefile: $(srcdir)/Makefile.in ../config.status + ../config.status --file=$@ + O = main.o substit.o cflexor.o cfparse.o iverilog@EXEEXT@: $O diff --git a/ivlpp/Makefile.in b/ivlpp/Makefile.in index 991fbf79d..6adea5292 100644 --- a/ivlpp/Makefile.in +++ b/ivlpp/Makefile.in @@ -51,6 +51,9 @@ clean: distclean: clean rm -f Makefile +Makefile: $(srcdir)/Makefile.in ../config.status + ../config.status --file=$@ + O = main.o lexor.o ivlpp@EXEEXT@: $O diff --git a/tgt-null/Makefile.in b/tgt-null/Makefile.in index 7b0cf6b75..f5af80c18 100644 --- a/tgt-null/Makefile.in +++ b/tgt-null/Makefile.in @@ -71,6 +71,9 @@ clean: distclean: clean rm -f Makefile config.status config.log config.cache +Makefile: $(srcdir)/Makefile.in ../config.status + ../config.status --file=$@ + check: all install: all installdirs $(libdir)/ivl$(suffix)/null.tgt $(INSTALL_DOC) $(libdir)/ivl$(suffix)/null.conf $(libdir)/ivl$(suffix)/null-s.conf diff --git a/tgt-pal/Makefile.in b/tgt-pal/Makefile.in index 110ae349d..8056311ab 100644 --- a/tgt-pal/Makefile.in +++ b/tgt-pal/Makefile.in @@ -68,6 +68,9 @@ clean: distclean: clean rm -f Makefile +Makefile: $(srcdir)/Makefile.in ../config.status + ../config.status --file=$@ + install: all installdirs $(libdir)/ivl/pal.tgt $(libdir)/ivl/pal.tgt: ./pal.tgt diff --git a/tgt-verilog/Makefile.in b/tgt-verilog/Makefile.in index 277a42266..5f10263d9 100644 --- a/tgt-verilog/Makefile.in +++ b/tgt-verilog/Makefile.in @@ -67,6 +67,9 @@ clean: distclean: clean rm -f Makefile +Makefile: $(srcdir)/Makefile.in ../config.status + ../config.status --file=$@ + check: all install: all installdirs $(libdir)/ivl/verilog.tgt \