endif
endif
-ARCH_32 := $(filter-out %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 := $(filter %64, $(ARCHS))
ARCH_64_FLAGS := $(patsubst %, -arch %, $(ARCH_64))
-CFLAGS :=-g -isysroot $(SDKROOT) -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
+CFLAGS :=-g -isysroot $(SDKROOT) -I$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
DSTROOT?=$(shell /bin/pwd)
SRCROOT?=$(shell /bin/pwd)
all: $(TARGETS)
$(ARCH_32_TARGETS): $(DSTROOT)/%: $(SRCROOT)/%.c
- $(CC) $(CFLAGS) $(ARCH_32_FLAGS) $< -o $(SYMROOT)/$(notdir $@) # 32-bit fat
+ $(CC) $(CFLAGS) $(ARCH_32_FLAGS) $< -o $(SYMROOT)/$(notdir $@) # 32-bit fat
if [ ! -e $@ ]; then ditto $(SYMROOT)/$(notdir $@) $@; fi
.SECONDEXPANSION:
if [ ! -e $@ ]; then ditto $(SYMROOT)/$(notdir $@) $@; fi
clean:
- rm -f $(TARGETS)
+ rm -f $(TARGETS)
rm -rf $(SYMROOT)/*.dSYM