makefile 473 B

123456789101112131415161718
  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. all: $(linux-artifact) $(win-artifact)
  7. $(linux-artifact): main.cpp
  8. $(linux-compiler) main.cpp -o $(linux-artifact)
  9. $(win-artifact): main.cpp
  10. $(win-compiler) main.cpp -o $(win-artifact)
  11. clean:
  12. rm -f $(linux-artifact) $(win-artifact)