From dd4dd91152c4d9a38fb01993c3a267d14d41619c Mon Sep 17 00:00:00 2001 From: CTCaer Date: Tue, 24 Mar 2020 20:06:10 +0200 Subject: [PATCH] makefile: Show a warning when binary exceeds limits --- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index d9f6988..3eb8ef4 100755 --- a/Makefile +++ b/Makefile @@ -78,8 +78,10 @@ NYXDIR := $(wildcard nyx) all: $(TARGET).bin @echo -n "Payload size is " - @wc -c < $(OUTPUTDIR)/$(TARGET).bin - @echo "Max size is 126296 Bytes." + $(eval BIN_SIZE = $(shell wc -c < $(OUTPUTDIR)/$(TARGET).bin)) + @echo $(BIN_SIZE) + @echo "Max size is 126296 Bytes." + @if [ ${BIN_SIZE} -gt 126296 ]; then echo "\e[1;33mPayload size exceeds limit!\e[0m"; fi clean: @rm -rf $(OBJS)