Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (38 loc) · 1.48 KB
/
Copy pathMakefile
File metadata and controls
47 lines (38 loc) · 1.48 KB
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
PREFIX ?= /usr
ODIN ?= odin
DATADIR ?= $(PREFIX)/share
BINDIR ?= $(PREFIX)/bin
LIBEXECDIR ?= $(PREFIX)/libexec
ANUSH_DIR ?= $(DATADIR)/anush
CONFIG_FILES := $(shell find config -type f ! -name .gitkeep)
SHELL_FILES := $(shell find shell -type f ! -path 'shell/scripts/*')
SCRIPT_FILES := $(shell find shell/scripts -type f)
ASSET_FILES := $(shell find assets -type f)
ANUSHCTL_SRCS := $(shell find cmd/anushctl -name '*.odin')
all: build/anushctl
build/anushctl: $(ANUSHCTL_SRCS)
@mkdir -p build
$(ODIN) build cmd/anushctl -o:speed -out:$@
install: build/anushctl
@set -e; \
for src in $(CONFIG_FILES) $(SHELL_FILES) $(ASSET_FILES); do \
install -Dm644 "$$src" "$(DESTDIR)$(ANUSH_DIR)/$$src"; \
done
@set -e; \
for src in $(SCRIPT_FILES); do \
install -Dm755 "$$src" "$(DESTDIR)$(ANUSH_DIR)/$$src"; \
done
install -Dm755 build/anushctl \
"$(DESTDIR)$(BINDIR)/anushctl"
install -Dm755 shell/scripts/hotspot/hotspot-limit-enforcer \
"$(DESTDIR)$(LIBEXECDIR)/anush-hotspot-limit-enforcer"
install -Dm755 shell/scripts/hotspot/hotspot-create-ap-helper \
"$(DESTDIR)$(LIBEXECDIR)/anush-hotspot-create-ap-helper"
install -Dm644 packaging/org.anush.hotspot-limit.policy \
"$(DESTDIR)$(DATADIR)/polkit-1/actions/org.anush.hotspot-limit.policy"
install -Dm644 packaging/org.anush.hotspot-create-ap.policy \
"$(DESTDIR)$(DATADIR)/polkit-1/actions/org.anush.hotspot-create-ap.policy"
@printf 'Installed anush to %s\n' "$(DESTDIR)$(ANUSH_DIR)"
clean:
rm -rf build
.PHONY: all install clean