diff options
author | romkatv <roman.perepelitsa@gmail.com> | 2020-05-10 16:58:05 +0300 |
---|---|---|
committer | romkatv <roman.perepelitsa@gmail.com> | 2020-05-10 16:58:05 +0300 |
commit | 97fac973afa021ae3ef49e0feae203fd09b231e1 (patch) | |
tree | 5c1ba4f09905cc53fdfc75d3668a876d3e14a447 /gitstatus/Makefile | |
parent | c159f3aaefe13724421655d06df990b2ddf23e59 (diff) | |
parent | 1531d6e5439daae01627b2645684876b75eaf5eb (diff) |
Merge commit '1531d6e5439daae01627b2645684876b75eaf5eb' as 'gitstatus'
Diffstat (limited to 'gitstatus/Makefile')
-rw-r--r-- | gitstatus/Makefile | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/gitstatus/Makefile b/gitstatus/Makefile new file mode 100644 index 00000000..d665af1f --- /dev/null +++ b/gitstatus/Makefile @@ -0,0 +1,36 @@ +APPNAME ?= gitstatusd +OBJDIR ?= obj + +CXX ?= g++ + +VERSION ?= $(shell . ./build.info && printf "%s" "$$gitstatus_version") + +# Note: -fsized-deallocation is not used to avoid binary compatibility issues on macOS. +# +# Sized delete is implemented as __ZdlPvm in /usr/lib/libc++.1.dylib but this symbol is +# missing in macOS prior to 10.13. +CXXFLAGS += -std=c++14 -funsigned-char -O3 -DNDEBUG -DGITSTATUS_VERSION=$(VERSION) -Wall -Werror # -g -fsanitize=thread +LDFLAGS += -pthread # -fsanitize=thread +LDLIBS += -lgit2 # -lprofiler -lunwind + +SRCS := $(shell find src -name "*.cc") +OBJS := $(patsubst src/%.cc, $(OBJDIR)/%.o, $(SRCS)) + +all: $(APPNAME) + +$(APPNAME): usrbin/$(APPNAME) + +usrbin/$(APPNAME): $(OBJS) + $(CXX) $(OBJS) $(LDFLAGS) $(LDLIBS) -o $@ + +$(OBJDIR): + mkdir -p -- $(OBJDIR) + +$(OBJDIR)/%.o: src/%.cc Makefile build.info | $(OBJDIR) + $(CXX) $(CXXFLAGS) -MM -MT $@ src/$*.cc >$(OBJDIR)/$*.dep + $(CXX) $(CXXFLAGS) -Wall -c -o $@ src/$*.cc + +clean: + rm -rf -- $(OBJDIR) + +-include $(OBJS:.o=.dep) |