buildbrain/Makefile

176 lines
3.6 KiB
Makefile
Raw Permalink Normal View History

JOBS=$(shell grep -c '^processor' /proc/cpuinfo)
2021-03-06 20:19:11 +09:00
UBOOT_CROSS=$(shell ./tools/getcross u-boot)
LINUX_CROSS=$(shell ./tools/getcross linux)
ROOTFS_CROSS=$(shell ./tools/getcross rootfs)
2020-09-28 00:49:26 +09:00
export ARCH=arm
.PHONY:
setup:
@echo "Updating submodules"
@git submodule update --init --recursive
2020-10-18 13:52:20 +09:00
.PHONY:
setup-dev:
2020-09-28 00:49:26 +09:00
@echo "Creating venv"
@python3 -m venv env
@echo "Installing r3build"
@. ./env/bin/activate; \
2020-10-18 13:52:20 +09:00
pip install wheel; \
2020-09-28 00:49:26 +09:00
pip install r3build
.PHONY:
watch:
@echo "Watching changes in linux-brain and u-boot-brain"
@. ./env/bin/activate; \
@python3 -m r3build
.PHONY:
udefconfig:
2020-10-26 04:19:44 +09:00
make -C ./u-boot-brain pwsh1_defconfig
2020-09-28 00:49:26 +09:00
.PHONY:
udefconfig-%:
make -C ./u-boot-brain pw$*_defconfig
2020-10-12 06:09:17 +09:00
.PHONY:
usavedefconfig:
2021-03-06 20:19:11 +09:00
make CROSS_COMPILE=$(UBOOT_CROSS) -C ./u-boot-brain savedefconfig
2020-10-12 06:09:17 +09:00
2020-09-28 00:49:26 +09:00
.PHONY:
umenuconfig:
2021-03-06 20:19:11 +09:00
make CROSS_COMPILE=$(UBOOT_CROSS) -C ./u-boot-brain menuconfig
2020-09-28 00:49:26 +09:00
2020-10-26 04:19:51 +09:00
.PHONY:
uclean:
make -C ./u-boot-brain distclean
2020-09-28 00:49:26 +09:00
.PHONY:
ubuild:
2021-03-06 20:19:11 +09:00
if [ "$(UBOOT_CROSS)" = "arm-linux-gnueabi-" ]; then \
make CROSS_COMPILE=$(UBOOT_CROSS) -j$(JOBS) -C ./u-boot-brain u-boot.sb; \
else \
make CROSS_COMPILE=$(UBOOT_CROSS) -j$(JOBS) -C ./u-boot-brain u-boot.imx; \
fi
2020-09-28 00:49:26 +09:00
.PHONY:
ldefconfig:
make -C ./linux-brain brain_defconfig
2020-09-28 00:49:26 +09:00
2021-03-06 20:19:11 +09:00
.PHONY:
ldefconfig-x1:
make -C ./linux-brain imx_v7_defconfig
2020-09-28 00:49:26 +09:00
.PHONY:
lmenuconfig:
2021-03-06 20:19:11 +09:00
make CROSS_COMPILE=$(LINUX_CROSS) -C ./linux-brain menuconfig
2020-09-28 00:49:26 +09:00
.PHONY:
lsavedefconfig:
2021-03-06 20:19:11 +09:00
make CROSS_COMPILE=$(LINUX_CROSS) -C ./linux-brain savedefconfig
mv ./linux-brain/defconfig ./linux-brain/arch/arm/configs/brain_defconfig
2020-09-28 00:49:26 +09:00
2021-03-06 20:19:11 +09:00
.PHONY:
lsavedefconfig-x1:
make CROSS_COMPILE=$(LINUX_CROSS) -C ./linux-brain savedefconfig
mv ./linux-brain/defconfig ./linux-brain/arch/arm/configs/imx_v7_defconfig
2020-11-24 03:13:28 +09:00
.PHONY:
lclean:
make -C ./linux-brain distclean
2020-09-28 00:49:26 +09:00
.PHONY:
lbuild:
2021-03-06 20:19:11 +09:00
make CROSS_COMPILE=$(LINUX_CROSS) -j$(JOBS) -C ./linux-brain
2020-09-28 00:49:26 +09:00
2021-04-21 03:27:29 +09:00
.PHONY:
ldebpkg:
$(MAKE) ldebpkg-build || $(MAKE) ldebpkg-clean
mkdir -p debian
mv linux-*.buildinfo debian/
mv linux-*.changes debian/
mv linux-*.diff.gz debian/
mv linux-*.dsc debian/
mv linux-*.orig.tar.gz debian/
mv linux-*.deb debian/
.PHONY:
ldebpkg-build:
make -j$(JOBS) -C ./linux-brain deb-pkg
.PHONY:
ldebpkg-clean:
rm -f linux-*.buildinfo
rm -f linux-*.changes
rm -f linux-*.diff.gz
rm -f linux-*.dsc
rm -f linux-*.orig.tar.gz
rm -f linux-*.deb
2020-09-28 00:49:26 +09:00
.PHONY:
uuu:
sudo uuu ./u-boot-brain/u-boot.sb
2020-10-18 15:27:28 +09:00
.PHONY:
nkbin-maker:
2020-10-18 15:27:28 +09:00
make -C ./nkbin_maker
.PHONY:
nk.bin:
2020-10-18 15:27:28 +09:00
./nkbin_maker/bsd-ce ./u-boot-brain/u-boot.bin
2021-03-06 20:19:11 +09:00
.PHONY:
boot4ubuild:
make -C ./boot4u
.PHONY:
boot4uclean:
make -C ./boot4u clean
.PHONY:
lilobuild:
make -C ./brainlilo
.PHONY:
liloclean:
make -C ./brainlilo clean
2021-02-20 04:29:49 +09:00
brainux:
2020-10-27 19:53:25 +09:00
@if [ "$(shell uname)" != "Linux" ]; then \
echo "Debootstrap is only available in Linux!"; \
exit 1; \
fi
sudo mkdir -p brainux
2021-02-20 04:29:49 +09:00
@if [ "$(CI)" = "true" ]; then \
echo "I'm in CI and debootstrap without cache."; \
2021-03-06 20:19:11 +09:00
sudo debootstrap --arch=$(ROOTFS_CROSS) --foreign buster brainux/; \
2021-02-20 04:29:49 +09:00
else \
2021-03-06 20:19:11 +09:00
sudo debootstrap --arch=$(ROOTFS_CROSS) --foreign buster brainux/ http://localhost:65432/debian/; \
2021-02-20 04:29:49 +09:00
fi
sudo cp /usr/bin/qemu-arm-static brainux/usr/bin/
sudo cp ./os-brainux/setup_brainux.sh brainux/
sudo -E chroot brainux /setup_brainux.sh
sudo rm brainux/setup_brainux.sh
sudo ./os-brainux/override.sh ./os-brainux/override ./brainux
image/sd.img: clean_work
./image/build_image.sh
2021-03-06 20:19:11 +09:00
image/sd_x1.img: clean_work
./image/build_image_x1.sh
2021-02-20 04:29:49 +09:00
.PHONY:
clean_work:
sudo rm -rf image/work
.PHONY:
aptcache:
./tools/aptcache_linux_amd64 \
-rule 'local=localhost:65432, remote=ftp.jaist.ac.jp' \
-rule 'local=localhost:65433, remote=security.debian.org'
2021-03-22 23:10:22 +09:00
.PHONY:
datetag:
git tag $(shell ./tools/version)