summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--etc/build.usage1
-rw-r--r--subr/build_args.subr1
-rw-r--r--subr/build_checks.subr6
-rw-r--r--vars/build.vars2
-rw-r--r--vars/dist_gitref.vars9
5 files changed, 18 insertions, 1 deletions
diff --git a/etc/build.usage b/etc/build.usage
index c9a0466f..d5bbd506 100644
--- a/etc/build.usage
+++ b/etc/build.usage
@@ -36,6 +36,7 @@ usage: ./build.sh [-4|6] [-a nt32|nt64] [-b debug|release]
default compression is xz.
-v[v[v]] Be verbose; -vv: always print package logs; -vvv: logs fileops.
-x Set xtrace during package builds; implies -vv.
+ --as-needed Don't build unless the midipix_build repository has received new commits.
--debug-minipix Don't strip(1) minipix binaries to facilitate debugging minipix.
<target>[ ..] One of:
host or host_tools, host_toolchain_deps, host_toolchain, host_toolchain_mingw32,
diff --git a/subr/build_args.subr b/subr/build_args.subr
index 0a3390c6..ea6eabf7 100644
--- a/subr/build_args.subr
+++ b/subr/build_args.subr
@@ -9,6 +9,7 @@ BUILD_ARGS_SPEC="
BUILD:arg:-b:
ARG_CLEAN:-c:
ARG_CLEAN_BUILDS:arg:-C:
+ ARG_AS_NEEDED:--as-needed:
ARG_DEBUG_MINIPIX:--debug-minipix:
ARG_OFFLINE:-N:
ARG_PACKAGE:-p:
diff --git a/subr/build_checks.subr b/subr/build_checks.subr
index 055ed870..5abeab20 100644
--- a/subr/build_checks.subr
+++ b/subr/build_checks.subr
@@ -33,6 +33,12 @@ build_checks() {
if [ ${_exit:-0} = 1 ]; then
exit 1;
fi;
+ if [ "${ARG_AS_NEEDED:-0}" -eq 1 ]\
+ && [ -e "${PREFIX}/build.gitref" ]\
+ && [ "$(git rev-parse HEAD)" = "$(cat "${PREFIX}/build.gitref")" ]; then
+ ex_rtl_log_msg info "Git repository has not changed since last build and --as-needed was specified.";
+ exit 0;
+ fi;
if [ ${ARG_CLEAN:-0} -eq 1 ]; then
ex_rtl_log_msg info "-c specified, cleaning prefix...";
for _pname in ${DEFAULT_CLEAR_PREFIX_PATHS}; do
diff --git a/vars/build.vars b/vars/build.vars
index e64a597a..2f1ad5a8 100644
--- a/vars/build.vars
+++ b/vars/build.vars
@@ -1204,7 +1204,7 @@ DIST_MINIPIX_PREFIX="${PREFIX}/minipix_dist";
# Build target dist_target
#
DIST_TARGET_NO_LOG_VARS=1;
-DIST_TARGET_PACKAGES="dist_minipix_dist dist_etc dist_digest dist_tarballs";
+DIST_TARGET_PACKAGES="dist_minipix_dist dist_etc dist_digest dist_gitref dist_tarballs";
#
# Build targets
diff --git a/vars/dist_gitref.vars b/vars/dist_gitref.vars
new file mode 100644
index 00000000..eff4912b
--- /dev/null
+++ b/vars/dist_gitref.vars
@@ -0,0 +1,9 @@
+#
+# set -o errexit -o noglob are assumed.
+#
+
+pkg_dist_gitref_all() {
+ git -C "${MIDIPIX_BUILD_PWD}" rev-parse HEAD > "${PREFIX}/build.gitref";
+};
+
+# vim:filetype=sh