forked from waycrate/wayshot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (37 loc) · 1021 Bytes
/
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
BINARY := wayshot
BUILDFLAGS := --release
TARGET_DIR := /usr/bin
SOURCE_DIR := ./target/release
MAN1_DIR := /usr/share/man/man1
MAN7_DIR := /usr/share/man/man7
all: build
build:
@$(MAKE) -C ./xdg-desktop-portal-wlr/ -s $@
@cargo build $(BUILDFLAGS)
run:
@$(MAKE) -C ./xdg-desktop-portal-wlr/ -s $@ &
@cargo run
install: build
@mkdir -p $(TARGET_DIR)
@cp $(SOURCE_DIR)/$(BINARY) $(TARGET_DIR)
@chmod +x $(TARGET_DIR)/$(BINARY)
@find ./docs -type f -iname "*.1.gz" -exec cp {} $(MAN1_DIR) \;
@find ./docs -type f -iname "*.7.gz" -exec cp {} $(MAN7_DIR) \;
@$(MAKE) -C ./xdg-desktop-portal-wlr/ -s $@
uninstall:
@rm -f $(TARGET_DIR)/$(BINARY)
@rm -f /usr/share/man/**/wayshot.*
@$(MAKE) -C ./xdg-desktop-portal-wlr/ -s $@
check:
@cargo fmt
@cargo check
@cargo clippy
@$(MAKE) -C ./xdg-desktop-portal-wlr/ -s $@
clean:
@cargo clean
@rm -f ./docs/*.1.gz
@$(MAKE) -C ./xdg-desktop-portal-wlr/ -s $@
setup:
@rustup install stable
@rustup default stable
.PHONY: check clean setup all install build