Build your own tool chain which is compliant with your path environment, it's an easy build process and I've scripted it in OSX for ppc and there are some downloadable source packages which include the build scripts, try
BUILD-YOUR-OWN.
Mihai is MIA for more than 75 days now, don't expect a response and even then it is doubtful he can help as the code is pretty much how the CubeMX software provided it with minor changes/additions and I don't believe he has that thorough of an understanding of how the whole thing works and I would say at this time you know more.
You can look at other projects such as the STMBL project which is STM32F1 based if you want to see how encoders with index is implemented.