From 7949911748019d9769d61afd935258f421f92871 Mon Sep 17 00:00:00 2001 From: Saleem Rashid Date: Mon, 25 Jun 2018 20:29:18 +0100 Subject: [PATCH] Makefile.include: Hide command invocation unless V=1 --- Makefile | 5 ++++- Makefile.include | 34 ++++++++++++++++++++++++---------- firmware/Makefile | 3 ++- firmware/protob/Makefile | 15 +++++++++++---- 4 files changed, 41 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index f77970f54..2d11f28ea 100644 --- a/Makefile +++ b/Makefile @@ -24,10 +24,13 @@ OBJS += gen/bitmaps.o OBJS += gen/fonts.o libtrezor.a: $(OBJS) - $(AR) rcs libtrezor.a $(OBJS) include Makefile.include +libtrezor.a: + @printf " AR $@\n" + $(Q)$(AR) rcs $@ $^ + .PHONY: vendor vendor: diff --git a/Makefile.include b/Makefile.include index 9eca4fa48..cc517be78 100644 --- a/Makefile.include +++ b/Makefile.include @@ -1,6 +1,10 @@ TOP_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) TOOLCHAIN_DIR ?= $(TOP_DIR)vendor/libopencm3 +ifneq ($(V),1) +Q := @ +endif + PYTHON ?= python ifeq ($(EMULATOR),1) @@ -152,34 +156,44 @@ release: $(NAME).bin xxd -p $(NAME)-$(APPVER).bin | tr -d '\n' > $(NAME)-$(APPVER).bin.hex $(NAME).bin: $(NAME).elf - $(OBJCOPY) -Obinary $(NAME).elf $(NAME).bin + @printf " OBJCOPY $@\n" + $(Q)$(OBJCOPY) -Obinary $(NAME).elf $(NAME).bin $(NAME).hex: $(NAME).elf - $(OBJCOPY) -Oihex $(NAME).elf $(NAME).hex + @printf " OBJCOPY $@\n" + $(Q)$(OBJCOPY) -Oihex $(NAME).elf $(NAME).hex $(NAME).srec: $(NAME).elf - $(OBJCOPY) -Osrec $(NAME).elf $(NAME).srec + @printf " OBJCOPY $@\n" + $(Q)$(OBJCOPY) -Osrec $(NAME).elf $(NAME).srec $(NAME).list: $(NAME).elf - $(OBJDUMP) -S $(NAME).elf > $(NAME).list + @printf " OBJDUMP $@\n" + $(Q)$(OBJDUMP) -S $(NAME).elf > $(NAME).list $(NAME).elf: $(OBJS) $(LDSCRIPT) $(LIBDEPS) - $(LD) -o $(NAME).elf $(OBJS) $(LDLIBS) $(LDFLAGS) + @printf " LD $@\n" + $(Q)$(LD) -o $(NAME).elf $(OBJS) $(LDLIBS) $(LDFLAGS) %.o: %.s Makefile - $(AS) $(CPUFLAGS) -o $@ $< + @printf " AS $@\n" + $(Q)$(AS) $(CPUFLAGS) -o $@ $< %.o: %.c Makefile - $(CC) $(CFLAGS) -MMD -MP -o $@ -c $< + @printf " CC $@\n" + $(Q)$(CC) $(CFLAGS) -MMD -MP -o $@ -c $< %.small.o: %.c Makefile - $(CC) $(CFLAGS) -MMD -MP -o $@ -c $< + @printf " CC $@\n" + $(Q)$(CC) $(CFLAGS) -MMD -MP -o $@ -c $< %.d: %.c Makefile - @$(CC) $(CFLAGS) -MM -MP -MG -o $@ $< + @printf " DEP $@\n" + $(Q)$(CC) $(CFLAGS) -MM -MP -MG -o $@ $< %.small.d: %.c Makefile - @$(CC) $(CFLAGS) -MM -MP -MG -o $@ $< + @printf " DEP $@\n" + $(Q)$(CC) $(CFLAGS) -MM -MP -MG -o $@ $< clean:: rm -f $(OBJS) diff --git a/firmware/Makefile b/firmware/Makefile index 9cd23f6ef..ac5a5157e 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -114,7 +114,8 @@ define GENERATE_CODE # $(3) - Additional output files $(1).h $(3): $(1).py $(2) - $(PYTHON) $(1).py + @printf " PYTHON $(1).py\n" + $(Q)$(PYTHON) $(1).py # Serialize build for parallel Make $(1).h: $(3) diff --git a/firmware/protob/Makefile b/firmware/protob/Makefile index 74392afcb..cffe703a1 100644 --- a/firmware/protob/Makefile +++ b/firmware/protob/Makefile @@ -1,18 +1,25 @@ +ifneq ($(V),1) +Q := @ +endif + all: messages.pb.c types.pb.c messages_map.h PYTHON ?= python %.pb.c: %.pb %.options - $(PYTHON) ../../vendor/nanopb/generator/nanopb_generator.py $< -L '#include "%s"' -T + @printf " NANOPB $@\n" + $(Q)$(PYTHON) ../../vendor/nanopb/generator/nanopb_generator.py $< -L '#include "%s"' -T %.pb: %.proto - protoc -I/usr/include -I. $< -o $@ + @printf " PROTOC $@\n" + $(Q)protoc -I/usr/include -I. $< -o $@ %_pb2.py: %.proto - protoc -I/usr/include -I. $< --python_out=. + @printf " PROTOC $@\n" + $(Q)protoc -I/usr/include -I. $< --python_out=. messages_map.h: messages_map.py messages_pb2.py types_pb2.py - $(PYTHON) $< | grep -v -e MessageType_Lisk > $@ + $(Q)$(PYTHON) $< | grep -v -e MessageType_Lisk > $@ clean: rm -f *.pb *.o *.d *.pb.c *.pb.h *_pb2.py messages_map.h