4 LIBS = sdl2 SDL2_image glew
6 PKGFLAGS := $(shell pkg-config --cflags $(LIBS))
7 PKGLIBS := $(shell pkg-config --libs $(LIBS))
10 CPPFLAGS += $(PKGFLAGS)
14 LDXXFLAGS += $(PKGLIBS)
25 SRC = $(wildcard $(SOURCE_DIR)/*.cpp)
26 OBJ = $(patsubst $(SOURCE_DIR)/%.cpp, $(BUILD_DIR)/%.o, $(SRC))
33 rm -df $(OBJ) $(DEP) $(BUILD_DIR)
38 .PHONY: all clean distclean
44 @$(LDXX) -o $@ $(CXXFLAGS) $(LDXXFLAGS) $^
46 $(BUILD_DIR)/%.o: $(SOURCE_DIR)/%.cpp | $(BUILD_DIR)
48 @$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ -MMD -MP -MF"$(@:.o=.d)" -MT"$@" $<