Makefile 833 B

123456789101112131415161718192021222324252627282930313233
  1. # Install
  2. CC = g++
  3. BIN = demo
  4. # Flags
  5. CFLAGS += -s -Wall -Wextra -pedantic
  6. SRC = main.cpp
  7. OBJ = $(SRC:.cpp=.o)
  8. ifeq ($(OS),Windows_NT)
  9. # Edit the line below to point to your SFML folder on Windows
  10. SFML_DIR = C:/Users/Ricky/MinGW-Libs/SFML
  11. BIN := $(BIN).exe
  12. LIBS = -lmingw32 -DSFML_STATIC -lsfml-window-s -lsfml-system-s -lopengl32 -lwinmm -lgdi32
  13. else
  14. # Edit the line below to point to your SFML folder on Linux/MacOS
  15. SFML_DIR = /home/ricky/Libraries/SFML
  16. UNAME_S := $(shell uname -s)
  17. ifeq ($(UNAME_S),Darwin)
  18. LIBS = -lsfml-window -lsfml-system -pthread -framework OpenGL
  19. else
  20. LIBS = -DSFML_STATIC -lsfml-window -lsfml-system -pthread -ludev -lGL -lX11 -lXrandr
  21. endif
  22. endif
  23. SFML_INC = -I $(SFML_DIR)/include
  24. SFML_LIB = -L $(SFML_DIR)/lib
  25. $(BIN):
  26. $(CC) $(SRC) $(CFLAGS) -o $(BIN) $(SFML_INC) $(SFML_LIB) $(LIBS)