Makefile 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  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/GLAD folder on Windows
  10. SFML_DIR = C:/Users/Ricky/MinGW-Libs/SFML
  11. GLAD_DIR = C:/Users/Ricky/MinGW-Libs/GLAD
  12. BIN := $(BIN).exe
  13. LIBS = -lmingw32 -DSFML_STATIC -lsfml-window-s -lsfml-system-s -lopengl32 -lwinmm -lgdi32
  14. else
  15. # Edit the line below to point to your SFML/GLAD folder on Linux/MacOS
  16. SFML_DIR = /home/ricky/Libraries/SFML
  17. GLAD_DIR = /home/ricky/Libraries/GLAD
  18. UNAME_S := $(shell uname -s)
  19. ifeq ($(UNAME_S),Darwin)
  20. LIBS = -lsfml-window -lsfml-system -pthread -framework OpenGL
  21. else
  22. LIBS = -DSFML_STATIC -lsfml-window-s -lsfml-system-s -pthread -ludev -lGL -lX11 -lXrandr
  23. endif
  24. endif
  25. SFML_INC = -I $(SFML_DIR)/include
  26. SFML_LIB = -L $(SFML_DIR)/lib
  27. GLAD_INC = -I $(GLAD_DIR)/include
  28. GLAD_SRC = $(GLAD_DIR)/src/glad.c
  29. $(BIN):
  30. $(CC) $(GLAD_SRC) $(SRC) $(CFLAGS) $(GLAD_INC) $(SFML_INC) $(SFML_LIB) $(SFML_EXT) -o $(BIN) $(LIBS)