-
Notifications
You must be signed in to change notification settings - Fork 24
/
Makefile
51 lines (38 loc) · 1.15 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
installdir=$(HOME)/.weechat
testdir=./test_dir
ifneq ($(wildcard /usr/include/openssl-1.0),)
export OPENSSL_INCLUDE_DIR=/usr/include/openssl-1.0
else ifneq ($(wildcard /usr/local/opt/openssl/include),)
export OPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include
endif
ifneq ($(wildcard /usr/lib/openssl-1.0),)
export OPENSSL_LIB_DIR=/usr/lib/openssl-1.0
else ifneq ($(wildcard /usr/local/opt/openssl/lib),)
export OPENSSL_LIB_DIR=/usr/local/opt/openssl/lib
endif
.PHONY: all install install_test test run format clippy
all: src/*
cargo build --release
all_debug: src/*
cargo build
install: all | $(installdir)/plugins
cp target/release/libweecord.* $(installdir)/plugins
install_test: all_debug | $(testdir)/plugins
cp target/debug/libweecord.* $(testdir)/plugins
run: install
weechat -a
test: install_test
weechat -a -d $(testdir)
$(installdir):
mkdir $@
$(installdir)/plugins: | $(installdir)
mkdir $@
$(testdir):
mkdir $@
$(testdir)/plugins: | $(testdir)
mkdir $@
format:
cargo fmt -- --write-mode=overwrite
clang-format -style=mozilla -i src/*.c
clippy:
rustup run nightly cargo rustc --features clippy -- -Z no-trans -Z extra-plugins=clippy