Hacker News new | ask | show | jobs
by tych0 3198 days ago
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
2 comments

Well you learn something every day. That's pretty awesome! Is there an easy way to add options? Like -O2
yeah, reading make man, and also http://nullprogram.com/blog/2017/08/20/