X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/490019cf9519204c5fb36b2fba54ceb983bb6b72..0a7de7458d150b5d4dffc935ba399be265ef0a1a:/tools/tests/personas/Makefile?ds=sidebyside diff --git a/tools/tests/personas/Makefile b/tools/tests/personas/Makefile index f3421742f..d2c718f39 100644 --- a/tools/tests/personas/Makefile +++ b/tools/tests/personas/Makefile @@ -16,8 +16,13 @@ ifdef RC_ARCHS endif endif -ARCH_32 := $(filter-out %64, $(ARCHS)) -ARCH_64 := $(filter %64, $(ARCHS)) +# These are convenience functions for filtering based on substrings, as the +# normal filter functions only accept one wildcard. +FILTER_OUT_SUBSTRING=$(strip $(foreach string,$(2),$(if $(findstring $(1),$(string)),,$(string)))) +FILTER_SUBSTRING=$(strip $(foreach string,$(2),$(if $(findstring $(1),$(string)),$(string),))) + +ARCH_32:=$(call FILTER_OUT_SUBSTRING,64,$(ARCHS)) +ARCH_64:=$(call FILTER_SUBSTRING,64,$(ARCHS)) ARCH_32_FLAGS := $(patsubst %, -arch %, $(ARCH_32)) ARCH_64_FLAGS := $(patsubst %, -arch %, $(ARCH_64)) @@ -25,7 +30,7 @@ ARCH_FLAGS := $(if $(ARCH_64), $(ARCH_64_FLAGS)) $(if $(ARCH_32), $(ARCH_32_FLAG DSTROOT?=$(shell /bin/pwd) -TARGETS := persona_mgr persona_spawn +TARGETS := persona_mgr persona_spawn persona_test_run.sh all: $(addprefix $(DSTROOT)/, $(TARGETS)) @@ -33,5 +38,9 @@ $(DSTROOT)/persona_%: persona_%.c persona_test.h Makefile ${CC} ${CFLAGS} ${ARCH_FLAGS} -o $(SYMROOT)/$(notdir $@) $< if [ ! -e $@ ]; then ditto $(SYMROOT)/$(notdir $@) $@; fi +$(DSTROOT)/persona_test_run.sh: persona_test_run.sh + cp $? $@ + chmod +x $@ + clean: rm -rf $(addprefix $(DSTROOT)/,$(TARGETS)) $(addprefix $(SYMROOT)/,$(TARGETS)) $(SYMROOT)/*.dSYM