# To compile this you will need MinGW with MSYS installed in PATH CPPFLAGS=-Wall -Wno-misleading-indentation -Werror --std=c++1z -g -flto LDFLAGS= INCLUDES=-Ipge/include EXECUTABLE=awoorwae ifeq ($(OS),Windows_NT) LIBRARIES=-luser32 -lgdi32 -lopengl32 -lgdiplus -lwinmm EXECUTABLE+=.exe LDFLAGS+=--machine=windows CPP=i686-w64-mingw32-g++ CC=i686-w64-mingw32-gcc else LIBRARIES=-lX11 -lGL -lpthread -lpng -lasound CC=gcc CPP=g++ endif SOURCES=$(wildcard src/*.cpp) $(wildcard src/**/*.cpp) $(wildcard pge/src/*.cpp) OBJECTS=$(SOURCES:.cpp=.o) all: $(SOURCES) $(EXECUTABLE) $(MAKE) -C packer all clean: $(RM) $(OBJECTS) $(EXECUTABLE) $(MAKE) -C packer clean $(EXECUTABLE): $(OBJECTS) $(CPP) $(LDFLAGS) $(OBJECTS) -o $@ $(LIBRARIES) .cpp.o: $(CPP) $(INCLUDES) -c $(CPPFLAGS) $< -o $@ run: $(EXECUTABLE) ./$(EXECUTABLE)