説明なし
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

Makefile 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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=-Iinclude -Ipge/include
  5. ifeq ($(OS),Windows_NT)
  6. LIBRARIES=-luser32 -lgdi32 -lopengl32 -lgdiplus -lwinmm
  7. EXECUTABLE=awoorwae.exe
  8. PACKER=packer/packer.exe
  9. ifneq ($(DEBUG),1)
  10. LDFLAGS+=--machine=windows
  11. endif
  12. CPP=i686-w64-mingw32-g++
  13. CC=i686-w64-mingw32-gcc
  14. MAKE=mingw32-make
  15. else
  16. LIBRARIES=-lX11 -lGL -lpthread -lpng -lasound
  17. EXECUTABLE=awoorwae
  18. PACKER=packer/packer
  19. CC=gcc
  20. CPP=g++
  21. endif
  22. ifeq ($(DEBUG),1)
  23. CPPFLAGS+=-g -Og -D_DEBUG
  24. else
  25. CPPFLAGS+=-flto -O3
  26. endif
  27. SOURCES=$(wildcard src/*.cpp) $(wildcard src/**/*.cpp) $(wildcard pge/src/*.cpp)
  28. IMAGES=$(wildcard res/*.png)
  29. OBJECTS=$(SOURCES:.cpp=.o)
  30. SPRITES=$(IMAGES:.png=.pgs)
  31. RESOURCES=$(SPRITES) $(wildcard res/*.wav)
  32. PACK=awoorwae.pgp
  33. all: $(SOURCES) $(PACK) $(EXECUTABLE)
  34. clean:
  35. $(RM) $(OBJECTS) $(SPRITES) $(PACK) $(EXECUTABLE)
  36. $(EXECUTABLE): $(OBJECTS)
  37. $(CPP) $(LDFLAGS) $(OBJECTS) -o $@ $(LIBRARIES)
  38. .cpp.o:
  39. $(CPP) $(INCLUDES) -c $(CPPFLAGS) $< -o $@
  40. %.pgs: %.png $(PACKER)
  41. $(PACKER) --convert $< $@
  42. $(PACK): $(RESOURCES) $(PACKER)
  43. $(PACKER) --add $(PACK) $(RESOURCES)
  44. run: $(PACK) $(EXECUTABLE)
  45. ./$(EXECUTABLE)
  46. $(PACKER):
  47. $(MAKE) -C packer