2020-06-23 16:08:00 -04:00
|
|
|
XC_PROJ := MoltenVKPackaging.xcodeproj
|
|
|
|
XC_SCHEME := MoltenVK Package
|
2018-10-30 23:16:12 -04:00
|
|
|
|
2020-12-09 09:36:17 -05:00
|
|
|
XCODEBUILD := set -o pipefail && $(shell command -v xcodebuild)
|
|
|
|
# Used to determine if xcpretty is available
|
|
|
|
XCPRETTY_PATH := $(shell command -v xcpretty 2> /dev/null)
|
|
|
|
|
|
|
|
OUTPUT_FMT_CMD =
|
|
|
|
ifdef XCPRETTY_PATH
|
|
|
|
# Pipe output to xcpretty, while preserving full log as xcodebuild.log
|
|
|
|
OUTPUT_FMT_CMD = | tee "xcodebuild.log" | xcpretty -c
|
|
|
|
else
|
|
|
|
# Use xcodebuild -quiet parameter
|
|
|
|
OUTPUT_FMT_CMD = -quiet
|
|
|
|
endif
|
|
|
|
|
2022-09-23 11:30:22 +02:00
|
|
|
# Collect all variables defined on the command-line (eg: MVK_HIDE_VULKAN_SYMBOLS=1)
|
|
|
|
MAKEARGS := $(strip \
|
|
|
|
$(foreach v,$(.VARIABLES),\
|
|
|
|
$(if $(filter command\ line,$(origin $(v))),\
|
|
|
|
$(v)=$(value $(v)) ,)))
|
2021-11-17 18:22:33 -05:00
|
|
|
|
2020-06-22 15:56:22 -04:00
|
|
|
# Specify individually (not as dependencies) so the sub-targets don't run in parallel
|
2018-10-30 23:16:12 -04:00
|
|
|
.PHONY: all
|
|
|
|
all:
|
2020-08-27 19:29:14 -04:00
|
|
|
@$(MAKE) macos
|
2020-09-01 14:39:46 -04:00
|
|
|
@$(MAKE) ios
|
|
|
|
@$(MAKE) iossim
|
2020-11-30 18:52:34 -05:00
|
|
|
@$(MAKE) maccat
|
2020-09-01 14:39:46 -04:00
|
|
|
@$(MAKE) tvos
|
|
|
|
@$(MAKE) tvossim
|
2018-10-30 23:16:12 -04:00
|
|
|
|
2020-06-23 16:08:00 -04:00
|
|
|
.PHONY: all-debug
|
|
|
|
all-debug:
|
2020-08-27 19:29:14 -04:00
|
|
|
@$(MAKE) macos-debug
|
2020-09-01 14:39:46 -04:00
|
|
|
@$(MAKE) ios-debug
|
|
|
|
@$(MAKE) iossim-debug
|
2020-11-30 18:52:34 -05:00
|
|
|
@$(MAKE) maccat-debug
|
2020-09-01 14:39:46 -04:00
|
|
|
@$(MAKE) tvos-debug
|
|
|
|
@$(MAKE) tvossim-debug
|
2020-06-23 16:08:00 -04:00
|
|
|
|
2018-10-30 23:16:12 -04:00
|
|
|
.PHONY: macos
|
|
|
|
macos:
|
2022-09-23 11:30:22 +02:00
|
|
|
$(XCODEBUILD) build -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (macOS only)" -destination "generic/platform=macOS" $(MAKEARGS) $(OUTPUT_FMT_CMD)
|
2020-06-23 16:08:00 -04:00
|
|
|
|
|
|
|
.PHONY: macos-debug
|
|
|
|
macos-debug:
|
2022-09-23 11:30:22 +02:00
|
|
|
$(XCODEBUILD) build -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (macOS only)" -destination "generic/platform=macOS" -configuration "Debug" $(MAKEARGS) $(OUTPUT_FMT_CMD)
|
2018-10-30 23:16:12 -04:00
|
|
|
|
|
|
|
.PHONY: ios
|
|
|
|
ios:
|
2022-09-23 11:30:22 +02:00
|
|
|
$(XCODEBUILD) build -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (iOS only)" -destination "generic/platform=iOS" $(MAKEARGS) $(OUTPUT_FMT_CMD)
|
2020-06-23 16:08:00 -04:00
|
|
|
|
|
|
|
.PHONY: ios-debug
|
|
|
|
ios-debug:
|
2022-09-23 11:30:22 +02:00
|
|
|
$(XCODEBUILD) build -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (iOS only)" -destination "generic/platform=iOS" -configuration "Debug" $(MAKEARGS) $(OUTPUT_FMT_CMD)
|
2018-10-30 23:16:12 -04:00
|
|
|
|
2020-09-01 14:39:46 -04:00
|
|
|
.PHONY: iossim
|
|
|
|
iossim:
|
2022-09-23 11:30:22 +02:00
|
|
|
$(XCODEBUILD) build -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (iOS only)" -destination "generic/platform=iOS Simulator" $(MAKEARGS) $(OUTPUT_FMT_CMD)
|
2020-06-23 16:08:00 -04:00
|
|
|
|
2020-09-01 14:39:46 -04:00
|
|
|
.PHONY: iossim-debug
|
|
|
|
iossim-debug:
|
2022-09-23 11:30:22 +02:00
|
|
|
$(XCODEBUILD) build -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (iOS only)" -destination "generic/platform=iOS Simulator" -configuration "Debug" $(MAKEARGS) $(OUTPUT_FMT_CMD)
|
2020-06-22 15:56:22 -04:00
|
|
|
|
2020-11-30 18:52:34 -05:00
|
|
|
.PHONY: maccat
|
|
|
|
maccat:
|
2022-09-23 11:30:22 +02:00
|
|
|
$(XCODEBUILD) build -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (iOS only)" -destination "generic/platform=macOS,variant=Mac Catalyst" $(MAKEARGS) $(OUTPUT_FMT_CMD)
|
2020-11-30 18:52:34 -05:00
|
|
|
|
|
|
|
.PHONY: maccat-debug
|
|
|
|
maccat-debug:
|
2022-09-23 11:30:22 +02:00
|
|
|
$(XCODEBUILD) build -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (iOS only)" -destination "generic/platform=macOS,variant=Mac Catalyst" -configuration "Debug" $(MAKEARGS) $(OUTPUT_FMT_CMD)
|
2020-11-30 18:52:34 -05:00
|
|
|
|
2020-06-09 14:30:46 -07:00
|
|
|
.PHONY: tvos
|
|
|
|
tvos:
|
2022-09-23 11:30:22 +02:00
|
|
|
$(XCODEBUILD) build -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (tvOS only)" -destination "generic/platform=tvOS" $(MAKEARGS) $(OUTPUT_FMT_CMD)
|
2020-06-23 16:08:00 -04:00
|
|
|
|
|
|
|
.PHONY: tvos-debug
|
|
|
|
tvos-debug:
|
2022-09-23 11:30:22 +02:00
|
|
|
$(XCODEBUILD) build -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (tvOS only)" -destination "generic/platform=tvOS" -configuration "Debug" $(MAKEARGS) $(OUTPUT_FMT_CMD)
|
2020-06-09 14:30:46 -07:00
|
|
|
|
2020-09-01 14:39:46 -04:00
|
|
|
.PHONY: tvossim
|
|
|
|
tvossim:
|
2022-09-23 11:30:22 +02:00
|
|
|
$(XCODEBUILD) build -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (tvOS only)" -destination "generic/platform=tvOS Simulator" $(MAKEARGS) $(OUTPUT_FMT_CMD)
|
2020-06-23 16:08:00 -04:00
|
|
|
|
2020-09-01 14:39:46 -04:00
|
|
|
.PHONY: tvossim-debug
|
|
|
|
tvossim-debug:
|
2022-09-23 11:30:22 +02:00
|
|
|
$(XCODEBUILD) build -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (tvOS only)" -destination "generic/platform=tvOS Simulator" -configuration "Debug" $(MAKEARGS) $(OUTPUT_FMT_CMD)
|
2020-06-22 15:56:22 -04:00
|
|
|
|
2018-10-30 23:16:12 -04:00
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
2021-06-14 19:59:33 -04:00
|
|
|
$(XCODEBUILD) clean -project "$(XC_PROJ)" -scheme "$(XC_SCHEME) (macOS only)" -destination "generic/platform=macOS" $(OUTPUT_FMT_CMD)
|
2018-10-30 23:16:12 -04:00
|
|
|
rm -rf Package
|
|
|
|
|
2020-06-22 15:56:22 -04:00
|
|
|
# Usually requires 'sudo make install'
|
2019-03-22 19:36:21 -04:00
|
|
|
.PHONY: install
|
|
|
|
install:
|
2020-04-02 21:11:14 -04:00
|
|
|
rm -rf /Library/Frameworks/MoltenVK.framework
|
2020-09-01 14:39:46 -04:00
|
|
|
rm -rf /Library/Frameworks/MoltenVK.xcframework
|
|
|
|
cp -a Package/Latest/MoltenVK/MoltenVK.xcframework /Library/Frameworks/
|
|
|
|
|
|
|
|
# Deprecated target names
|
|
|
|
.PHONY: iosfat
|
|
|
|
iosfat:
|
|
|
|
@$(MAKE) ios
|
|
|
|
@$(MAKE) iossim
|
2019-03-22 19:36:21 -04:00
|
|
|
|
2020-09-01 14:39:46 -04:00
|
|
|
.PHONY: iosfat-debug
|
|
|
|
iosfat-debug:
|
|
|
|
@$(MAKE) ios-debug
|
|
|
|
@$(MAKE) iossim-debug
|
|
|
|
|
|
|
|
.PHONY: tvosfat
|
|
|
|
tvosfat:
|
|
|
|
@$(MAKE) tvos
|
|
|
|
@$(MAKE) tvossim
|
|
|
|
|
|
|
|
.PHONY: tvosfat-debug
|
|
|
|
tvosfat-debug:
|
|
|
|
@$(MAKE) tvos-debug
|
|
|
|
@$(MAKE) tvossim-debug
|