Makefile 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. TARGET = build/neosu
  2. SOURCES = $(shell find src -type f -name '*.cpp')
  3. OBJECTS = $(patsubst src/%.cpp, obj/%.o, $(SOURCES))
  4. HEADERS = $(shell find src -type f -name '*.h')
  5. LIBS = blkid freetype2 glew libenet libjpeg liblzma xi zlib
  6. CXXFLAGS = -std=c++17 -fmessage-length=0 -fno-exceptions -Wno-sign-compare -Wno-unused-local-typedefs -Wno-reorder -Wno-switch -Wall
  7. CXXFLAGS += `pkgconf --static --cflags $(LIBS)` `curl-config --cflags`
  8. CXXFLAGS += -Isrc/App -Isrc/App/Osu -Isrc/Engine -Isrc/GUI -Isrc/GUI/Windows -Isrc/GUI/Windows/VinylScratcher -Isrc/Engine/Input -Isrc/Engine/Platform -Isrc/Engine/Main -Isrc/Engine/Renderer -Isrc/Util
  9. CXXFLAGS += -Ilibraries/bass/include -Ilibraries/bassasio/include -Ilibraries/bassfx/include -Ilibraries/bassmix/include -Ilibraries/basswasapi/include -Ilibraries/bassloud/include
  10. CXXFLAGS += -O2 -g3 -fsanitize=address
  11. LDFLAGS = -ldiscord-rpc -lbass -lbassmix -lbass_fx -lbassloud -lstdc++
  12. LDFLAGS += `pkgconf --static --libs $(LIBS)` `curl-config --static-libs --libs`
  13. LDFLAGS += -Lrosu-pp-c/target/release -lrosu_pp_c
  14. $(TARGET): build $(OBJECTS) $(HEADERS) rosu-pp-c/target/release/librosu_pp_c.a
  15. @echo "CC" $(TARGET)
  16. @$(CXX) -o $(TARGET) $(OBJECTS) $(CXXFLAGS) $(LDFLAGS)
  17. obj/%.o: src/%.cpp
  18. @echo "CC" $<
  19. @mkdir -p $(dir $@)
  20. @$(CXX) -c $< -o $@ $(CXXFLAGS)
  21. rosu-pp-c/target/release/librosu_pp_c.a:
  22. @mkdir -p obj
  23. cd rosu-pp-c && cargo build --release
  24. build:
  25. cp -nr resources build
  26. .PHONY: clean
  27. clean:
  28. rm -rf build obj