include setup.mk CC = gcc CXX = g++ ifeq ($(TARGET_OS),linux) LIBS = -lpthread -lGL -lGLEW -lfreetype \ -lSDL2 -lSDL2_image -lSDL2_mixer -lSDL2main endif ifeq ($(TARGET_OS),win32) LIBS = -lopengl32 -lglew32 -lmingw32 \ -lSDL2main -lSDL2 -lSDL2_image -lSDL2_mixer -lfreetype endif CXXFLAGS = -m$(TARGET_BITS) -std=c++11 CXXINC = -Iinclude -Iinclude/freetype2 CXXWARN = -Wall -Wextra -Werror CXXSRCDIR = src CXXOUTDIR = out CXXSRC = $(wildcard $(CXXSRCDIR)/*.cpp) CXXOBJ = $(patsubst $(CXXSRCDIR)/%.cpp, $(CXXOUTDIR)/%.o, $(CXXSRC)) EXEC = main all: $(EXEC) clean: rm -f $(EXEC) rm -f out/*.o $(EXEC): $(CXXOUTDIR)/$(CXXOBJ) @echo " CXX/LD main" @$(CXX) $(CXXFLAGS) $(CXXINC) $(CXXWARN) -o $(EXEC) main.cpp out/*.o $(LIBS) $(CXXOUTDIR)/%.o: $(CXXSRCDIR)/%.cpp @echo " CXX " $< @$(CXX) $(CXXFLAGS) $(CXXINC) $(CXXWARN) $(LIBS) -c $< -o $@