提交 8062c365 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

Add jsoncpp as Git submodule.

上级 4cebbc41
[submodule "deps/jsoncpp"]
path = deps/jsoncpp
url = https://github.com/open-source-parsers/jsoncpp.git
program_NAME := mediasoup 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++
# #
# CXXFLAGS Options # Development flags
# Comment/uncomment them during development. # Comment/uncomment them during development.
# #
DO_DEBUG_SYMBOLS := -g DO_DEBUG_SYMBOLS := -g
...@@ -17,10 +17,10 @@ DO_DEBUG_SYMBOLS := -g ...@@ -17,10 +17,10 @@ DO_DEBUG_SYMBOLS := -g
# DO_OPTIMIZE := -O3 # DO_OPTIMIZE := -O3
# DO_PEDANTIC := -pedantic -Wno-gnu-zero-variadic-macro-arguments # DO_PEDANTIC := -pedantic -Wno-gnu-zero-variadic-macro-arguments
# #
CXXFLAGS += $(DO_DEBUG_SYMBOLS) $(DO_SANITIZE) $(DO_OPTIMIZE) $(DO_PEDANTIC) DEV_FLAGS := $(DO_DEBUG_SYMBOLS) $(DO_SANITIZE) $(DO_OPTIMIZE) $(DO_PEDANTIC)
# #
# CXXFLAGS 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().
...@@ -30,98 +30,99 @@ CXXFLAGS += $(DO_DEBUG_SYMBOLS) $(DO_SANITIZE) $(DO_OPTIMIZE) $(DO_PEDANTIC) ...@@ -30,98 +30,99 @@ CXXFLAGS += $(DO_DEBUG_SYMBOLS) $(DO_SANITIZE) $(DO_OPTIMIZE) $(DO_PEDANTIC)
# Settings. # Settings.
# #
# Directory where the executable will be placed. # App source files.
program_BIN_DIR := ./bin APP_SOURCES := $(shell find ./src -name "*.cpp")
# Directories containing program header files. # App headers directory.
program_INCLUDE_DIRS := ./include APP_HEADERS_DIR := ./include
# External libraries with pkg-config support. # App header files (just for documentation).
program_PKG_LIBRARIES = libuv >= 1.0.2, libconfig++ >= 1.4.8, openssl >= 1.0.1, libsrtp >= 1.5.2 APP_HEADERS := $(shell find $(APP_HEADERS_DIR) -name "*.h")
# Other libraries to link with (don't put here those libs having pkg-config file).
program_OTHER_LIBRARIES := pthread
# Directories where search for other libraries. # App binary directory.
# program_OTHER_LIBRARIES_DIRS := /usr/local/lib APP_BIN_DIR := ./bin
# Directories containing other libraries header files. # System libraries to link with.
# program_OTHER_LIBRARIES_INCLUDE_DIRS := /usr/local/include SYSTEM_LIBRARIES := pthread
# External libraries with pkg-config support.
PKG_LIBRARIES :=
PKG_LIBRARIES += libuv >= 1.6.1
PKG_LIBRARIES += libconfig++ >= 1.4.8
PKG_LIBRARIES += openssl >= 1.0.1
PKG_LIBRARIES += libsrtp >= 1.5.2
# All the .cpp files. # Dependencies source files.
program_CXX_SRCS := $(wildcard src/*.cpp src/*/*.cpp src/*/*/*.cpp src/*/*/*/*.cpp src/*/*/*/*/*.cpp) DEP_SOURCES :=
DEP_SOURCES += ./deps/jsoncpp/dist/jsoncpp.cpp
# All the .h files. # Dependencies header directories.
program_CXX_INCLUDES := $(wildcard include/*.h include/*/*.h include/*/*/*.h include/*/*/*/*.h include/*/*/*/*/*.h) DEP_HEADERS_DIRS :=
DEP_HEADERS_DIRS += ./deps/jsoncpp/dist
# C++ object files to build. # Dependencies static libraries to link with.
program_CXX_OBJS := ${program_CXX_SRCS:.cpp=.o} DEP_LIBRARIES :=
# Get all the .o files under src. Useful for 'make clean' as objects belinging to # Object files to build.
# already deleted source files are also deleted. ALL_OBJS = ${APP_SOURCES:.cpp=.o} ${DEP_SOURCES:.cpp=.o}
program_all_CXX_OBJS = $(wildcard src/*.o src/*/*.o src/*/*/*.o src/*/*/*/*.o src/*/*/*/*/*.o)
# CPPFLAGS is the C preprocessor flags, so anything that compiles a C or C++ source # CPPFLAGS is the C preprocessor flags, so anything that compiles a C or C++ source
# file into an object file will use this flag. # file into an object file will use this flag.
# This adds -I$(includedir) for every include directory in $(program_INCLUDE_DIRS) and CPPFLAGS += -I$(APP_HEADERS_DIR)
# $(program_OTHER_LIBRARIES_INCLUDE_DIRS). CPPFLAGS += $(foreach dir, $(DEP_HEADERS_DIRS), -I$(dir))
CPPFLAGS += $(foreach includedir, $(program_INCLUDE_DIRS), -I$(includedir)) CPPFLAGS += $(shell pkg-config --cflags "$(PKG_LIBRARIES)")
CPPFLAGS += $(foreach includedir, $(program_OTHER_LIBRARIES_INCLUDE_DIRS), -I$(includedir))
# CXXFLAGS gives a list of flags that should be passed to the C++ compiler (use # CXXFLAGS gives a list of flags that should be passed to the C++ compiler (use
# this, for example, to set the version of the C++ language, to specify the # this, for example, to set the version of the C++ language, to specify the
# warning settings, or for other options specific to the C++ compiler). # warning settings, or for other options specific to the C++ compiler).
CXXFLAGS += -std=c++11 -Wall CXXFLAGS += -std=c++11 -Wall $(DEV_FLAGS)
# LDFLAGS are used when linking, this will cause the appropriate flags to # LDFLAGS are used when linking, this will cause the appropriate flags to
# be passed to the linker. # be passed to the linker.
# This adds -L$(librarydir) for every library directory given in $(program_OTHER_LIBRARIES_DIRS) LDFLAGS += $(foreach library, $(SYSTEM_LIBRARIES), -l$(library))
# and -l$(library) for every library given in $(program_OTHER_LIBRARIES). LDFLAGS += $(shell pkg-config --libs "$(PKG_LIBRARIES)")
LDFLAGS += $(foreach librarydir, $(program_OTHER_LIBRARIES_DIRS), -L$(librarydir))
LDFLAGS += $(foreach library, $(program_OTHER_LIBRARIES), -l$(library))
# Add flags required by external libraries with pkg-config support.
CPPFLAGS += $(shell pkg-config --cflags "$(program_PKG_LIBRARIES)")
LDFLAGS += $(shell pkg-config --libs "$(program_PKG_LIBRARIES)")
# #
# Targets # Targets
# #
# This indicates that "all", program_NAME, "check_pkg_libraries" and "clean" are # This indicates that "all", APP_NAME, "check_pkg_libraries" 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 $(program_NAME) check_pkg_libraries clean distclean .PHONY: all $(APP_NAME) check_pkg_libraries clean deps
# 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 $(program_NAME). # "make all" are the same. The target simply depends on $(APP_NAME).
all: $(program_NAME) all: $(APP_NAME)
# The program depends on the object files (which are automatically built using the # The app depends on the object files (which are automatically built using the
# predefined build rules, nothing needs to be given explicitly for them). # predefined build rules, nothing needs to be given explicitly for them).
# The build rule $(LINK.cc) is used to link the object files and output a file with # The build rule $(LINK.cc) is used to link the object files and output a file with
# the same name as the program. 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).
$(program_NAME): check_pkg_libraries $(program_CXX_OBJS) $(APP_NAME): check_pkg_libraries $(ALL_OBJS)
mkdir -p $(program_BIN_DIR) @ mkdir -p $(APP_BIN_DIR)
$(LINK.cc) $(program_CXX_OBJS) -o $(program_BIN_DIR)/$(program_NAME) $(LINK.cc) $(ALL_OBJS) $(DEP_LIBRARIES) -o $(APP_BIN_DIR)/$(APP_NAME)
# Check the required libraries with pkg-support. # Check the required libraries with pkg-support.
check_pkg_libraries: check_pkg_libraries:
pkg-config --exists --print-errors "$(program_PKG_LIBRARIES)" pkg-config --exists --print-errors "$(PKG_LIBRARIES)"
# This target removes the built program 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 already doesn't exist). # errors should be ignored (i.e., the file doesn't exist).
clean: clean:
@- $(RM) $(program_NAME) $(RM) -rf $(APP_BIN_DIR)
@- $(RM) $(program_all_CXX_OBJS) $(RM) $(ALL_OBJS)
# doc: check_pkg_libraries $(program_CXX_OBJS) deps:
# cldoc generate $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) --output cldoc $(program_CXX_SRCS) # Retrieve Git data for dependencies.
# $(shell git submodule init)
doc: check_pkg_libraries $(program_CXX_OBJS) # $(shell git submodule update)
cldoc generate $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -- --output cldoc $(program_CXX_SRCS) $(program_CXX_INCLUDES) # jsoncpp stuff.
$(shell cd ./deps/jsoncpp && python amalgamate.py >/dev/null)
doc:
cldoc generate $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -- --output cldoc $(APP_SOURCES) $(APP_HEADERS)
Subproject commit d84702c9036505d0906b2f3d222ce5498ec65bc6
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论