1234567891011121314151617181920212223242526272829303132 |
- CPPFLAGS=-Wall -Wno-misleading-indentation -Werror --std=c++1z
- LDFLAGS=
- INCLUDES=-I./pge/include
- ifeq ($(OS),Windows_NT)
- LIBRARIES=-luser32 -lgdi32 -lgdiplus
- EXECUTABLE=packer.exe
- CPP=i686-w64-mingw32-g++
- CC=i686-w64-mingw32-gcc
- else
- EXECUTABLE=packer
- LIBRARIES=-lpng
- CC=gcc
- CPP=g++
- endif
- ifeq ($(DEBUG),1)
- CPPFLAGS+=-g -Og
- else
- CPPFLAGS+=-flto -O3
- endif
- SOURCES=$(wildcard src/*.cpp) $(wildcard pge/src/*.cpp)
- OBJECTS=$(SOURCES:.cpp=.o)
-
- all: $(SOURCES) $(EXECUTABLE)
-
- clean:
- $(RM) $(OBJECTS) $(EXECUTABLE)
-
- $(EXECUTABLE): $(OBJECTS)
- $(CPP) $(LDFLAGS) $(OBJECTS) -o $@ $(LIBRARIES)
-
- .cpp.o:
- $(CPP) $(INCLUDES) -c $(CPPFLAGS) $< -o $@
|