A simple example of Metal written in Objective-C++ which can be compiled in command-line.
export PATH="$PATH:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/usr/bin
or
echo 'export PATH="$PATH:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/usr/bin"' >> ~/.bashrc
Just run the following command:
make shaders.metallib
or, if you want to do it manually:
metal -std=osx-metal1.1 -o shaders.air shaders.metal
metal-ar r shaders.metal-ar shaders.air
metallib -o shaders.metallib shaders.metal-ar