summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlfred E. Heggestad <aeh@db.org>2015-11-02 09:32:29 +0100
committerAlfred E. Heggestad <aeh@db.org>2015-11-02 09:32:29 +0100
commit937581b8eafd64c12c702627045e2d92cda2f721 (patch)
tree69671636aa5092b23122efa5b86acc270b25ca18
parentcb2e4c34a952d80ec1a4986e332acb878780b90b (diff)
parentda59b17ace3f5551bbe4d0014c10c534befc8bdd (diff)
Merge pull request #87 from czarkoff/master
build infrastructure: silent and verbose modes
-rw-r--r--Makefile23
-rw-r--r--mk/mod.mk18
2 files changed, 23 insertions, 18 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
diff --git a/mk/mod.mk b/mk/mod.mk
index 2736946..6972a83 100644
--- a/mk/mod.mk
+++ b/mk/mod.mk
@@ -33,34 +33,34 @@ ifeq ($(STATIC),)
$(MOD)$(MOD_SUFFIX): $($(MOD)_OBJS)
@echo " LD [M] $@"
- @$(LD) $(LFLAGS) $(SH_LFLAGS) $(MOD_LFLAGS) $($(basename $@)_OBJS) \
+ $(HIDE)$(LD) $(LFLAGS) $(SH_LFLAGS) $(MOD_LFLAGS) $($(basename $@)_OBJS) \
$($(basename $@)_LFLAGS) -L$(LIBRE_SO) -lre -o $@
$(BUILD)/modules/$(MOD)/%.o: modules/$(MOD)/%.c $(BUILD) Makefile mk/mod.mk \
modules/$(MOD)/module.mk mk/modules.mk
@echo " CC [M] $@"
@mkdir -p $(dir $@)
- @$(CC) $(CFLAGS) $($(call modulename,$@)_CFLAGS) -c $< -o $@ $(DFLAGS)
+ $(HIDE)$(CC) $(CFLAGS) $($(call modulename,$@)_CFLAGS) -c $< -o $@ $(DFLAGS)
$(BUILD)/modules/$(MOD)/%.o: modules/$(MOD)/%.m $(BUILD) Makefile mk/mod.mk \
modules/$(MOD)/module.mk mk/modules.mk
@echo " OC [M] $@"
@mkdir -p $(dir $@)
- @$(CC) $(CFLAGS) $($(call modulename,$@)_CFLAGS) $(OBJCFLAGS) \
+ $(HIDE)$(CC) $(CFLAGS) $($(call modulename,$@)_CFLAGS) $(OBJCFLAGS) \
-c $< -o $@ $(DFLAGS)
$(BUILD)/modules/$(MOD)/%.o: modules/$(MOD)/%.cpp $(BUILD) Makefile mk/mod.mk \
modules/$(MOD)/module.mk mk/modules.mk
@echo " CXX [M] $@"
@mkdir -p $(dir $@)
- @$(CXX) $(CXXFLAGS) $($(call modulename,$@)_CXXFLAGS) \
+ $(HIDE)$(CXX) $(CXXFLAGS) $($(call modulename,$@)_CXXFLAGS) \
-c $< -o $@ $(DFLAGS)
$(BUILD)/modules/$(MOD)/%.o: modules/$(MOD)/%.S $(BUILD) Makefile mk/mod.mk \
modules/$(MOD)/module.mk mk/modules.mk
@echo " AS [M] $@"
@mkdir -p $(dir $@)
- @$(CC) $(CFLAGS) -DMOD_NAME=\"$(MOD)\" -c $< -o $@ $(DFLAGS)
+ $(HIDE)$(CC) $(CFLAGS) -DMOD_NAME=\"$(MOD)\" -c $< -o $@ $(DFLAGS)
else
@@ -76,14 +76,14 @@ $(BUILD)/modules/$(MOD)/%.o: modules/$(MOD)/%.c $(BUILD) Makefile mk/mod.mk \
modules/$(MOD)/module.mk mk/modules.mk
@echo " CC [m] $@"
@mkdir -p $(dir $@)
- @$(CC) $(CFLAGS) $($(call modulename,$@)_CFLAGS) \
+ $(HIDE)$(CC) $(CFLAGS) $($(call modulename,$@)_CFLAGS) \
-DMOD_NAME=\"$(MOD)\" -c $< -o $@ $(DFLAGS)
$(BUILD)/modules/$(MOD)/%.o: modules/$(MOD)/%.m $(BUILD) Makefile mk/mod.mk \
modules/$(MOD)/module.mk mk/modules.mk
@echo " OC [m] $@"
@mkdir -p $(dir $@)
- @$(CC) $(CFLAGS) $($(call modulename,$@)_CFLAGS) $(OBJCFLAGS) \
+ $(HIDE)$(CC) $(CFLAGS) $($(call modulename,$@)_CFLAGS) $(OBJCFLAGS) \
-DMOD_NAME=\"$(MOD)\" -c $< -o $@ $(DFLAGS)
@@ -91,13 +91,13 @@ $(BUILD)/modules/$(MOD)/%.o: modules/$(MOD)/%.cpp $(BUILD) Makefile mk/mod.mk \
modules/$(MOD)/module.mk mk/modules.mk
@echo " CXX [m] $@"
@mkdir -p $(dir $@)
- @$(CXX) $(CXXFLAGS) $($(call modulename,$@)_CXXFLAGS) \
+ $(HIDE)$(CXX) $(CXXFLAGS) $($(call modulename,$@)_CXXFLAGS) \
-DMOD_NAME=\"$(MOD)\" -c $< -o $@ $(DFLAGS)
$(BUILD)/modules/$(MOD)/%.o: modules/$(MOD)/%.S $(BUILD) Makefile mk/mod.mk \
modules/$(MOD)/module.mk mk/modules.mk
@echo " AS [m] $@"
@mkdir -p $(dir $@)
- @$(CC) $(CFLAGS) -DMOD_NAME=\"$(MOD)\" -c $< -o $@ $(DFLAGS)
+ $(HIDE)$(CC) $(CFLAGS) -DMOD_NAME=\"$(MOD)\" -c $< -o $@ $(DFLAGS)
endif