~kmdodrill/raylib-template

c348dfbe713f5c1f884ca624da8f026612763fb4 — Kenneth Dodrill 5 months ago 82e40d7
Add support for m1 macs
1 files changed, 44 insertions(+), 14 deletions(-)

M Makefile
M Makefile => Makefile +44 -14
@@ 36,11 36,19 @@ build-win: $(SOURCES)
	cp ./$(RAYLIB_WIN32_MSVC_PATH)/lib/raylib.dll ./dist/$(PROJECT)-windows-32bit/
	cp -R ./assets ./dist/$(PROJECT)-windows-32bit/

build-mac: $(SOURCES)
	mkdir -p ./dist/$(PROJECT)-macos
	o64-clang -Iinclude -I$(RAYLIB_MACOS_PATH)/include -MMD -MP $^ -L$(RAYLIB_MACOS_PATH)/lib -lraylib -lm -framework CoreVideo -framework CoreAudio -framework IOKit -framework Cocoa -framework GLUT -framework OpenGL -o ./dist/$(PROJECT)-macos/$(PROJECT)
	cp $(RAYLIB_MACOS_PATH)/lib/libraylib.5.0.0.dylib $(RAYLIB_MACOS_PATH)/lib/libraylib.500.dylib ./dist/$(PROJECT)-macos/
	cp -R ./assets ./dist/$(PROJECT)-macos/
build-mac: build-mac-x86_64 build-mac-arm64

build-mac-x86_64: $(SOURCES)
	mkdir -p ./dist/$(PROJECT)-macos-intel-64bit
	o64-clang -Iinclude -I$(RAYLIB_MACOS_PATH)/include -MMD -MP $^ -L$(RAYLIB_MACOS_PATH)/lib -lraylib -lm -framework CoreVideo -framework CoreAudio -framework IOKit -framework Cocoa -framework GLUT -framework OpenGL -o ./dist/$(PROJECT)-macos-intel-64bit/$(PROJECT)
	cp $(RAYLIB_MACOS_PATH)/lib/libraylib.5.0.0.dylib $(RAYLIB_MACOS_PATH)/lib/libraylib.500.dylib ./dist/$(PROJECT)-macos-intel-64bit/
	cp -R ./assets ./dist/$(PROJECT)-macos-intel-64bit/

build-mac-arm64: $(SOURCES)
	mkdir -p ./dist/$(PROJECT)-macos-arm64
	o64-clang -Iinclude -I$(RAYLIB_MACOS_PATH)/include -MMD -MP $^ -L$(RAYLIB_MACOS_PATH)/lib -lraylib -lm -framework CoreVideo -framework CoreAudio -framework IOKit -framework Cocoa -framework GLUT -framework OpenGL -o ./dist/$(PROJECT)-macos-arm64/$(PROJECT)
	cp $(RAYLIB_MACOS_PATH)/lib/libraylib.5.0.0.dylib $(RAYLIB_MACOS_PATH)/lib/libraylib.500.dylib ./dist/$(PROJECT)-macos-arm64/
	cp -R ./assets ./dist/$(PROJECT)-macos-arm64/

run-linux: ./dist/$(PROJECT)-linux/$(PROJECT)
	cd ./dist/$(PROJECT)-linux && ./$(PROJECT)


@@ 64,9 72,15 @@ clean-win:
	rm -rf ./dist/$(PROJECT)-windows-32bit
	rm -f ./dist/$(PROJECT)-windows-32bit.zip

clean-mac:
	rm -rf ./dist/$(PROJECT)-macos
	rm -f ./dist/$(PROJECT)-macos.tar.gz
clean-mac-x86_64:
	rm -rf ./dist/$(PROJECT).app
	rm -rf ./dist/$(PROJECT)-macos-intel-64bit
	rm -f ./dist/$(PROJECT)-macos-intel-64bit.tar.gz

clean-mac-arm64:
	rm -rf ./dist/$(PROJECT).app
	rm -rf ./dist/$(PROJECT)-macos-arm64
	rm -f ./dist/$(PROJECT)-macos-arm64.tar.gz

release-linux: clean-linux build-linux
	rm -f ./dist/$(PROJECT)-linux/assets/**/*.sunvox


@@ 91,15 105,31 @@ release-win: clean-win build-win
	cp README.md ./dist/$(PROJECT)-windows-32bit/
	cd ./dist && zip -9 -r $(PROJECT)-windows-32bit.zip $(PROJECT)-windows-32bit

release-mac: clean-mac build-mac
	rm -f ./dist/$(PROJECT)-macos/assets/**/*.sunvox
	rm -f ./dist/$(PROJECT)-macos/assets/**/*.rfx
	rm -f ./dist/$(PROJECT)-macos/assets/**/*.pxo
	cp README.md ./dist/$(PROJECT)-macos/
release-mac: release-mac-x86_64 release-mac-arm64

release-mac-x86_64: clean-mac-x86_64 build-mac-x86_64
	rm -f ./dist/$(PROJECT)-macos-intel-64bit/assets/**/*.sunvox
	rm -f ./dist/$(PROJECT)-macos-intel-64bit/assets/**/*.rfx
	rm -f ./dist/$(PROJECT)-macos-intel-64bit/assets/**/*.pxo
	cp README.md ./dist/$(PROJECT)-macos-intel-64bit/
	mkdir ./dist/$(PROJECT).app
	mkdir ./dist/$(PROJECT).app/Contents
	mkdir ./dist/$(PROJECT).app/Contents/MacOS
	mkdir ./dist/$(PROJECT).app/Contents/Resources
	cp ./dist/static/Info.plist ./dist/$(PROJECT).app/Contents/Info.plist
	cp -R ./dist/$(PROJECT)-macos-intel-64bit/* ./dist/$(PROJECT).app/Contents/MacOS/
	cd ./dist && tar czvf $(PROJECT)-macos-intel-64bit.tar.gz $(PROJECT).app

release-mac-arm64: clean-mac-arm64 build-mac-arm64
	rm -f ./dist/$(PROJECT)-macos-arm64/assets/**/*.sunvox
	rm -f ./dist/$(PROJECT)-macos-arm64/assets/**/*.rfx
	rm -f ./dist/$(PROJECT)-macos-arm64/assets/**/*.pxo
	cp README.md ./dist/$(PROJECT)-macos-arm64/
	mkdir ./dist/$(PROJECT).app
	mkdir ./dist/$(PROJECT).app/Contents
	mkdir ./dist/$(PROJECT).app/Contents/MacOS
	mkdir ./dist/$(PROJECT).app/Contents/Resources
	cp ./dist/static/Info.plist ./dist/$(PROJECT).app/Contents/Info.plist
	cp -R ./dist/$(PROJECT)-macos/* ./dist/$(PROJECT).app/Contents/MacOS/
	cp -R ./dist/$(PROJECT)-macos-arm64/* ./dist/$(PROJECT).app/Contents/MacOS/
	cd ./dist && tar czvf $(PROJECT)-macos-arm64.tar.gz $(PROJECT).app