aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGavin Howard <yzena.tech@gmail.com>2021-04-04 16:27:05 -0600
committerGavin Howard <yzena.tech@gmail.com>2021-04-04 16:27:05 -0600
commitfd3dee2bb6b5422015ec04b20b7beba70cbd0fe8 (patch)
treeeca7131e574c84d8bb28b2f2c97b965b4bbe42a9
parent34ca7b50d1c0111a95a6bb803c105a4ddb287140 (diff)
downloadbc-fd3dee2bb6b5422015ec04b20b7beba70cbd0fe8.tar.gz
Move the version location
This is in preparation for upcoming commits.
-rw-r--r--Makefile.in7
-rw-r--r--include/version.h41
-rw-r--r--include/vm.h1
-rwxr-xr-xrelease.sh4
-rw-r--r--src/main.c1
5 files changed, 45 insertions, 9 deletions
diff --git a/Makefile.in b/Makefile.in
index b0a2e2e2..f453e93d 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -29,8 +29,6 @@
#
.POSIX:
-VERSION = 3.3.4
-
SRC = %%SRC%%
OBJ = %%OBJ%%
GCDA = %%GCDA%%
@@ -158,7 +156,7 @@ TEST_STARS = "******************************************************************
BC_NUM_KARATSUBA_LEN = %%KARATSUBA_LEN%%
CPPFLAGS1 = -D$(BC_ENABLED_NAME)=$(BC_ENABLED) -D$(DC_ENABLED_NAME)=$(DC_ENABLED)
-CPPFLAGS2 = $(CPPFLAGS1) -I./include/ -DVERSION=$(VERSION) %%LONG_BIT_DEFINE%%
+CPPFLAGS2 = $(CPPFLAGS1) -I./include/ %%LONG_BIT_DEFINE%%
CPPFLAGS3 = $(CPPFLAGS2) -DEXECPREFIX=$(EXEC_PREFIX) -DMAINEXEC=$(MAIN_EXEC)
CPPFLAGS4 = $(CPPFLAGS3) -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700
CPPFLAGS5 = $(CPPFLAGS4) -DBC_NUM_KARATSUBA_LEN=$(BC_NUM_KARATSUBA_LEN)
@@ -322,9 +320,6 @@ coverage_output:
coverage:%%COVERAGE_PREREQS%%
-version:
- @printf '%s' "$(VERSION)"
-
libcname:
@printf '%s' "$(BC_LIB_C)"
diff --git a/include/version.h b/include/version.h
new file mode 100644
index 00000000..cb35c781
--- /dev/null
+++ b/include/version.h
@@ -0,0 +1,41 @@
+/*
+ * *****************************************************************************
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2018-2021 Gavin D. Howard and contributors.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * *****************************************************************************
+ *
+ * Definitions for processing command-line arguments.
+ *
+ */
+
+#ifndef BC_VERSION_H
+#define BC_VERSION_H
+
+#define VERSION 3.4.0
+
+#endif // BC_VERSION_H \ No newline at end of file
diff --git a/include/vm.h b/include/vm.h
index 8a949c3d..30938493 100644
--- a/include/vm.h
+++ b/include/vm.h
@@ -52,6 +52,7 @@
#endif // BC_ENABLE_NLS
+#include <version.h>
#include <status.h>
#include <num.h>
#include <parse.h>
diff --git a/release.sh b/release.sh
index 902f26ef..6b8e59af 100755
--- a/release.sh
+++ b/release.sh
@@ -523,8 +523,6 @@ header "Running math library under --standard"
printf 'quit\n' | bin/bc -ls
-version=$(make version)
-
do_make clean_tests
if [ "$test_with_clang" -ne 0 ]; then
@@ -573,7 +571,7 @@ if [ "$run_tests" -ne 0 ]; then
printf '\n'
printf 'Then run the GitHub release script as follows:\n'
printf '\n'
- printf ' <github_release> %s release.sh RELEASE.md\\\n' "$version"
+ printf ' <github_release> <version> release.sh RELEASE.md\\\n'
printf ' tests/afl.py tests/radamsa.sh tests/radamsa.txt tests/randmath.py \\\n'
printf ' tests/fuzzing/ tests/bc/scripts/timeconst.bc\n'
diff --git a/src/main.c b/src/main.c
index 84a48ff7..17adc952 100644
--- a/src/main.c
+++ b/src/main.c
@@ -42,6 +42,7 @@
#include <setjmp.h>
+#include <version.h>
#include <status.h>
#include <vm.h>
#include <bc.h>