SINEWARE_DEVELOPMENT ?= false BUILD_CONTAINER ?= true ifeq ($(SINEWARE_DEVELOPMENT),true) DOCKER_DEVELOPMENT_FLAGS ?= -i -t else DOCKER_DEVELOPMENT_FLAGS ?= -i endif all: SINEWARE_ARCH=x86_64 all: PROLINUX_ARCH=x86_64 all: deps setup_build build_container build_prolinuxd build_archlinux system_rootfs kernel initramfs build_variant_server sineware_img @echo "Sineware ProLinux Server Build Complete!" @date all_phone: SINEWARE_ARCH=aarch64 # legacy all_phone: PROLINUX_ARCH=aarch64 all_phone: deps setup_build build_prolinuxd build_container build_archlinux system_rootfs initramfs build_variant_phone @echo "Sineware ProLinux Phone OS Build Complete!" @date build_pmsdk: SINEWARE_ARCH=x86_64 build_pmsdk: PROLINUX_ARCH=x86_64 build_pmsdk: PROLINUX_MOBILE_TARGET=tar build_pmsdk: deps setup_build build_prolinuxd build_container build_archlinux system_rootfs build_variant_phone @echo "Building PMSDK Container..." @date # cd ./tools/pmsdk; ./build.sh # make folders if they are not already there # clean out existing folders. clean: mkdir -pv artifacts mkdir -pv buildmeta sudo rm -rf artifacts/* mkdir -pv artifacts/aarch64 mkdir -pv artifacts/x86_64 deps: @echo "Installing dependencies..." cd ./tools/setup-build; npm i cd ./tools/update-deployer; npm i # sudo is a hack? this core dumps in jenkins without it. setup_build: @echo "Running the build setup script..." sudo node ./tools/setup-build/index.js enable_multiarch: @echo "Enabling multiarch build support via qemu-user..." sudo docker run --rm --privileged multiarch/qemu-user-static --reset -p yes build_container: ifeq ($(BUILD_CONTAINER),true) @echo "Building the Docker build container" sudo docker build . -t sineware-build else @echo "Skipping building the Docker build container." endif build_prolinuxd: @echo "Building ProLinuxd Java..." cd prolinuxd && ./build.sh build_archlinux: @echo "Starting Arch Linux Build..." sudo docker run $(DOCKER_DEVELOPMENT_FLAGS) -v "$(CURDIR)"/archlinux-rootfs:/build-scripts -v "$(CURDIR)"/artifacts:/artifacts \ -v "$(CURDIR)"/buildmeta:/buildmeta \ -v /dev:/dev \ -e PROLINUX_ARCH=${PROLINUX_ARCH} \ --privileged --rm --env SINEWARE_DEVELOPMENT=${SINEWARE_DEVELOPMENT} sineware-build system_rootfs: test -s ./buildmeta/buildconfig.sh || { echo "Error: The buildmeta/buildconfig.sh file does not exist! Did the setup-build script run?"; exit 1; } test -s ./buildmeta/buildconfig.sh || { echo "Error: The artifacts/sineware-buildroot.tar.gz file does not exist! Did make build_archlinux run?"; exit 1; } sudo docker run $(DOCKER_DEVELOPMENT_FLAGS) -v "$(CURDIR)"/build-scripts:/build-scripts -v "$(CURDIR)"/artifacts:/artifacts \ -v "$(CURDIR)"/buildmeta:/buildmeta \ -v /dev:/dev \ -e PROLINUX_ARCH=${PROLINUX_ARCH} \ --privileged --rm sineware-build sineware_img: test -s ./buildmeta/buildconfig.sh || { echo "Error: The buildmeta/buildconfig.sh file does not exist! Did the setup-build script run?"; exit 1; } test -s ./artifacts/sineware.tar.gz || { echo "Error: The buildmeta/sineware.tar.gz file does not exist! Did make system_rootfs run?"; exit 1; } test -s ./artifacts/bzImage || { echo "Error: The buildmeta/bzImage file does not exist! Did make kernel run?"; exit 1; } test -s ./artifacts/sineware-initramfs.cpio.gz || { echo "Error: The buildmeta/sineware-initramfs.cpio.gz file does not exist! Did make initramfs run?"; exit 1; } test -s ./artifacts/prolinux-server.squashfs.img || { echo "Error: The buildmeta/prolinux-server.squashfs.img file does not exist! Did make build_variant_server run?"; exit 1; } sudo docker run $(DOCKER_DEVELOPMENT_FLAGS) -v "$(CURDIR)"/iso-build-scripts:/build-scripts --rm \ -v "$(CURDIR)"/artifacts:/artifacts \ -v "$(CURDIR)"/buildmeta:/buildmeta \ -v /dev:/dev \ --privileged \ sineware-build kernel: sudo docker run $(DOCKER_DEVELOPMENT_FLAGS) \ -v "$(CURDIR)"/kernel-gen:/build-scripts \ -v "$(CURDIR)"/artifacts:/artifacts \ -v "$(CURDIR)"/buildmeta:/buildmeta \ -v /dev:/dev --privileged --rm --env SINEWARE_DEVELOPMENT=${SINEWARE_DEVELOPMENT} sineware-build initramfs: sudo docker run $(DOCKER_DEVELOPMENT_FLAGS) \ -v "$(CURDIR)"/initramfs-gen:/build-scripts \ -v "$(CURDIR)"/artifacts:/artifacts \ -v "$(CURDIR)"/buildmeta:/buildmeta \ -v /dev:/dev \ -e PROLINUX_ARCH=${PROLINUX_ARCH} \ --privileged --rm --env SINEWARE_DEVELOPMENT=${SINEWARE_DEVELOPMENT} sineware-build sineware_container: cp ./artifacts/sineware.tar.gz ./os-variants/container/ cd ./os-variants/container; sudo docker build . -t sineware rm -rf ./os-variants/container/sineware.tar.gz deploy_update: @echo "Running the update deployer script..." source ./buildmeta/buildconfig.sh && node ./tools/update-deployer/index.js # OS Variants build_variant_server: test -s ./buildmeta/buildconfig.sh || { echo "Error: The buildmeta/buildconfig.sh file does not exist! Did the setup-build script run?"; exit 1; } test -s ./artifacts/sineware.tar.gz || { echo "Error: The artifacts/sineware.tar.gz file does not exist! Did make system_rootfs run?"; exit 1; } test -s ./artifacts/bzImage || { echo "Error: The buildmeta/bzImage file does not exist! Did make kernel run?"; exit 1; } test -s ./artifacts/sineware-initramfs.cpio.gz || { echo "Error: The buildmeta/sineware-initramfs.cpio.gz file does not exist! Did make initramfs run?"; exit 1; } sudo docker run $(DOCKER_DEVELOPMENT_FLAGS) -v "$(CURDIR)"/os-variants/server:/build-scripts -v "$(CURDIR)"/artifacts:/artifacts \ -v "$(CURDIR)"/buildmeta:/buildmeta \ -v /dev:/dev --privileged --rm --env SINEWARE_DEVELOPMENT=${SINEWARE_DEVELOPMENT} sineware-build build_variant_phone: test -s ./buildmeta/buildconfig.sh || { echo "Error: The buildmeta/buildconfig.sh file does not exist! Did the setup-build script run?"; exit 1; } #test -s ./artifacts/aarch64/sineware.tar.gz || { echo "Error: The artifacts/sineware.tar.gz file does not exist! Did make system_rootfs run?"; exit 1; } #test -s ./artifacts/aarch64/sineware-initramfs.cpio.gz || { echo "Error: The buildmeta/sineware-initramfs.cpio.gz file does not exist! Did make initramfs run?"; exit 1; } sudo docker run $(DOCKER_DEVELOPMENT_FLAGS) -v "$(CURDIR)"/os-variants/phone:/build-scripts -v "$(CURDIR)"/artifacts:/artifacts \ -v "$(CURDIR)"/buildmeta:/buildmeta \ -e PROLINUX_MOBILE_TARGET=${PROLINUX_MOBILE_TARGET} \ -e PROLINUX_ARCH=${PROLINUX_ARCH} \ -v /dev:/dev --privileged --rm --env SINEWARE_DEVELOPMENT=${SINEWARE_DEVELOPMENT} sineware-build