Re:Interesting commands for the Linux shell
by tych0 on Thursday September 14, 2017 @01:06PM
(#15250035)
Worth noting that for the particular case you've cited, you can just use make, even without a makefile:
~ cat test.cpp
#include <iostream>
using namespace std;
int main()
{
cout << "hi\n";
return 0;
}
~ stat Makefile
stat: cannot stat 'Makefile': No such file or directory
~ 1 make test
g++ test.cpp -o test
~ ./test
hi
Re:Interesting commands for the Linux shell
by godelski on Thursday September 14, 2017 @11:16PM
(#15254315)
Well you learn something every day. That's pretty awesome! Is there an easy way to add options? Like -O2
Re:Interesting commands for the Linux shell
by agumonkey on Thursday September 14, 2017 @01:57PM
(#15250647)
yeah, reading make man, and also http://nullprogram.com/blog/2017/08/20/
g++ -o foo{,.cpp}