## ## Copyright (c) 2010 The WebM project authors. All Rights Reserved. ## ## Use of this source code is governed by a BSD-style license ## that can be found in the LICENSE file in the root of the source ## tree. An additional intellectual property rights grant can be found ## in the file PATENTS. All contributing project authors may ## be found in the AUTHORS file in the root of the source tree. ##
include config.mk
quiet?=true
ifeq ($(target),) # If a target wasn't specified, invoke for all enabled targets.
.DEFAULT:
@for t in $(ALL_TARGETS); do \
$(MAKE) --no-print-directory target=$$t $(MAKECMDGOALS) || exit $$?;\
done
all: .DEFAULT
clean:: .DEFAULT
exampletest: .DEFAULT
install:: .DEFAULT
test: .DEFAULT
test-no-data-check: .DEFAULT
testdata: .DEFAULT
utiltest: .DEFAULT
exampletest-no-data-check utiltest-no-data-check: .DEFAULT
test_%: .DEFAULT ;
# Note: md5sum is not installed on OS X, but openssl is. Openssl may not be # installed on cygwin, so we need to autodetect here.
md5sum := $(firstword $(wildcard \
$(foreach e,md5sum openssl,\
$(foreach p,$(subst :, ,$(PATH)),$(p)/$(e)*))\
))
md5sum := $(if $(filter %openssl,$(md5sum)),$(md5sum) dgst -md5,$(md5sum))
TGT_CC:=$(word 3, $(subst -, ,$(TOOLCHAIN)))
dist:
@for t in $(ALL_TARGETS); do \
$(MAKE) --no-print-directory target=$$t $(MAKECMDGOALS) || exit $$?;\
done # Run configure for the user with the current toolchain.
@if [ -d "$(DIST_DIR)/src" ]; then \
mkdir -p "$(DIST_DIR)/build"; \
cd "$(DIST_DIR)/build"; \
echo "Rerunning configure $(CONFIGURE_ARGS)"; \
../src/configure $(CONFIGURE_ARGS); \
$(if $(filter vs%,$(TGT_CC)),make NO_LAUNCH_DEVENV=1;) \
fi
@if [ -d "$(DIST_DIR)" ]; then \
echo " [MD5SUM] $(DIST_DIR)"; \
cd $(DIST_DIR) && \
$(md5sum) `find . -name md5sums.txt -prune -o -type f -print` \
| sed -e 's/MD5(\(.*\))= \([0-9a-f]\{32\}\)/\2 \1/' \
> md5sums.txt;\
fi
endif
# Since we invoke make recursively for multiple targets we need to include the # .mk file for the correct target, but only when $(target) is non-empty.
ifneq ($(target),)
include $(target)-$(TOOLCHAIN).mk
endif
BUILD_ROOT?=.
VPATH=$(SRC_PATH_BARE)
CFLAGS+=-I$(BUILD_PFX)$(BUILD_ROOT) -I$(SRC_PATH)
CXXFLAGS+=-I$(BUILD_PFX)$(BUILD_ROOT) -I$(SRC_PATH)
ASFLAGS+=-I$(BUILD_PFX)$(BUILD_ROOT)/ -I$(SRC_PATH)/
DIST_DIR?=dist
HOSTCC?=gcc
TGT_ISA:=$(word 1, $(subst -, ,$(TOOLCHAIN)))
TGT_OS:=$(word 2, $(subst -, ,$(TOOLCHAIN)))
TGT_CC:=$(word 3, $(subst -, ,$(TOOLCHAIN)))
quiet:=$(if $(or $(verbose), $(V)),, yes)
qexec=$(if $(quiet),@)
# If we're in debug mode, pretend we don't have GNU strip, to fall back to # the copy implementation
HAVE_GNU_STRIP := $(if $(CONFIG_DEBUG),,$(HAVE_GNU_STRIP))
ifeq ($(HAVE_GNU_STRIP),yes) # Older binutils strip global symbols not needed for relocation processing # when given --strip-unneeded. Using nm and awk to identify globals and # keep them caused command line length issues under mingw and segfaults in # test_libvpx were observed under OS/2: simply use --strip-debug.
%.a: %_g.a
$(if $(quiet),@echo " [STRIP] $@ < $<")
$(qexec)$(STRIP) --strip-debug \
-o $@ $< else
%.a: %_g.a
$(if $(quiet),@echo " [CP] $@ < $<")
$(qexec)cp $< $@
endif
ifeq ($(CONFIG_MSVS),yes)
lib_file_name=$(1).lib else
lib_file_name=lib$(1).a
endif
java.lang.NullPointerException # Rule Templates
java.lang.NullPointerException
define linker_template
$(1): $(filter-out -%,$(2))
$(1):
$(if $(quiet),@echo " [LD] $$@")
$(qexec)$$(LD) $$(strip $$(INTERNAL_LDFLAGS) $$(LDFLAGS) -o $$@ $(2) $(3) $$(extralibs))
endef
define linkerxx_template
$(1): $(filter-out -%,$(2))
$(1):
$(if $(quiet),@echo " [LD] $$@")
$(qexec)$$(CXX) $$(strip $$(INTERNAL_LDFLAGS) $$(LDFLAGS) -o $$@ $(2) $(3) $$(extralibs))
endef # make-3.80 has a bug with expanding large input strings to the eval function, # which was triggered in some cases by the following component of # linker_template: # $(1): $$(call find_file, $(patsubst -l%,lib%.a,$(filter -l%,$(2))),\ # $$(patsubst -L%,%,$$(filter -L%,$$(LDFLAGS) $(2)))) # This may be useful to revisit in the future (it tries to locate libraries # in a search path and add them as prerequisites
define archive_template # Notusing a pattern rule here because we don't want to generate empty # archives when they are listed as a dependency in files not responsible # for creating them.
$(1):
$(if $(quiet),@echo " [AR] $$@")
$(qexec)$$(AR) $$(ARFLAGS) $$@ $$^
endef
# Don't use -Wl,-z,defs with Clang's sanitizers.
java.lang.NullPointerException # Clang's AddressSanitizer documentation says "When linking shared libraries, # the AddressSanitizer run-time is not linked, so -Wl,-z,defs may cause link # errors (don't use it with AddressSanitizer)." See # https://clang.llvm.org/docs/AddressSanitizer.html#usage.
NO_UNDEFINED := -Wl,-z,defs
ifeq ($(findstring clang,$(CC)),clang)
ifneq ($(filter -fsanitize=%,$(LDFLAGS)),)
NO_UNDEFINED :=
endif
endif
define so_template # Notusing a pattern rule here because we don't want to generate empty # archives when they are listed as a dependency in files not responsible # for creating them.
java.lang.NullPointerException # This needs further abstraction for dealing with non-GNU linkers.
$(1):
$(if $(quiet),@echo " [LD] $$@")
$(qexec)$$(LD) -shared $$(LDFLAGS) \
$(NO_UNDEFINED) \
-Wl,-soname,$$(SONAME) \
-Wl,--version-script,$$(EXPORTS_FILE) -o $$@ \
$$(filter %.o,$$^) $$(extralibs)
endef
define dl_template # Notusing a pattern rule here because we don't want to generate empty # archives when they are listed as a dependency in files not responsible # for creating them.
$(1):
$(if $(quiet),@echo " [LD] $$@")
$(qexec)$$(LD) -dynamiclib $$(LDFLAGS) \
-exported_symbols_list $$(EXPORTS_FILE) \
-Wl,-headerpad_max_install_names,-compatibility_version,1.0,-current_version,$$(VERSION_MAJOR) \
-o $$@ \
$$(filter %.o,$$^) $$(extralibs)
endef
define dll_template # Notusing a pattern rule here because we don't want to generate empty # archives when they are listed as a dependency in files not responsible # for creating them.
$(1):
$(if $(quiet),@echo " [LD] $$@")
$(qexec)$$(LD) -Zdll $$(LDFLAGS) \
-o $$@ \
$$(filter %.o,$$^) $$(extralibs) $$(EXPORTS_FILE)
endef
java.lang.NullPointerException # Get current configuration
java.lang.NullPointerException
ifneq ($(target),)
include $(SRC_PATH_BARE)/$(target:-$(TOOLCHAIN)=).mk
endif
skip_deps := $(filter %clean,$(MAKECMDGOALS))
skip_deps += $(findstring testdata,$(MAKECMDGOALS))
ifeq ($(strip $(skip_deps)),)
ifeq ($(CONFIG_DEPENDENCY_TRACKING),yes) # Older versions of make don't like -include directives with no arguments
ifneq ($(filter %.d,$(OBJS-yes:.o=.d)),)
-include $(filter %.d,$(OBJS-yes:.o=.d))
endif
endif
endif
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.