mirror of https://github.com/bqv/weechat-xmpp
move omemo database, to prepare for more DBs
parent
6b52e59a79
commit
bf6b5d2e0f
@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env -S gmake clean
|
||||
# vim: set noexpandtab:
|
||||
|
||||
.PHONY: tidy
|
||||
tidy:
|
||||
$(FIND) . -name "*.o" -delete
|
||||
$(FIND) . -name "*.gcno" -delete
|
||||
$(FIND) . -name "*.gcda" -delete
|
||||
|
||||
.PHONY: clean
|
||||
clean: tidy
|
||||
$(RM) -f $(OBJS) $(COVS) \
|
||||
sexp/parser.tab.cc sexp/parser.tab.hh \
|
||||
sexp/location.hh sexp/position.hh \
|
||||
sexp/stack.hh sexp/parser.output sexp/parser.o \
|
||||
sexp/lexer.o sexp/lexer.yy.cc sexp/sexp.a
|
||||
$(MAKE) -C deps/diff clean || true
|
||||
git submodule foreach --recursive git clean -xfd || true
|
||||
git submodule foreach --recursive git reset --hard || true
|
||||
|
||||
.PHONY: distclean
|
||||
distclean: clean
|
||||
$(RM) *~ .depend
|
@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env -S gmake depend
|
||||
# vim: set noexpandtab:
|
||||
|
||||
.PHONY: depend
|
||||
depend: $(DEPS) $(SRCS) $(HDRS)
|
||||
echo > ./.depend
|
||||
for src in $(SRCS) tests/main.cc; do \
|
||||
dir="$$(dirname $$src)"; \
|
||||
src="$$(basename $$src)"; \
|
||||
if [[ $$src == *.cpp ]]; then \
|
||||
echo "g++ $(CPPFLAGS) -MM -MMD -MP -MF - \
|
||||
-MT $$dir/.$${src/.cpp/.o} $$dir/$$src >> ./.depend"; \
|
||||
g++ $(CPPFLAGS) -MM -MMD -MP -MF - \
|
||||
-MT $$dir/.$${src/.cpp/.o} $$dir/$$src >> ./.depend || true ; \
|
||||
elif [[ $$src == *.c ]]; then \
|
||||
echo "gcc $(CFLAGS) -MM -MMD -MP -MF - \
|
||||
-MT $$dir/.$${src/.c/.o} $$dir/$$src >> ./.depend"; \
|
||||
gcc $(CFLAGS) -MM -MMD -MP -MF - \
|
||||
-MT $$dir/.$${src/.c/.o} $$dir/$$src >> ./.depend || true ; \
|
||||
else continue; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
include .depend
|
@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env -S gmake install
|
||||
# vim: set noexpandtab:
|
||||
|
||||
HOME ?=~
|
||||
|
||||
install: xmpp.so
|
||||
ifeq ($(shell id -u),0)
|
||||
mkdir -p $(DESTDIR)$(LIBDIR)/weechat/plugins
|
||||
cp xmpp.so $(DESTDIR)$(LIBDIR)/weechat/plugins/xmpp.so
|
||||
chmod 644 $(DESTDIR)$(LIBDIR)/weechat/plugins/xmpp.so
|
||||
else
|
||||
mkdir -p $(HOME)/.weechat/plugins
|
||||
cp xmpp.so $(HOME)/.weechat/plugins/xmpp.so
|
||||
chmod 755 $(HOME)/.weechat/plugins/xmpp.so
|
||||
endif
|
||||
|
||||
release: xmpp.so
|
||||
cp xmpp.so .xmpp.so.$(SUFFIX)
|
||||
ln -sf .xmpp.so.$(SUFFIX) .xmpp.so
|
||||
|
||||
.xmpp.so.%:
|
||||
mkdir src$@
|
||||
objcopy --dump-section .source=/dev/stdout $@ | tar -C src$@ xz
|
||||
|
||||
.PHONY: install release .xmpp.so.%
|
@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env -S gmake test coverage
|
||||
# vim: set noexpandtab:
|
||||
|
||||
.PHONY: debug
|
||||
debug: xmpp.so
|
||||
env LD_PRELOAD=$(DEBUG) gdb -ex "handle SIGPIPE nostop noprint pass" --args \
|
||||
weechat -a -P 'alias,buflist,exec,irc,relay' -r '/plugin load ./xmpp.so'
|
||||
|
||||
tests/xmpp.cov.so: $(COVS) $(DEPS) $(HDRS)
|
||||
$(CXX) --coverage -shared $(LDFLAGS) -o tests/xmpp.cov.so -Wl,--as-needed $(DEPS) $(LDLIBS) $(COVS)
|
||||
|
||||
tests/run: $(COVS) tests/main.cc tests/xmpp.cov.so $(wildcard tests/*.inl)
|
||||
cd tests && $(CXX) $(CPPFLAGS) $(LDFLAGS) -o run $$PWD/xmpp.cov.so main.cc $(patsubst %,../%,$(DEPS)) $(LDLIBS)
|
||||
|
||||
.PHONY: test
|
||||
test: tests/run
|
||||
cd tests && ./run -sm
|
||||
|
||||
.PHONY: coverage
|
||||
coverage: tests/run
|
||||
gcovr --txt -s
|
||||
|
||||
.PHONY: check
|
||||
check:
|
||||
clang-check --analyze *.c *.cc *.cpp
|
Loading…
Reference in New Issue