summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorDmitrij D. Czarkoff <czarkoff@gmail.com>2015-11-01 23:18:06 +0100
committerDmitrij D. Czarkoff <czarkoff@gmail.com>2015-11-01 23:18:06 +0100
commitda59b17ace3f5551bbe4d0014c10c534befc8bdd (patch)
tree69671636aa5092b23122efa5b86acc270b25ca18 /Makefile
parentcb2e4c34a952d80ec1a4986e332acb878780b90b (diff)
build infrastructure: silent and verbose modes
In *silent* mode build infrastructure prints only short messages in format: TOOL filename and toolchain's warnings. In *verbose* mode it additionally echoes exact commands including all compiler and linker flags. By default baresip is built in *silent* mode (as before this commit); *verbose* mode can be set either by unsetting `HIDE` variable (running `make HIDE=`) or by setting `V` variable to any value (eg. `make V=1` or `make V=yes`).
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile23
1 files changed, 14 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index fbc5234..7de8dfc 100644
--- a/Makefile
+++ b/Makefile
@@ -16,6 +16,11 @@ PROJECT := baresip
VERSION := 0.4.15
DESCR := "Baresip is a modular SIP User-Agent with audio and video support"
+# Verbose and silent build modes
+ifeq ($(V),)
+HIDE=@
+endif
+
ifndef LIBRE_MK
LIBRE_MK := $(shell [ -f ../re/mk/re.mk ] && \
echo "../re/mk/re.mk")
@@ -163,14 +168,14 @@ Makefile: mk/*.mk $(MOD_MK) $(LIBRE_MK)
$(SHARED): $(LIB_OBJS)
@echo " LD $@"
- @$(LD) $(LFLAGS) $(SH_LFLAGS) $^ -L$(LIBRE_SO) -lre $(LIBS) -o $@
+ $(HIDE)$(LD) $(LFLAGS) $(SH_LFLAGS) $^ -L$(LIBRE_SO) -lre $(LIBS) -o $@
$(STATICLIB): $(LIB_OBJS)
@echo " AR $@"
@rm -f $@; $(AR) $(AFLAGS) $@ $^
ifneq ($(RANLIB),)
@echo " RANLIB $@"
- @$(RANLIB) $@
+ $(HIDE)$(RANLIB) $@
endif
libbaresip.pc:
@@ -190,9 +195,9 @@ libbaresip.pc:
$(BIN): $(APP_OBJS)
@echo " LD $@"
ifneq ($(GPROF),)
- @$(LD) $(LFLAGS) $(APP_LFLAGS) $^ ../re/libre.a $(LIBS) -o $@
+ $(HIDE)$(LD) $(LFLAGS) $(APP_LFLAGS) $^ ../re/libre.a $(LIBS) -o $@
else
- @$(LD) $(LFLAGS) $(APP_LFLAGS) $^ -L$(LIBRE_SO) -lre $(LIBS) -o $@
+ $(HIDE)$(LD) $(LFLAGS) $(APP_LFLAGS) $^ -L$(LIBRE_SO) -lre $(LIBS) -o $@
endif
@@ -202,25 +207,25 @@ test: $(TEST_BIN)
$(TEST_BIN): $(STATICLIB) $(TEST_OBJS)
@echo " LD $@"
- @$(CXX) $(LFLAGS) $(TEST_OBJS) \
+ $(HIDE)$(CXX) $(LFLAGS) $(TEST_OBJS) \
-L$(LIBRE_SO) -L. \
-l$(PROJECT) -lre $(LIBS) -o $@
$(BUILD)/%.o: %.c $(BUILD) Makefile $(APP_MK)
@echo " CC $@"
- @$(CC) $(CFLAGS) -c $< -o $@ $(DFLAGS)
+ $(HIDE)$(CC) $(CFLAGS) -c $< -o $@ $(DFLAGS)
$(BUILD)/%.o: %.cpp $(BUILD) Makefile $(APP_MK)
@echo " CXX $@"
- @$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@ $(DFLAGS)
+ $(HIDE)$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@ $(DFLAGS)
$(BUILD)/%.o: %.m $(BUILD) Makefile $(APP_MK)
@echo " OC $@"
- @$(CC) $(CFLAGS) $(OBJCFLAGS) -c $< -o $@ $(DFLAGS)
+ $(HIDE)$(CC) $(CFLAGS) $(OBJCFLAGS) -c $< -o $@ $(DFLAGS)
$(BUILD)/%.o: %.S $(BUILD) Makefile $(APP_MK)
@echo " AS $@"
- @$(CC) $(CFLAGS) -c $< -o $@ $(DFLAGS)
+ $(HIDE)$(CC) $(CFLAGS) -c $< -o $@ $(DFLAGS)
$(BUILD): Makefile
@mkdir -p $(BUILD)/src $(MOD_BLD) $(BUILD)/test/mock