my xfce4 dotfiles
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.

46 lines
1.3 KiB

3 years ago
  1. APPNAME ?= gitstatusd
  2. OBJDIR ?= obj
  3. CXX ?= g++
  4. ZSH := $(shell command -v zsh 2> /dev/null)
  5. VERSION ?= $(shell . ./build.info && printf "%s" "$$gitstatus_version")
  6. # Note: -fsized-deallocation is not used to avoid binary compatibility issues on macOS.
  7. #
  8. # Sized delete is implemented as __ZdlPvm in /usr/lib/libc++.1.dylib but this symbol is
  9. # missing in macOS prior to 10.13.
  10. CXXFLAGS += -std=c++14 -funsigned-char -O3 -DNDEBUG -DGITSTATUS_VERSION=$(VERSION) -Wall -Werror # -g -fsanitize=thread
  11. LDFLAGS += -pthread # -fsanitize=thread
  12. LDLIBS += -lgit2 # -lprofiler -lunwind
  13. SRCS := $(shell find src -name "*.cc")
  14. OBJS := $(patsubst src/%.cc, $(OBJDIR)/%.o, $(SRCS))
  15. all: $(APPNAME)
  16. $(APPNAME): usrbin/$(APPNAME)
  17. usrbin/$(APPNAME): $(OBJS)
  18. $(CXX) $(OBJS) $(LDFLAGS) $(LDLIBS) -o $@
  19. $(OBJDIR):
  20. mkdir -p -- $(OBJDIR)
  21. $(OBJDIR)/%.o: src/%.cc Makefile build.info | $(OBJDIR)
  22. $(CXX) $(CXXFLAGS) -MM -MT $@ src/$*.cc >$(OBJDIR)/$*.dep
  23. $(CXX) $(CXXFLAGS) -Wall -c -o $@ src/$*.cc
  24. clean:
  25. rm -rf -- $(OBJDIR)
  26. zwc:
  27. $(or $(ZSH),:) -fc 'for f in *.zsh install; do zcompile -R -- $$f.zwc $$f || exit; done'
  28. minify:
  29. rm -rf -- .clang-format .git .gitattributes .gitignore .vscode deps docs src usrbin/.gitkeep LICENSE Makefile README.md build mbuild
  30. pkg: zwc
  31. GITSTATUS_DAEMON= GITSTATUS_CACHE_DIR=$(shell pwd)/usrbin ./install -f
  32. -include $(OBJS:.o=.dep)