summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--etc/build.usage25
-rw-r--r--subr/pkg_setup_distclean.subr12
-rw-r--r--subr/pkg_setup_env.subr2
-rw-r--r--subr/pkg_setup_subdirs.subr10
-rw-r--r--vars/env.vars3
5 files changed, 38 insertions, 14 deletions
diff --git a/etc/build.usage b/etc/build.usage
index 6993ed72..c68dc4c2 100644
--- a/etc/build.usage
+++ b/etc/build.usage
@@ -9,18 +9,21 @@ usage: ./build.sh [-x] [-4|6] [-a nt32|nt64] [-b debug|release] [-c] [-h]
-h Show this screen.
-i Ignore SHA256 hash mismatches when downloading files.
-N Offline mode: no {wget,git-{clone,pull}}(1) calls.
- -r package[,...][:step] Restart the specified comma-separated build(s) completely or at
- the optionally specified step. Currently defined steps are:
- fetch_wget, fetch_git, fetch_extract, configure_patch_pre,
- configure_autotools, configure_patch, configure, build_clean,
- build, install_subdirs, install_make, install_files, install_libs,
- install_pkgconfig, install_purge_la, install_strip, and install.
+ -r package[,...][:step] Restart the specified comma-separated build(s) completely
+ or at the optionally specified step. Currently defined
+ steps are:
+ setup_distclean, fetch_wget, fetch_git, fetch_extract,
+ configure_patch_pre, configure_autotools, configure_patch,
+ configure, build_clean, build, install_subdirs, install_make,
+ install_files, install_libs, install_pkgconfig, install_purge_la,
+ install_strip, and install.
-R Ignore build failures and continue building (relaxed mode.)
- -t[.gz|.bz2|.xz] Produce binary distribution and source tarballs containing ${PREFIX}
- sans ${WORKDIR} and ${PREFIX}/src/midipix_build and ${WORKDIR} sans top-
- level regular files at the end of a build with zero failures. The
- tarballs will be compressed with either gzip, bzip2, or xz and signed
- with GPG; the default compression is xz.
+ -t[.gz|.bz2|.xz] Produce binary distribution and source tarballs containing
+ ${PREFIX} sans ${WORKDIR} and ${PREFIX}/src/midipix_build
+ and ${WORKDIR} sans top-level regular files at the end of
+ a build with zero failures. The tarballs will be compressed
+ with either gzip, bzip2, or xz and signed with GPG; the
+ default compression is xz.
-v Be verbose.
--debug-minipix Don't strip(1) minipix binaries to facilitate debugging minipix.
<target>[ ...] One of:
diff --git a/subr/pkg_setup_distclean.subr b/subr/pkg_setup_distclean.subr
new file mode 100644
index 00000000..fc5999c8
--- /dev/null
+++ b/subr/pkg_setup_distclean.subr
@@ -0,0 +1,12 @@
+#
+# set -o errexit -o noglob are assumed.
+#
+
+pkg_setup_distclean() {
+ if [ "$(stat -c %i "${PKG_BASE_DIR}")" \
+ != "$(stat -c %i "${WORKDIR}")" ]; then
+ build_fileop rm "${PKG_BASE_DIR}";
+ fi;
+};
+
+# vim:filetype=sh
diff --git a/subr/pkg_setup_env.subr b/subr/pkg_setup_env.subr
index a02b1a60..f6d6118a 100644
--- a/subr/pkg_setup_env.subr
+++ b/subr/pkg_setup_env.subr
@@ -53,8 +53,6 @@ pkg_setup_env() {
PKG_ENV_VARS="$(echo "${PKG_ENV_VARS}" | tr " " "\n" | sort | tr "\n" " ")";
log_env_vars "build" ${PKG_ENV_VARS};
fi;
- build_fileop mkdir "${PKG_BASE_DIR}";
- build_fileop cd "${PKG_BASE_DIR}";
};
# vim:filetype=sh
diff --git a/subr/pkg_setup_subdirs.subr b/subr/pkg_setup_subdirs.subr
new file mode 100644
index 00000000..1fc279cb
--- /dev/null
+++ b/subr/pkg_setup_subdirs.subr
@@ -0,0 +1,10 @@
+#
+# set -o errexit -o noglob are assumed.
+#
+
+pkg_setup_subdirs() {
+ build_fileop mkdir "${PKG_BASE_DIR}";
+ build_fileop cd "${PKG_BASE_DIR}";
+};
+
+# vim:filetype=sh
diff --git a/vars/env.vars b/vars/env.vars
index afbff055..6f184cc4 100644
--- a/vars/env.vars
+++ b/vars/env.vars
@@ -16,7 +16,8 @@
: ${PREFIX_CROSS:=${PREFIX}/${TARGET}};
: ${DLCACHEDIR:=${PREFIX_ROOT}/dlcache};
: ${WORKDIR:=${PREFIX}/tmp};
-: ${BUILD_STEPS:="setup_vars:invariant setup_env:invariant all:all
+: ${BUILD_STEPS:="setup_vars:invariant setup_env:invariant setup_distclean:variant setup_subdirs:invariant
+ all:all
fetch_wget:dynamic fetch_git:dynamic fetch_extract:dynamic fetch_subdirs:invariant fetch:virtual
configure_patch_pre:dynamic configure_autotools:dynamic configure_patch:dynamic configure:dynamic
build_clean:variant build:dynamic