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.2KB

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