No Description
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.

Makefile 1.1KB

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