add option to make verbose builds (#251)

if V=1 is passed to make echo invoked command verbosely
This commit is contained in:
Jan Palus
2024-01-02 01:27:12 +01:00
committed by GitHub
parent bcd3deaa13
commit 2997906d98
4 changed files with 15 additions and 12 deletions

View File

@@ -19,6 +19,9 @@ define optbool
$(filter $(shell echo $(1) | tr A-Z a-z), yes on 1) $(filter $(shell echo $(1) | tr A-Z a-z), yes on 1)
endef endef
ifeq ($(V),)
ECHO = @
endif
# ===== # =====
all: all:
@@ -33,18 +36,18 @@ endif
apps: apps:
$(MAKE) -C src $(MAKE) -C src
@ ln -sf src/ustreamer.bin ustreamer $(ECHO) ln -sf src/ustreamer.bin ustreamer
@ ln -sf src/ustreamer-dump.bin ustreamer-dump $(ECHO) ln -sf src/ustreamer-dump.bin ustreamer-dump
python: python:
$(MAKE) -C python $(MAKE) -C python
@ ln -sf python/build/lib.*/*.so . $(ECHO) ln -sf python/build/lib.*/*.so .
janus: janus:
$(MAKE) -C janus $(MAKE) -C janus
@ ln -sf janus/*.so . $(ECHO) ln -sf janus/*.so .
install: all install: all

View File

@@ -31,13 +31,13 @@ endif
# ===== # =====
$(_PLUGIN): $(_SRCS:%.c=$(_BUILD)/%.o) $(_PLUGIN): $(_SRCS:%.c=$(_BUILD)/%.o)
$(info == SO $@) $(info == SO $@)
@ $(CC) $^ -o $@ $(_LDFLAGS) $(ECHO) $(CC) $^ -o $@ $(_LDFLAGS)
$(_BUILD)/%.o: %.c $(_BUILD)/%.o: %.c
$(info -- CC $<) $(info -- CC $<)
@ mkdir -p $(dir $@) || true $(ECHO) mkdir -p $(dir $@) || true
@ $(CC) $< -o $@ $(_CFLAGS) $(ECHO) $(CC) $< -o $@ $(_CFLAGS)

View File

@@ -9,7 +9,7 @@ PY ?= python3
# ===== # =====
all: all:
$(info == PY_BUILD ustreamer-*.so) $(info == PY_BUILD ustreamer-*.so)
@ $(PY) setup.py build $(ECHO) $(PY) setup.py build
install: install:

View File

@@ -86,18 +86,18 @@ install-strip: install
$(_USTR): $(_USTR_SRCS:%.c=$(_BUILD)/%.o) $(_USTR): $(_USTR_SRCS:%.c=$(_BUILD)/%.o)
$(info == LD $@) $(info == LD $@)
@ $(CC) $^ -o $@ $(_LDFLAGS) $(_USTR_LIBS) $(ECHO) $(CC) $^ -o $@ $(_LDFLAGS) $(_USTR_LIBS)
$(_DUMP): $(_DUMP_SRCS:%.c=$(_BUILD)/%.o) $(_DUMP): $(_DUMP_SRCS:%.c=$(_BUILD)/%.o)
$(info == LD $@) $(info == LD $@)
@ $(CC) $^ -o $@ $(_LDFLAGS) $(_DUMP_LIBS) $(ECHO) $(CC) $^ -o $@ $(_LDFLAGS) $(_DUMP_LIBS)
$(_BUILD)/%.o: %.c $(_BUILD)/%.o: %.c
$(info -- CC $<) $(info -- CC $<)
@ mkdir -p $(dir $@) || true $(ECHO) mkdir -p $(dir $@) || true
@ $(CC) $< -o $@ $(_CFLAGS) $(ECHO) $(CC) $< -o $@ $(_CFLAGS)
clean: clean: