1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-12 18:49:07 +00:00

Makefile.include: Hide command invocation unless V=1

This commit is contained in:
Saleem Rashid 2018-06-25 20:29:18 +01:00 committed by Pavol Rusnak
parent 67852dcaba
commit 7949911748
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
4 changed files with 41 additions and 16 deletions

View File

@ -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:

View File

@ -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)

View File

@ -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)

View File

@ -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