Няма описание
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # To compile this you will need MinGW with MSYS installed in PATH
  2. CPPFLAGS=-Wall -Wno-misleading-indentation -Werror --std=c++1z
  3. LDFLAGS=
  4. INCLUDES=-Ipge/include
  5. EXECUTABLE=awoorwae
  6. PACKER=packer/packer
  7. ifeq ($(OS),Windows_NT)
  8. LIBRARIES=-luser32 -lgdi32 -lopengl32 -lgdiplus -lwinmm
  9. EXECUTABLE+=.exe
  10. PACKER+=.exe
  11. LDFLAGS+=--machine=windows
  12. CPP=i686-w64-mingw32-g++
  13. CC=i686-w64-mingw32-gcc
  14. else
  15. LIBRARIES=-lX11 -lGL -lpthread -lpng -lasound
  16. CC=gcc
  17. CPP=g++
  18. endif
  19. ifeq ($(DEBUG),1)
  20. CPPFLAGS+=-g -Og
  21. else
  22. CPPFLAGS+=-flto -O3
  23. endif
  24. SOURCES=$(wildcard src/*.cpp) $(wildcard src/**/*.cpp) $(wildcard pge/src/*.cpp)
  25. IMAGES=$(wildcard res/*.png)
  26. OBJECTS=$(SOURCES:.cpp=.o)
  27. SPRITES=$(IMAGES:.png=.spr)
  28. all: $(SOURCES) $(SPRITES) $(EXECUTABLE)
  29. clean:
  30. $(RM) $(OBJECTS) $(SPRITES) $(EXECUTABLE)
  31. $(EXECUTABLE): $(OBJECTS)
  32. $(CPP) $(LDFLAGS) $(OBJECTS) -o $@ $(LIBRARIES)
  33. .cpp.o:
  34. $(CPP) $(INCLUDES) -c $(CPPFLAGS) $< -o $@
  35. %.spr: %.png $(PACKER)
  36. $(PACKER) --convert $< $@
  37. run: $(SPRITES) $(EXECUTABLE)
  38. ./$(EXECUTABLE)
  39. $(PACKER):
  40. $(MAKE) -C packer