forked from StrataWM/strata
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
44 lines (33 loc) · 853 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
PREFIX ?= /usr
SYSCONFDIR ?= /etc
BINDIR = $(PREFIX)/bin
SHAREDIR = $(PREFIX)/share
XDG_CONFIG_HOME ?= $(HOME)/.config
APPNAME = strata
LUA_LIB = lua
ID = com.strata.Compositor
TARGET = release
DEBUG ?= 0
TARGET_BIN = $(DESTDIR)$(BINDIR)/$(APPNAME)
TARGET_LIB = $(DESTDIR)$(SHAREDIR)/$(APPNAME)/
ifeq ($(DEBUG),0)
TARGET = release
ARGS += --release
endif
all: $(APPNAME)
$(APPNAME):
cargo build $(ARGS)
clean:
cargo clean
install: $(APPNAME) install_lib install_default_config
install -Dm0755 "target/$(TARGET)/$(APPNAME)" "$(TARGET_BIN)"
install_lib:
mkdir -p "$(TARGET_LIB)"
cp -r "lua" "$(TARGET_LIB)"
install_default_config:
mkdir -p "$(XDG_CONFIG_HOME)/$(APPNAME)"
cp "./strata.default.lua" "$(XDG_CONFIG_HOME)/$(APPNAME)/config.lua"
uninstall:
rm -f "$(TARGET_BIN)"
rm -rf "$(TARGET_LIB)"
.PHONY: all clean install uninstall