makefile 431 B

12345678910111213141516171819
  1. # super simple makefile
  2. # call it using 'make NAME=name_of_code_file_without_extension'
  3. # (assumes a .cpp extension)
  4. NAME = "hello"
  5. # Add $(MAC_OPT) to the compile line for macOS
  6. # (should be ignored by Linux, set to nothing if causing problems)
  7. MAC_OPT = -I/opt/X11/include
  8. all:
  9. @echo "Compiling..."
  10. g++ -o $(NAME) $(NAME).cpp -L/opt/X11/lib -lX11 -lstdc++ $(MAC_OPT)
  11. run: all
  12. @echo "Running..."
  13. ./$(NAME)
  14. clean:
  15. -rm *o