diff --git a/Makefile.in b/Makefile.in index 160af3de5..06bb13f65 100644 --- a/Makefile.in +++ b/Makefile.in @@ -169,7 +169,7 @@ clean: rm -f ivl.exp iverilog-vpi.man iverilog-vpi.pdf iverilog-vpi.ps rm -f iverilog_man.ps iverilog_man.pdf iverilog_man_`./version.exe %M_%n`.pdf rm -f parse.output syn-rules.output dosify$(BUILDEXT) ivl@EXEEXT@ check.vvp - rm -f lexor_keyword.cc libivl.a libvpi.a iverilog-vpi syn-rules.cc + rm -f lexor_keyword.cc libivl.a libvpi.a iverilog-vpi syn-rules.cc version_base.h rm -rf dep rm -f version.exe @@ -251,7 +251,10 @@ iverilog-vpi: $(srcdir)/iverilog-vpi.sh Makefile chmod +x $@ endif -version.exe: $(srcdir)/version.c $(srcdir)/version_base.h version_tag.h +version_base.h: $(srcdir)/version_base.h.in config.status + ./config.status --file=$@ + +version.exe: $(srcdir)/version.c version_base.h version_tag.h $(BUILDCC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o version.exe -I. -I$(srcdir) $(srcdir)/version.c %.o: %.cc config.h | dep diff --git a/configure.ac b/configure.ac index fa480039c..e741eb1e3 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,18 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT + AC_CONFIG_MACRO_DIRS([m4]) +dnl Define project version +m4_define([VER_MAJOR], [14]) +m4_define([VER_MINOR], [0]) +m4_define([VER_EXTRA], [devel]) + +AC_INIT([iverilog], [VER_MAJOR.VER_MINOR (VER_EXTRA)]) +AC_SUBST([VERSION_MAJOR], [VER_MAJOR]) +AC_SUBST([VERSION_MINOR], [VER_MINOR]) +AC_SUBST([VERSION_EXTRA], [" (VER_EXTRA)"]) +AC_SUBST([VERSION], ["VER_MAJOR.VER_MINOR (VER_EXTRA)"]) + AC_CONFIG_SRCDIR([netlist.h]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([_pli_types.h]) @@ -408,6 +419,7 @@ AC_CONFIG_FILES([ tgt-vhdl/Makefile tgt-vlog95/Makefile tgt-vvp/Makefile + version_base.h vhdlpp/Makefile vpi/Makefile vvp/Makefile diff --git a/driver/Makefile.in b/driver/Makefile.in index 38ab633a9..46caaf609 100644 --- a/driver/Makefile.in +++ b/driver/Makefile.in @@ -96,7 +96,7 @@ cfparse%c cfparse%h: $(srcdir)/cfparse%y $(CC) $(CPPFLAGS) $(CFLAGS) @DEPENDENCY_FLAG@ -c $< -o $*.o mv $*.d dep -main.o: main.c globals.h $(srcdir)/../version_base.h ../version_tag.h Makefile | dep +main.o: main.c globals.h ../version_base.h ../version_tag.h Makefile | dep $(CC) $(CPPFLAGS) $(CFLAGS) @DEPENDENCY_FLAG@ -c -DIVL_ROOT='"@libdir@/ivl$(suffix)"' -DIVL_SUFFIX='"$(suffix)"' -DIVL_INC='"@includedir@"' -DIVL_LIB='"@libdir@"' -DDLLIB='"@DLLIB@"' -DIVL_INCLUDE_INSTALL_DIR="\"$(realpath $(DESTDIR)/$(includedir))\"" $(srcdir)/main.c mv $*.d dep diff --git a/ivlpp/Makefile.in b/ivlpp/Makefile.in index 2fa327d26..7fdd9e2fb 100644 --- a/ivlpp/Makefile.in +++ b/ivlpp/Makefile.in @@ -89,4 +89,4 @@ uninstall: rm -f "$(DESTDIR)$(libdir)/ivl$(suffix)/ivlpp@EXEEXT@" lexor.o: lexor.c globals.h -main.o: main.c globals.h $(srcdir)/../version_base.h ../version_tag.h +main.o: main.c globals.h ../version_base.h ../version_tag.h diff --git a/scripts/CREATE_BRANCH.sh b/scripts/CREATE_BRANCH.sh index e35546072..440ff0800 100644 --- a/scripts/CREATE_BRANCH.sh +++ b/scripts/CREATE_BRANCH.sh @@ -5,10 +5,10 @@ # # 1. It creates a new branch with the proper name. # -# 2. It then updates the version_base.h to match this version. It likely +# 2. It then updates the configure.ac to match this version. It likely # already does, but it is incorrectly marked as devel instead of stable. # -# 3. It updates the default suffix in aclocal.m4 to match the branch. +# 3. It updates the default suffix in m4/ax_enable_suffix.m4 to match the branch. # # Now manually push the new branch to the master repository. # @@ -27,7 +27,8 @@ case $1 in esac major=$1 - +minor=0 +extra="stable" branch="v${major}-branch" branch_exists=`git ls-remote --heads origin $branch` @@ -39,16 +40,17 @@ fi echo "Creating branch $branch" git checkout -b $branch -echo "Updating version_base.h..." -sed -i -E "s/(define\s+VERSION_MAJOR\s+).*/\1$major/" version_base.h -sed -i -E "s/(define\s+VERSION_MINOR\s+).*/\10/" version_base.h -sed -i -E "s/(define\s+VERSION_EXTRA\s+).*/\1\" \(stable\)\"/" version_base.h +file=configure.ac +echo "Updating $file..." +sed -i -E "s/(m4_define\(\[VER_MAJOR\],[[:space:]]*\[)[^]]*(\]\))/\1$major\2/" $file +sed -i -E "s/(m4_define\(\[VER_MINOR\],[[:space:]]*\[)[^]]*(\]\))/\1$minor\2/" $file +sed -i -E "s/(m4_define\(\[VER_EXTRA\],[[:space:]]*\[)[^]]*(\]\))/\1$extra\2/" $file -echo "Updating aclocal.m4..." -sed -i -E "s/(install_suffix='-)dev/\1$major/" aclocal.m4 +echo "Updating m4/ax_enable_suffix.m4..." +sed -i -E "s/(install_suffix='-)dev/\1$major/" m4/ax_enable_suffix.m4 echo "Adding updated files to the new branch..." -git add version_base.h aclocal.m4 +git add configure.ac m4/ax_enable_suffix.m4 git commit -m "Creating new branch $branch" echo "Done" diff --git a/scripts/CREATE_RELEASE.sh b/scripts/CREATE_RELEASE.sh index 9bff3b652..9da7dad02 100644 --- a/scripts/CREATE_RELEASE.sh +++ b/scripts/CREATE_RELEASE.sh @@ -4,10 +4,10 @@ # based on the first and second argument passed to the script, which should # be the desired major and minor numbers for the release. Before creating the # tag, autoconf.sh will be run to create the configure and lexor_keyword.cc -# files, the version_base.h and verilog.spec files will be updated to reflect -# the new release ID and a release_tag.h file will be created in the top level -# directory to provide the VERSION_TAG macro. After creating the tag, the -# configure, lexor_keywords.cc, and release_tag.h files will be deleted. +# files, the verilog.spec file will be updated to reflect the new release ID +# and a release_tag.h file will be created in the top level directory to +# provide the VERSION_TAG macro. After creating the tag, the configure, +# lexor_keywords.cc, and release_tag.h files will be deleted. # # The complete steps to publish a release are: # @@ -44,6 +44,13 @@ if [ -n "$tag_exists" ] ; then exit 1 fi +extra="stable" +file=configure.ac +echo "Updating $file..." +sed -i -E "s/(m4_define\(\[VER_MAJOR\],[[:space:]]*\[)[^]]*(\]\))/\1$major\2/" $file +sed -i -E "s/(m4_define\(\[VER_MINOR\],[[:space:]]*\[)[^]]*(\]\))/\1$minor\2/" $file +sed -i -E "s/(m4_define\(\[VER_EXTRA\],[[:space:]]*\[)[^]]*(\]\))/\1$extra\2/" $file + echo "Executing autoconf.sh..." sh autoconf.sh if [ $? -ne 0 ] ; then @@ -51,11 +58,6 @@ if [ $? -ne 0 ] ; then exit 1 fi -echo "Updating version_base.h..." -sed -i -E "s/(define\s+VERSION_MAJOR\s+).*/\1$major/" version_base.h -sed -i -E "s/(define\s+VERSION_MINOR\s+).*/\1$minor/" version_base.h -sed -i -E "s/(define\s+VERSION_EXTRA\s+).*/\1\" \(stable\)\"/" version_base.h - echo "Updating verilog.spec..." sed -i -E "s/(define\s+major\s+).*/\1$major/" verilog.spec sed -i -E "s/(define\s+minor\s+).*/\1$minor/" verilog.spec @@ -66,7 +68,7 @@ echo "#define VERSION_TAG \"$tag\"" > release_tag.h echo "Adding files and creating the tag..." git add -f configure lexor_keyword.cc vhdlpp/lexor_keyword.cc -git add version_base.h verilog.spec release_tag.h +git add configure.ac verilog.spec release_tag.h git commit -m "Creating release $tag" git tag -a -m "Release $major.$minor" $tag diff --git a/scripts/CREATE_VERSION.sh b/scripts/CREATE_VERSION.sh index 450f21370..8cecaba62 100644 --- a/scripts/CREATE_VERSION.sh +++ b/scripts/CREATE_VERSION.sh @@ -1,6 +1,6 @@ #!/bin/sh -# This script manually creates a version.h file. +# This script manually creates a version_tag.h file. # # It is used when creating a MinGW executable from a Cygwin # hosted git repository. It assumes that git is available. diff --git a/version_base.h b/version_base.h.in similarity index 52% rename from version_base.h rename to version_base.h.in index 46b0e93eb..750e8c02e 100644 --- a/version_base.h +++ b/version_base.h.in @@ -1,16 +1,17 @@ #ifndef VERSION /* - * Edit this definition in version_base.in to define the base version - * number for the compiled result. + * This file is generated from version_base.h.in by the build system + * + * WARNING! All changes made in this file will be lost when recompiling! */ -# define VERSION_MAJOR 14 -# define VERSION_MINOR 0 +#define VERSION_MAJOR @VERSION_MAJOR@ +#define VERSION_MINOR @VERSION_MINOR@ /* * This will be appended to the version. Use this to mark development * versions and the like. */ -# define VERSION_EXTRA " (devel)" +# define VERSION_EXTRA "@VERSION_EXTRA@" # define VERSION_STRINGIFY(x) #x # define VERSION_STR(a,b,extra) VERSION_STRINGIFY(a.b) extra