makefile 433 B

12345678910111213141516
  1. linux-artifact = hello-linux.out
  2. win-artifact = hello-windows.exe
  3. linux-compiler = g++
  4. # Embed c and c++ libraries (see https://stackoverflow.com/a/6405064)
  5. win-compiler = i686-w64-mingw32-g++-win32 -static-libstdc++ -static-libgcc
  6. $(linux-artifact): main.cpp
  7. $(linux-compiler) main.cpp -o $(linux-artifact)
  8. $(win-artifact): main.cpp
  9. $(win-compiler) main.cpp -o $(win-artifact)
  10. clean:
  11. rm -f $(linux-artifact) $(win-artifact)