aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-04-07 20:44:52 -0700
committerChristian Cunningham <cc@localhost>2022-04-07 20:44:52 -0700
commit52845f41981b957fa2b38d4e0e96803df138c407 (patch)
tree1e30804dcd1f2cedfa73ea42bf8646f6462e5ea4
parentc38deb7168e4ceab5250bcc5bf24a82c4db27354 (diff)
More verbose copying
Output what disk is being copied to
-rw-r--r--Common.mk25
1 files changed, 15 insertions, 10 deletions
diff --git a/Common.mk b/Common.mk
index dc45935..6739242 100644
--- a/Common.mk
+++ b/Common.mk
@@ -26,6 +26,8 @@ GDEBUG ?= 0
DEBUG ?= 0
SILENT ?= 0
LARGE ?= 1
+IMAGE = build/kernel7.img
+MOUNT_POINT = /mnt/sd0
CROSS = arm-none-eabi
AR = $(CROSS)-ar
@@ -88,12 +90,12 @@ endif
.PHONY: clean debug disk dump run test tree
-default: clean build/kernel7.img
+default: clean $(IMAGE)
-build/kernel7.img: CFLAGS += -DRPI_BUILD
-build/kernel7.img: CFLAGS := $(filter-out -g,$(CFLAGS))
-build/kernel7.img: AFLAGS := $(filter-out -g,$(AFLAGS))
-build/kernel7.img: build/kernel.elf
+$(IMAGE): CFLAGS += -DRPI_BUILD
+$(IMAGE): CFLAGS := $(filter-out -g,$(CFLAGS))
+$(IMAGE): AFLAGS := $(filter-out -g,$(AFLAGS))
+$(IMAGE): build/kernel.elf
@mkdir -p $(@D)
@echo "IMAGE BUILD $@"
@$(OBJCOPY) $< -O binary $@
@@ -167,10 +169,13 @@ test: clean build/kernel.elf
ifndef DISK
copy:
- @tput setaf 1 2> /dev/null || true; echo ERROR: No disk specified!; tput sgr0 2> /dev/null || true
+ @tput setaf 1 2> /dev/null || true; echo "ERROR No disk specified!"; tput sgr0 2> /dev/null || true
else
-copy: clean build/kernel7.img
- sudo mount $(DISK) /mnt/sd0
- sudo cp build/kernel7.img /mnt/sd0
- sudo umount /mnt/sd0
+copy: clean $(IMAGE)
+ @echo "MOUNT $(DISK) <==> $(MOUNT_POINT)"
+ @sudo mount $(DISK) $(MOUNT_POINT)
+ @echo "IMAGE CP $(IMAGE) -> $(DISK)"
+ @sudo cp $(IMAGE) $(MOUNT_POINT)
+ @echo "UMOUNT $(DISK)"
+ @sudo umount $(MOUNT_POINT)
endif