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