blob: da94b65155d624afccb09b9cec434d9f0e9c4da5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
# use sudo (non interactively) when running as regular user
ifneq ($(shell id -u),0)
AS_ROOT := sudo -n
endif
MOUNT := $(AS_ROOT) mount
UMOUNT := $(AS_ROOT) umount
CTR := podman
CP := cp
GIT := git
CTR_IMG_TAG := avans-linux
CTRIZE := $(CTR) run --rm --interactive --tty
CTRIZE += --volume .:/workdir:rw
CTRIZE += --env-file ./env
CTRIZE += $(CTR_IMG_TAG)
export
# create files that represent otherwise PHONY targets
$(shell state/gen)
-include state/auto.mk
# read environment variables from ./env
include ./env
export
.PHONY: all
all: $(BOOTLOADER_FILES)
state/container_img: Containerfile
$(CTR) build --tag $(CTR_IMG_TAG) .
touch $@
state/submodules:
$(GIT) submodule init
$(GIT) submodule update
touch $@
BOOTLOADER_FILES += bootloader/MLO
BOOTLOADER_FILES += bootloader/u-boot.img
BOOTLOADER_FILES += bootloader/u-boot.dtb
bootloader/.config: state/submodules
$(CTRIZE) $(MAKE) -$(MAKEFLAGS) -C bootloader am335x_evm_config
$(BOOTLOADER_FILES): bootloader/.config
$(CTRIZE) $(MAKE) -$(MAKEFLAGS) -C bootloader
KERNEL_FILES += kernel/
kernel/.config: state/submodules
$(CTRIZE) $(MAKE) -$(MAKEFLAGS) -C kernel omap2plus_defconfig
$(KERNEL_FILES): kernel/.config
$(CTRIZE) $(MAKE) -$(MAKEFLAGS) -C kernel
.PHONY: load_bootloader
load_bootloader: $(BOOTLOADER_FILES)
mkdir -p mnt/boot mnt/rootfs
$(MOUNT) $(SDCARD_PART_BOOT) mnt/boot
$(AS_ROOT) $(CP) $(BOOTLOADER_FILES) mnt/boot
$(UMOUNT) mnt/boot
.PHONY: sd_format
sd_format:
$(AS_ROOT) mkfs.vfat -n BOOT -F 32 $(SDCARD_PART_BOOT)
$(AS_ROOT) mkfs.ext4 -L ROOTFS -F $(SDCARD_PART_ROOTFS)
|