diff --git a/Makefile b/Makefile index 37cec9c..dd2bf6b 100644 --- a/Makefile +++ b/Makefile @@ -20,10 +20,14 @@ else BUNDLE_DIR = Reframe360.ofx.bundle/Contents/MacOS/ METAL_OBJ = Reframe360Kernel.o OPENCL_OBJ = OpenCLKernel.o + METAL_ARM_OBJ = Reframe360Kernel-arm.o + OPENCL_ARM_OBJ = OpenCLKernel-arm.o + APPLE86_64_FLAG = -target x86_64-apple-macos10.12 + APPLEARM64_FLAG = -target arm64-apple-macos11 endif Reframe360.ofx: Reframe360.o $(OPENCL_OBJ) $(CUDA_OBJ) $(METAL_OBJ) ofxsCore.o ofxsImageEffect.o ofxsInteract.o ofxsLog.o ofxsMultiThread.o ofxsParams.o ofxsProperty.o ofxsPropertyValidation.o - $(CXX) $^ -o $@ $(LDFLAGS) + $(CXX) $(APPLE86_64_FLAG) $^ -o $@ $(LDFLAGS) mkdir -p $(BUNDLE_DIR) cp Reframe360.ofx $(BUNDLE_DIR) @@ -31,35 +35,77 @@ CudaKernel.o: CudaKernel.cu ${NVCC} -c $< $(NVCCFLAGS) Reframe360.o: Reframe360.cpp - $(CXX) -c $< $(CXXFLAGS) + $(CXX) $(APPLE86_64_FLAG) -c $< $(CXXFLAGS) Reframe360Kernel.o: Reframe360Kernel.mm python metal2string.py Reframe360Kernel.metal Reframe360Kernel.h - $(CXX) -c $< $(CXXFLAGS) + $(CXX) $(APPLE86_64_FLAG) -c $< $(CXXFLAGS) + +OpenCLKernel.o: OpenCLKernel.cpp + $(CXX) $(APPLE86_64_FLAG) -c $< $(CXXFLAGS) -o $@ ofxsCore.o: $(BMDOFXDEVPATH)/Support/Library/ofxsCore.cpp - $(CXX) -c "$<" $(CXXFLAGS) + $(CXX) $(APPLE86_64_FLAG) -c "$<" $(CXXFLAGS) ofxsImageEffect.o: $(BMDOFXDEVPATH)/Support/Library/ofxsImageEffect.cpp - $(CXX) -c "$<" $(CXXFLAGS) + $(CXX) $(APPLE86_64_FLAG) -c "$<" $(CXXFLAGS) ofxsInteract.o: $(BMDOFXDEVPATH)/Support/Library/ofxsInteract.cpp - $(CXX) -c "$<" $(CXXFLAGS) + $(CXX) $(APPLE86_64_FLAG) -c "$<" $(CXXFLAGS) ofxsLog.o: $(BMDOFXDEVPATH)/Support/Library/ofxsLog.cpp - $(CXX) -c "$<" $(CXXFLAGS) + $(CXX) $(APPLE86_64_FLAG) -c "$<" $(CXXFLAGS) ofxsMultiThread.o: $(BMDOFXDEVPATH)/Support/Library/ofxsMultiThread.cpp - $(CXX) -c "$<" $(CXXFLAGS) + $(CXX) $(APPLE86_64_FLAG) -c "$<" $(CXXFLAGS) ofxsParams.o: $(BMDOFXDEVPATH)/Support/Library/ofxsParams.cpp - $(CXX) -c "$<" $(CXXFLAGS) + $(CXX) $(APPLE86_64_FLAG) -c "$<" $(CXXFLAGS) ofxsProperty.o: $(BMDOFXDEVPATH)/Support/Library/ofxsProperty.cpp - $(CXX) -c "$<" $(CXXFLAGS) + $(CXX) $(APPLE86_64_FLAG) -c "$<" $(CXXFLAGS) ofxsPropertyValidation.o: $(BMDOFXDEVPATH)/Support/Library/ofxsPropertyValidation.cpp - $(CXX) -c "$<" $(CXXFLAGS) + $(CXX) $(APPLE86_64_FLAG) -c "$<" $(CXXFLAGS) + +Reframe360-arm.ofx: Reframe360-arm.o $(OPENCL_ARM_OBJ) $(METAL_ARM_OBJ) ofxsCore-arm.o ofxsImageEffect-arm.o ofxsInteract-arm.o ofxsLog-arm.o ofxsMultiThread-arm.o ofxsParams-arm.o ofxsProperty-arm.o ofxsPropertyValidation-arm.o + $(CXX) $(APPLEARM64_FLAG) $^ -o $@ $(LDFLAGS) + mkdir -p $(BUNDLE_DIR) + cp Reframe360.ofx $(BUNDLE_DIR) + +Reframe360-arm.o: Reframe360.cpp + $(CXX) $(APPLEARM64_FLAG) -c $< $(CXXFLAGS) -o $@ + +Reframe360Kernel-arm.o: Reframe360Kernel.mm + python metal2string.py Reframe360Kernel.metal Reframe360Kernel.h + $(CXX) $(APPLEARM64_FLAG) -c $< $(CXXFLAGS) -o $@ + +OpenCLKernel-arm.o: OpenCLKernel.cpp + $(CXX) $(APPLEARM64_FLAG) -c $< $(CXXFLAGS) -o $@ + +ofxsCore-arm.o: $(BMDOFXDEVPATH)/Support/Library/ofxsCore.cpp + $(CXX) $(APPLEARM64_FLAG) -c "$<" $(CXXFLAGS) -o $@ + +ofxsImageEffect-arm.o: $(BMDOFXDEVPATH)/Support/Library/ofxsImageEffect.cpp + $(CXX) $(APPLEARM64_FLAG) -c "$<" $(CXXFLAGS) -o $@ + +ofxsInteract-arm.o: $(BMDOFXDEVPATH)/Support/Library/ofxsInteract.cpp + $(CXX) $(APPLEARM64_FLAG) -c "$<" $(CXXFLAGS) -o $@ + +ofxsLog-arm.o: $(BMDOFXDEVPATH)/Support/Library/ofxsLog.cpp + $(CXX) $(APPLEARM64_FLAG) -c "$<" $(CXXFLAGS) -o $@ + +ofxsMultiThread-arm.o: $(BMDOFXDEVPATH)/Support/Library/ofxsMultiThread.cpp + $(CXX) $(APPLEARM64_FLAG) -c "$<" $(CXXFLAGS) -o $@ + +ofxsParams-arm.o: $(BMDOFXDEVPATH)/Support/Library/ofxsParams.cpp + $(CXX) $(APPLEARM64_FLAG) -c "$<" $(CXXFLAGS) -o $@ + +ofxsProperty-arm.o: $(BMDOFXDEVPATH)/Support/Library/ofxsProperty.cpp + $(CXX) $(APPLEARM64_FLAG) -c "$<" $(CXXFLAGS) -o $@ + +ofxsPropertyValidation-arm.o: $(BMDOFXDEVPATH)/Support/Library/ofxsPropertyValidation.cpp + $(CXX) $(APPLEARM64_FLAG) -c "$<" $(CXXFLAGS) -o $@ Reframe360Kernel.h: Reframe360Kernel.metal python metal2string.py Reframe360Kernel.metal Reframe360Kernel.h @@ -74,7 +120,20 @@ clean: rm -fr Reframe360.ofx.bundle ifeq ($(UNAME_SYSTEM), Darwin) +.DEFAULT_GOAL := darwin + +.PHONY: darwin +darwin: clean install-universal + install: Reframe360.ofx rm -rf /Library/OFX/Plugins/Reframe360.ofx.bundle cp -a Reframe360.ofx.bundle /Library/OFX/Plugins/ + +install-universal: Reframe360.ofx Reframe360-arm.ofx + lipo -create -output Reframe360-universal.ofx Reframe360.ofx Reframe360-arm.ofx + rm -rf $(BUNDLE_DIR) + mkdir -p $(BUNDLE_DIR) + cp Reframe360-universal.ofx $(BUNDLE_DIR)/Reframe360.ofx + rm -rf /Library/OFX/Plugins/Reframe360.ofx.bundle + cp -a Reframe360.ofx.bundle /Library/OFX/Plugins/ endif diff --git a/README.md b/README.md index e51bd47..3622d89 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,8 @@ New features and bug fixes: Enjoy! -# Installation on MacOS +# Installation on MacOS (Intel and Apple Silicon) +* Build tested on MacOS 11.2.3 / XCode 12.4 * Install latest XCode from Apple App store * Install Blackmagic DaVinci Resolve from Blackmagic website (free or studio version) * clone glm repository https://github.com/bclarksoftware/glm.git @@ -18,5 +19,5 @@ Enjoy! * and build ```` cd reframe360XL -make install -```` \ No newline at end of file +make +````