My motivation for this pull request came from when I cloned a clean git repo on my Windows 7 box using Visual Studio 2013. After fixing a few small issues that were documented online or through course websites (e.g. #include for std::min), I still was hitting a build error.
After digging a bit deeper, I discovered that the make file was assuming that I had cygwin installed and that bison and flex lived inside of cygwin's install directory. I decided that this was a fairly big assumption to make so I brushed up on batch and make to figure out a better alternative.
Things to note:
The for loop iterates over Windows' available drives and searches for win_bison.exe and winflex.exe if they have not been previously defined. I was concerned about renamed files (e.g. someone cutting the win from the file name), but this seemed like a good solution for most use cases.
I tried to accomplish the same search functionality inside the makefile but nmake is missing a few needed capabilities. I assumed that nmake was used because it comes packaged with Visual Studio. I instead chose to search from the batch file and then pass to the makefile through command line arguments.
Once finished, I cleaned/rebuilt my VS solution and it finished without errors.
I only made changes in the vs2012 directory. I already had to update the .sln and related files to vs2013. If this PR is accepted, I would recommend making similar changes to the other visual studio offerings and adding a vs2013 dir. I did not do so for this PR to make the proposed change explicitly clear.
Please let me know if you have any questions on the questions or suggestions for how this can be improved. I hope this can be merged in soonish to save some other Windows users some time.
My motivation for this pull request came from when I cloned a clean git repo on my Windows 7 box using Visual Studio 2013. After fixing a few small issues that were documented online or through course websites (e.g. #include for std::min), I still was hitting a build error.
After digging a bit deeper, I discovered that the make file was assuming that I had cygwin installed and that bison and flex lived inside of cygwin's install directory. I decided that this was a fairly big assumption to make so I brushed up on batch and make to figure out a better alternative.
Things to note:
Please let me know if you have any questions on the questions or suggestions for how this can be improved. I hope this can be merged in soonish to save some other Windows users some time.