123456789101112131415161718192021222324252627282930313233343536373839 |
- # To compile this you will need MinGW64 with MSYS installed in PATH
-
- CC=gcc
- CPP=g++
- CFLAGS=-m64 -Wall -Wno-misleading-indentation -Werror -g
- CPPFLAGS=-m64 -Wall -Wno-misleading-indentation -Werror --std=c++1z -g
- LDFLAGS=-m64
- 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
- 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)
|