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