提交 9fbdf500 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

Make Makefile more verbose.

上级 e19fc4f6
...@@ -2,14 +2,14 @@ APP_NAME := mediasoup ...@@ -2,14 +2,14 @@ APP_NAME := mediasoup
# #
# Compiler # Compiler.
# #
# CXX := g++-4.8 # CXX := g++-4.8
# CXX := g++-4.9 -fdiagnostics-color=auto # CXX := g++-4.9 -fdiagnostics-color=auto
# CXX := clang++ # CXX := clang++
# #
# Development flags # Development flags.
# Comment/uncomment them during development. # Comment/uncomment them during development.
# #
DO_DEBUG_SYMBOLS := -g DO_DEBUG_SYMBOLS := -g
...@@ -20,7 +20,7 @@ DO_DEBUG_SYMBOLS := -g ...@@ -20,7 +20,7 @@ DO_DEBUG_SYMBOLS := -g
DEV_FLAGS := $(DO_DEBUG_SYMBOLS) $(DO_SANITIZE) $(DO_OPTIMIZE) $(DO_PEDANTIC) DEV_FLAGS := $(DO_DEBUG_SYMBOLS) $(DO_SANITIZE) $(DO_OPTIMIZE) $(DO_PEDANTIC)
# #
# Custom macros # Custom macros.
# Added to the CXXFLAGS exported variable (before running make). # Added to the CXXFLAGS exported variable (before running make).
# #
# -DMS_DEVEL enables MS_TRACE(). # -DMS_DEVEL enables MS_TRACE().
...@@ -84,13 +84,13 @@ LDFLAGS += $(shell pkg-config --libs "$(PKG_LIBS)") ...@@ -84,13 +84,13 @@ LDFLAGS += $(shell pkg-config --libs "$(PKG_LIBS)")
# #
# Targets # Targets.
# #
# This indicates that "all", APP_NAME, "check_pkg_libs" and "clean" are # This indicates that "all", APP_NAME, "check_pkg_libs" and "clean" are
# "phony targets". Therefore calling "make XXXX" should execute the content of its # "phony targets". Therefore calling "make XXXX" should execute the content of its
# build rules, even if a newer file named "XXXX" exists. # build rules, even if a newer file named "XXXX" exists.
.PHONY: all $(APP_NAME) check_pkg_libs clean deps .PHONY: all $(APP_NAME) check_pkg_libs echo_all_objs clean deps doc
# This is first build rule in the Makefile, and so executing "make" and executing # This is first build rule in the Makefile, and so executing "make" and executing
# "make all" are the same. The target simply depends on $(APP_NAME). # "make all" are the same. The target simply depends on $(APP_NAME).
...@@ -102,27 +102,35 @@ all: $(APP_NAME) ...@@ -102,27 +102,35 @@ all: $(APP_NAME)
# the same name as the app. Note that LINK.cc makes use of CXX, CXXFLAGS, # the same name as the app. Note that LINK.cc makes use of CXX, CXXFLAGS,
# LFLAGS, etc. LINK.cc is usually defined as: $(CXX) $(CXXFLAGS) $(CPPFLAGS) # LFLAGS, etc. LINK.cc is usually defined as: $(CXX) $(CXXFLAGS) $(CPPFLAGS)
# $(LDFLAGS) $(TARGET_ARCH). # $(LDFLAGS) $(TARGET_ARCH).
$(APP_NAME): check_pkg_libs $(ALL_OBJS) $(APP_NAME): check_pkg_libs echo_all_objs $(ALL_OBJS)
@mkdir -p $(APP_BIN_DIR) @mkdir -p $(APP_BIN_DIR)
@echo "INFO: linking .o objects and libraries into $(APP_BIN_DIR)/$(APP_NAME) ..."
$(LINK.cc) $(ALL_OBJS) $(DEP_LIBS) -o $(APP_BIN_DIR)/$(APP_NAME) $(LINK.cc) $(ALL_OBJS) $(DEP_LIBS) -o $(APP_BIN_DIR)/$(APP_NAME)
# Check required libraries with pkg-support. # Check required libraries with pkg-support.
check_pkg_libs: check_pkg_libs:
pkg-config --exists --print-errors "$(PKG_LIBS)" @echo "INFO: checking required PKG libraries ..."
@pkg-config --exists --print-errors "$(PKG_LIBS)"
echo_all_objs:
@echo "INFO: compiling source files into .o object files ..."
# This target removes the built app and the generated object files. The @ symbol # This target removes the built app and the generated object files. The @ symbol
# indicates that the line should be run silently, and the - symbol indicates that # indicates that the line should be run silently, and the - symbol indicates that
# errors should be ignored (i.e., the file doesn't exist). # errors should be ignored (i.e., the file doesn't exist).
clean: clean:
$(RM) -rf $(APP_BIN_DIR) @echo "INFO: deleting $(APP_BIN_DIR) folder ..."
$(RM) $(ALL_OBJS) @$(RM) -rf $(APP_BIN_DIR)
@echo "INFO: deleting .o object files ..."
@$(RM) $(ALL_OBJS)
deps: deps:
@echo "INFO: retrieving Git submodules..." @echo "INFO: retrieving Git submodules ..."
git submodule init git submodule init
git submodule update git submodule update
@echo "INFO: building jsoncpp stuff..." @echo "INFO: building jsoncpp stuff ..."
cd ./deps/jsoncpp && python amalgamate.py >/dev/null cd ./deps/jsoncpp && python amalgamate.py >/dev/null
doc: doc:
@echo "INFO: generating documentation ..."
cldoc generate $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -- --output cldoc $(APP_SOURCES) $(APP_HEADERS) cldoc generate $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -- --output cldoc $(APP_SOURCES) $(APP_HEADERS)
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论