More build system tweaks, fixing pr2881797.
Use the time stamp file technique recommended by the autoconf manual
to prevent unneccesary rebuilds because of an unchanged config.h.
Uses the automake trick of generating the stamp files in the
_AC_AM_CONFIG_HEADER_HOOK macro instead of littering the source
directory with stamp-h.in files.
Add an extra ./config.status run after ./config.status --recheck
because with --recheck it doesn't actually try to remake the generated
files (and thus doesn't make the timestamp files). Thus without the
extra run, each stamp-*-h target would need to independently run
./config.status to make sure it wasn't changed by the configuration
change.
An orthogonal fix of how config.status is called in subdirectories.
When in a subdirectory and config.status is called with
../config.status and $(srcdir) is a relative path, config.status gets
confused. Fixed by replacing '../config.status --file=Makefile.in'
with 'cd ..; ./config.status --file=<dir>/Makefile.in'
(cherry picked from commit 7ead2aa88b)
This commit is contained in:
parent
58511ab212
commit
7eb4825435
13
Makefile.in
13
Makefile.in
|
|
@ -134,17 +134,22 @@ $(FF) $(TT)
|
|||
Makefile: $(srcdir)/Makefile.in config.status
|
||||
./config.status --file=$@
|
||||
|
||||
config.h: $(srcdir)/config.h.in
|
||||
./config.status --header=$@
|
||||
stamp-config-h: $(srcdir)/config.h.in config.status
|
||||
@rm -f $@
|
||||
./config.status config.h
|
||||
config.h: stamp-config-h
|
||||
|
||||
_pli_types.h: $(srcdir)/_pli_types.h.in
|
||||
./config.status --header=$@
|
||||
stamp-_pli_types-h: $(srcdir)/_pli_types.h.in config.status
|
||||
@rm -f $@
|
||||
./config.status _pli_types.h
|
||||
_pli_types.h: stamp-_pli_types-h
|
||||
|
||||
$(srcdir)/configure: $(srcdir)/configure.in
|
||||
cd $(srcdir) && autoconf
|
||||
|
||||
config.status: $(srcdir)/configure
|
||||
./config.status --recheck
|
||||
./config.status
|
||||
|
||||
ifeq (@WIN32@,yes)
|
||||
# Under Windows (mingw) I need to make the ivl.exe in two steps.
|
||||
|
|
|
|||
|
|
@ -216,3 +216,17 @@ case "${host}" in
|
|||
;;
|
||||
esac
|
||||
])# AX_CPP_PRECOMP
|
||||
|
||||
# When config.status generates a header, we must update the stamp-h file.
|
||||
# This file resides in the same directory as the config header
|
||||
# that is generated. The stamp file name are based on the header name.
|
||||
|
||||
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
|
||||
# loop where config.status creates the headers, so we can generate
|
||||
# our stamp files there.
|
||||
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
|
||||
[
|
||||
_config_header=$1
|
||||
_stamp_name=stamp-`expr //$_config_header : '.*/\([[^./]]*\)\.[[^./]]*$'`-h
|
||||
echo "timestamp for $_config_header" > `AS_DIRNAME(["$_config_header"])`/[]$_stamp_name
|
||||
]) #_AC_AM_CONFIG_HEADER_HOOK
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ dep:
|
|||
O = cadpli.o
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in ../config.status
|
||||
../config.status --file=$@
|
||||
cd ..; ./config.status --file=cadpli/$@
|
||||
|
||||
SYSTEM_VPI_LDFLAGS = -L../vvp -lvpi
|
||||
ifeq (@MINGW32@,yes)
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ distclean: clean
|
|||
rm -f Makefile config.log
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in ../config.status
|
||||
../config.status --file=$@
|
||||
cd ..; ./config.status --file=driver/$@
|
||||
|
||||
O = main.o substit.o cflexor.o cfparse.o
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ distclean: clean
|
|||
rm -f Makefile config.log
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in ../config.status
|
||||
../config.status --file=$@
|
||||
cd ..; ./config.status --file=ivlpp/$@
|
||||
|
||||
O = main.o lexor.o
|
||||
|
||||
|
|
|
|||
|
|
@ -59,11 +59,13 @@ all: dep libveriuser.a $(ALL32)
|
|||
|
||||
check: all
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in ../config.status
|
||||
../config.status --file=$@
|
||||
Makefile: $(srcdir)/Makefile.in
|
||||
cd ..; ./config.status --file=libveriuser/$@
|
||||
|
||||
config.h: $(srcdir)/config.h.in ../config.status
|
||||
../config.status --header=$@
|
||||
stamp-config-h: $(srcdir)/config.h.in ../config.status
|
||||
@rm -f $@
|
||||
cd ..; ./config.status --header=libveriuser/config.h
|
||||
config.h: stamp-config-h
|
||||
|
||||
libveriuser.o: $O
|
||||
$(LD) -r -o $@ $O
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ distclean: clean
|
|||
rm -f Makefile config.log
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in ../config.status
|
||||
../config.status --file=$@
|
||||
cd ..; ./config.status --file=tgt-null/$@
|
||||
|
||||
install: all installdirs $(libdir)/ivl$(suffix)/null.tgt $(INSTALL_DOC) $(libdir)/ivl$(suffix)/null.conf $(libdir)/ivl$(suffix)/null-s.conf
|
||||
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ distclean: clean
|
|||
rm -f Makefile config.log
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in ../config.status
|
||||
../config.status --file=$@
|
||||
cd ..; ./config.status --file=tgt-stub/$@
|
||||
|
||||
install: all installdirs $(libdir)/ivl$(suffix)/stub.tgt \
|
||||
$(libdir)/ivl$(suffix)/stub.conf $(libdir)/ivl$(suffix)/stub-s.conf
|
||||
|
|
|
|||
|
|
@ -64,10 +64,12 @@ vhdl.tgt: $O $(TGTDEPLIBS)
|
|||
$(CXX) @shared@ -o $@ $O $(TGTLDFLAGS)
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in ../config.status
|
||||
../config.status --file=$@
|
||||
cd ..; ./config.status --file=tgt-vhdl/$@
|
||||
|
||||
vhdl_config.h: $(srcdir)/vhdl_config.h.in ../config.status
|
||||
../config.status --header=$@
|
||||
stamp-vhdl_config-h: $(srcdir)/vhdl_config.h.in ../config.status
|
||||
@rm -f $@
|
||||
cd ..; ./config.status --header=tgt-vhdl/vhdl_config.h
|
||||
vhdl_config.h: stamp-vhdl_config-h
|
||||
|
||||
clean:
|
||||
rm -rf $(O) dep vhdl.tgt
|
||||
|
|
|
|||
|
|
@ -75,10 +75,12 @@ vvp-s.conf: $(srcdir)/vvp-s.conf.in Makefile
|
|||
echo 'flag:VVP_EXECUTABLE=$(bindir)/vvp$(suffix)' | cat $(srcdir)/vvp-s.conf.in - > vvp-s.conf
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in ../config.status
|
||||
../config.status --file=$@
|
||||
cd ..; ./config.status --file=tgt-vvp/$@
|
||||
|
||||
vvp_config.h: $(srcdir)/vvp_config.h.in ../config.status
|
||||
../config.status --header=$@
|
||||
stamp-vvp_config-h: $(srcdir)/vvp_config.h.in ../config.status
|
||||
@rm -f $@
|
||||
cd ..; ./config.status --header=tgt-vvp/vvp_config.h
|
||||
vvp_config.h: stamp-vvp_config-h
|
||||
|
||||
clean:
|
||||
rm -rf *.o dep vvp.tgt vvp.conf vvp-s.conf
|
||||
|
|
|
|||
|
|
@ -112,10 +112,12 @@ distclean: clean
|
|||
rm -f Makefile config.log vpi_config.h
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in ../config.status
|
||||
../config.status --file=$@
|
||||
cd ..; ./config.status --file=vpi/$@
|
||||
|
||||
vpi_config.h: $(srcdir)/vpi_config.h.in ../config.status
|
||||
../config.status --header=$@
|
||||
stamp-vpi_config-h: $(srcdir)/vpi_config.h.in ../config.status
|
||||
@rm -f $@
|
||||
cd ..; ./config.status --header=vpi/vpi_config.h
|
||||
vpi_config.h: stamp-vpi_config-h
|
||||
|
||||
check: all
|
||||
|
||||
|
|
|
|||
|
|
@ -150,11 +150,13 @@ INSTALL_DOC = $(mandir)/man1/vvp$(suffix).1
|
|||
INSTALL_DOCDIR = $(mandir)/man1
|
||||
endif
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in ../config.status
|
||||
../config.status --file=$@
|
||||
Makefile: $(srcdir)/Makefile.in
|
||||
cd ..; ./config.status --file=vvp/$@
|
||||
|
||||
config.h: $(srcdir)/config.h.in ../config.status
|
||||
../config.status --header=$@
|
||||
stamp-config-h: $(srcdir)/config.h.in ../config.status
|
||||
@rm -f $@
|
||||
cd ..; ./config.status --header=vvp/config.h
|
||||
config.h: stamp-config-h
|
||||
|
||||
install: all installdirs $(bindir)/vvp$(suffix)@EXEEXT@ $(libdir)/libvpi$(suffix).a $(INSTALL_DOC)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue