2023-02-18 06:46:01 +00:00
|
|
|
.EXPORT_ALL_VARIABLES:
|
|
|
|
.DEFAULT_GOAL := all
|
|
|
|
SHELL := /bin/bash
|
|
|
|
|
|
|
|
# circular dependency loading
|
|
|
|
ifndef project_root
|
|
|
|
|
|
|
|
%:
|
|
|
|
. ./project_config.sh $(MAKE) $@
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
|
2023-02-26 20:36:36 +00:00
|
|
|
clean_unsafe:
|
|
|
|
set -e
|
2023-02-19 03:19:08 +00:00
|
|
|
sudo /usr/bin/env -i bash -c ". ./project_config.sh && ${dir_make}/clean.sh"
|
2023-02-19 01:55:42 +00:00
|
|
|
|
2023-02-26 20:36:36 +00:00
|
|
|
clean:
|
|
|
|
set -e
|
|
|
|
make disarm_chroot
|
|
|
|
make clean_unsafe
|
|
|
|
|
2023-02-21 00:03:11 +00:00
|
|
|
# same as clean, but retain logs
|
2023-02-19 03:19:08 +00:00
|
|
|
purge_artifacts:
|
2023-02-26 20:36:36 +00:00
|
|
|
set -e
|
2023-02-19 03:19:08 +00:00
|
|
|
${dir_make}/purge_artifacts.sh
|
2023-02-18 06:46:01 +00:00
|
|
|
|
2023-02-21 00:03:11 +00:00
|
|
|
|
|
|
|
# these need run in the following order:
|
2023-02-19 01:02:03 +00:00
|
|
|
dirs:
|
2023-02-26 20:36:36 +00:00
|
|
|
set -e
|
2023-02-19 01:02:03 +00:00
|
|
|
${dir_make}/dirs.sh
|
2023-02-18 06:46:01 +00:00
|
|
|
|
2023-02-19 01:35:25 +00:00
|
|
|
# installs the latest version of rex from master branch
|
|
|
|
# will later be tied to a release tag
|
2023-02-19 01:02:03 +00:00
|
|
|
install_rex:
|
2023-02-26 20:36:36 +00:00
|
|
|
set -e
|
2023-02-19 01:02:03 +00:00
|
|
|
${dir_make}/install_rex.sh
|
2023-02-18 06:46:01 +00:00
|
|
|
|
2023-02-19 01:35:25 +00:00
|
|
|
# installs the versions designed for this run
|
2023-02-19 01:02:03 +00:00
|
|
|
download_sources:
|
2023-02-26 20:36:36 +00:00
|
|
|
set -e
|
2023-02-19 01:02:03 +00:00
|
|
|
${dir_make}/download_sources.sh
|
2023-02-18 06:46:01 +00:00
|
|
|
|
2023-02-19 01:35:25 +00:00
|
|
|
# ""
|
|
|
|
download_patches:
|
2023-02-26 20:36:36 +00:00
|
|
|
set -e
|
2023-02-19 01:35:25 +00:00
|
|
|
${dir_make}/download_patches.sh
|
|
|
|
|
|
|
|
# kicks off rex
|
2023-02-19 01:02:03 +00:00
|
|
|
build_stage1:
|
2023-02-26 20:36:36 +00:00
|
|
|
set -e
|
2023-02-19 01:02:03 +00:00
|
|
|
sudo /usr/bin/env -i bash -c ". ./project_config.sh && ${dir_make}/build_stage1.sh"
|
2023-02-18 06:46:01 +00:00
|
|
|
|
2023-02-19 22:25:49 +00:00
|
|
|
# kicks off rex
|
|
|
|
build_stage2:
|
2023-02-26 20:36:36 +00:00
|
|
|
set -e
|
2023-02-19 22:25:49 +00:00
|
|
|
sudo /usr/bin/env -i bash -c ". ./project_config.sh && ${dir_make}/build_stage2.sh"
|
|
|
|
|
2023-02-20 23:53:44 +00:00
|
|
|
arm_chroot:
|
2023-02-26 20:36:36 +00:00
|
|
|
set -e
|
2023-02-20 23:53:44 +00:00
|
|
|
sudo /usr/bin/env -i bash -c ". ./project_config.sh && ${dir_make}/arm_chroot.sh"
|
|
|
|
|
|
|
|
disarm_chroot:
|
2023-02-26 20:36:36 +00:00
|
|
|
set -e
|
2023-02-20 23:53:44 +00:00
|
|
|
sudo /usr/bin/env -i bash -c ". ./project_config.sh && ${dir_make}/disarm_chroot.sh"
|
|
|
|
|
2023-02-21 00:03:11 +00:00
|
|
|
# do not enter the chroot like this unless you have run arm_chroot.
|
|
|
|
# build_stage2 does this automatically.
|
2023-02-20 23:53:44 +00:00
|
|
|
enter_chroot:
|
2023-02-26 20:36:36 +00:00
|
|
|
set -e
|
2023-02-20 23:53:44 +00:00
|
|
|
sudo /usr/bin/env -i bash -c ". ./project_config.sh && ${dir_make}/enter_chroot.sh"
|
|
|
|
|
2023-02-25 20:50:02 +00:00
|
|
|
#embeds and kicks off rex from inside chroot
|
2023-02-21 00:03:11 +00:00
|
|
|
build_stage3:
|
2023-02-26 20:36:36 +00:00
|
|
|
set -e
|
2023-02-21 00:03:11 +00:00
|
|
|
sudo /usr/bin/env -i bash -c ". ./project_config.sh && ${dir_make}/build_stage3.sh"
|
2023-02-20 23:53:44 +00:00
|
|
|
|
2023-02-25 20:50:02 +00:00
|
|
|
# offers to back up
|
|
|
|
build_stage4backup:
|
2023-02-26 20:36:36 +00:00
|
|
|
set -e
|
2023-02-25 20:50:02 +00:00
|
|
|
sudo /usr/bin/env -i bash -c ". ./project_config.sh && ${dir_make}/build_stage4backup.sh"
|
|
|
|
|
|
|
|
build_stage4:
|
2023-02-26 20:36:36 +00:00
|
|
|
set -e
|
2023-02-25 20:50:02 +00:00
|
|
|
sudo /usr/bin/env -i bash -c ". ./project_config.sh && ${dir_make}/build_stage4.sh"
|
|
|
|
|
|
|
|
|
2023-02-19 01:35:25 +00:00
|
|
|
# example:
|
2023-02-25 20:50:02 +00:00
|
|
|
# make dirs
|
|
|
|
# make install_rex
|
|
|
|
# make download_sources
|
|
|
|
# make download_patches
|
|
|
|
# make build_stage1
|
|
|
|
# make build_stage2
|
|
|
|
# optional: make enter_chroot
|
|
|
|
# make build_stage3
|
|
|
|
# optional: make build_stage4backup
|
|
|
|
# make build_stage4
|
|
|
|
|
2023-02-26 20:36:36 +00:00
|
|
|
.ONESHELL:
|
|
|
|
all:
|
|
|
|
set -e; \
|
|
|
|
make disarm_chroot && \
|
|
|
|
make clean && \
|
|
|
|
make dirs && \
|
|
|
|
make install_rex && \
|
|
|
|
make download_patches && \
|
|
|
|
make download_sources && \
|
|
|
|
make build_stage1 && \
|
|
|
|
make build_stage2 && \
|
|
|
|
make build_stage3 && \
|
|
|
|
make build_stage4backup && \
|
|
|
|
make build_stage4
|
|
|
|
|
2023-02-21 05:02:49 +00:00
|
|
|
|
2023-02-20 23:53:44 +00:00
|
|
|
# Remember, before you make clean or make purge_artifacts you MUST run
|
|
|
|
# make disarm_chroot beforehand or you could cause irreversible damage
|
|
|
|
# to your system. It is recommended that these operations only be
|
|
|
|
# performed on a VM, and the host distribution is only tested on Fedora.
|
2023-02-18 06:46:01 +00:00
|
|
|
|
2023-02-19 01:02:03 +00:00
|
|
|
# end dependency loading block
|
2023-02-18 06:46:01 +00:00
|
|
|
endif
|