I'm learning opengl these days and I'm compiling from command line (I don't want to use IDE because I'm used to VIM). Compiling the opengl files can be troublesome, say if I have a file called hello.cpp, for quickly compile&run I have to do:
g++ -framework GLUT -framework OpenGL -framework Cocoa hello.cpp & ./a.out
Since I'm learning opengl I'll be testing with lots of different files and it's not feasible for me to type the above command all the time. What I want is something like:
some_command % & ./a.out
The some_command is best to be some commonly used ones (like g++, make), and % is the filename.
I think makefile might be a possible solution, so I went ahead and learnt about makefile but it seems to be working for a specific name; there're methods to pass parameters to makefile but still it seems too troublesome for me (I have to manually type-in the ARGUMENT=filename part).
Also I think shell script might be a good solution.. the only fallback is that I have to self-define a name for the shell-script.
I want to know if there is any better way for me to quickly compile&run the opengl cpp files
Thanks a lot.