aboutsummaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
Diffstat (limited to 'makefile')
-rw-r--r--makefile25
1 files changed, 20 insertions, 5 deletions
diff --git a/makefile b/makefile
index da94b65..a211676 100644
--- a/makefile
+++ b/makefile
@@ -18,7 +18,8 @@ CTRIZE += --env-file ./env
CTRIZE += $(CTR_IMG_TAG)
export
-# create files that represent otherwise PHONY targets
+# create dummy files to represent non-file targets (container image build
+# status, sd card partition status, git submodule initialization, etc.)
$(shell state/gen)
-include state/auto.mk
@@ -26,8 +27,12 @@ $(shell state/gen)
include ./env
export
+# shortcuts
.PHONY: all
all: $(BOOTLOADER_FILES)
+.PHONY: sd_format sd_partition
+sd_format: state/sdcard_fmt
+sd_partition: state/sdcard_part
state/container_img: Containerfile
$(CTR) build --tag $(CTR_IMG_TAG) .
@@ -38,6 +43,15 @@ state/submodules:
$(GIT) submodule update
touch $@
+state/sdcard_part:
+ $(AS_ROOT) util/part $(SDCARD_DISK)
+ touch $@
+
+state/sdcard_fmt: state/sdcard_part
+ $(AS_ROOT) mkfs.vfat -n BOOT -F 32 $(SDCARD_PART_BOOT)
+ $(AS_ROOT) mkfs.ext4 -L ROOTFS -F $(SDCARD_PART_ROOTFS)
+ touch $@
+
BOOTLOADER_FILES += bootloader/MLO
BOOTLOADER_FILES += bootloader/u-boot.img
BOOTLOADER_FILES += bootloader/u-boot.dtb
@@ -59,8 +73,9 @@ load_bootloader: $(BOOTLOADER_FILES)
$(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)
+.PHONY: status
+status:
+ @echo '### STATUS REPORT'
+ @echo '# DETECTED SD CARD'
+ @cat state/auto.mk