diff options
author | lonkaars <loek@pipeframe.xyz> | 2024-02-06 13:22:04 +0100 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2024-02-06 13:22:04 +0100 |
commit | a9ef380662da3efa382017ff8423f1a894b31bfd (patch) | |
tree | 26c160523c050945502408148faae6508712033b /makefile | |
parent | ae327cc50fd9d3e59e9f60088243adfc69cb312e (diff) |
dynamic linking application starts
Diffstat (limited to 'makefile')
-rw-r--r-- | makefile | 75 |
1 files changed, 13 insertions, 62 deletions
@@ -25,86 +25,37 @@ $(eval $(shell state/gen)) include ./env export -.PHONY: all -all: load_boot load_rootfs +.PHONY: FORCE -.PHONY: sd_format sd_partition -sd_format: state/sdcard_fmt -sd_partition: state/sdcard_part +all: FORCE load_boot load_rootfs -state/container_img: Containerfile - $(CTR) build --tag $(CTR_IMG_TAG) . - touch $@ +include state.mk +include base.mk +include software.mk -state/submodules: - git submodule update --init - touch $@ +build_kernel: FORCE $(KERNEL_FILES) +build_bootloader: FORCE $(BOOTLOADER_FILES) +build_software: FORCE $(SOFTWARE_FILES) -state/sdcard_part: - $(AS_ROOT) util/part $(SDCARD_DISK) - touch $@ - -state/sdcard_fmt: state/sdcard_part - $(eval $(shell state/gen)) - $(AS_ROOT) mkfs.vfat -a -F 16 -n BOOT $(SDCARD_PART_BOOT) - $(AS_ROOT) mkfs.ext4 -F -L ROOTFS $(SDCARD_PART_ROOTFS) - touch $@ - -bootloader/.config: state/submodules state/container_img - $(CTRIZE) $(MAKE) -C bootloader am335x_evm_config -build_bootloader: bootloader/.config state/container_img - $(CTRIZE) $(MAKE) -C bootloader -uboot.env: uboot.txt - $(CTRIZE) bootloader/tools/mkenvimage -p 0x00 -s 0x20000 -o $@ $< -# NOTE: MLO MUST be copied first -BOOTLOADER_FILES += bootloader/MLO -BOOTLOADER_FILES += bootloader/u-boot.img -BOOTLOADER_FILES += bootloader/u-boot.dtb -BOOTLOADER_FILES += uboot.env -$(BOOTLOADER_FILES): build_bootloader - -kernel/.config: state/submodules state/container_img - $(CTRIZE) $(MAKE) -C kernel bb.org_defconfig -build_kernel: kernel/.config state/container_img - $(CTRIZE) $(MAKE) -C kernel zImage am335x-boneblack.dtb -KERNEL_FILES += kernel/arch/$(ARCH)/boot/dts/am335x-boneblack.dtb -KERNEL_FILES += kernel/arch/$(ARCH)/boot/zImage -$(KERNEL_FILES): build_kernel - -busybox/.config: state/submodules state/container_img - $(CTRIZE) $(MAKE) -C busybox defconfig - sed -i 's/^[# ]*CONFIG_STATIC\>.*$$/CONFIG_STATIC=y/' $@ - sed -i 's/^[# ]*CONFIG_PREFIX\>.*$$/CONFIG_PREFIX=".\/rootfs"/' $@ -busybox/busybox: busybox/.config state/container_img - $(CTRIZE) $(MAKE) -C busybox -busybox/_install: busybox/busybox state/container_img - $(CTRIZE) $(MAKE) -C busybox install -build_busybox: busybox/busybox - -# NOTE: ordering is important! -FILES_PART_BOOT += $(BOOTLOADER_FILES) -FILES_PART_BOOT += $(KERNEL_FILES) -.PHONY: load_boot load_rootfs -load_boot: $(FILES_PART_BOOT) state/sdcard_fmt +load_boot: FORCE $(FILES_PART_BOOT) state/sdcard_fmt mkdir -p mnt/boot $(AS_ROOT) mount $(SDCARD_PART_BOOT) mnt/boot $(AS_ROOT) cp $(FILES_PART_BOOT) mnt/boot $(AS_ROOT) sync $(AS_ROOT) umount mnt/boot -FILES_PART_ROOTFS += $(shell find rootfs) -FILES_PART_ROOTFS += busybox/rootfs -load_rootfs: $(FILES_PART_ROOTFS) state/sdcard_fmt +load_rootfs: FORCE $(FILES_PART_ROOTFS) state/sdcard_fmt mkdir -p mnt/rootfs $(AS_ROOT) mount $(SDCARD_PART_ROOTFS) mnt/rootfs $(AS_ROOT) util/mkrootfs mnt/rootfs $(AS_ROOT) sync $(AS_ROOT) umount mnt/rootfs -.PHONY: status -status: +status: FORCE @echo 'ENVIRONMENT' @state/gen | grep ':=' | sed -e 's/^\$$(eval / /' -e 's/)$$//' @echo 'TARGETS' @ls state | awk '$$0 == "gen" { next } { print }' | sed 's/^/ /' +__software_files: FORCE + @echo $(SOFTWARE_FILES) | tr ' ' '\n' |