-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
35 lines (25 loc) · 774 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
#!/bin/make
all: build
build: auto-rotate
src = auto-rotate.c
auto-rotate: $(src)
gcc $(src) `pkg-config --cflags --libs glib-2.0 gio-2.0 xrandr x11 xi` -o $@
install: build
cp auto-rotate /usr/local/bin
config-systemd:
mkdir -p ~/.config/systemd/user
cp auto-rotate.service ~/.config/systemd/user/
systemctl --user enable auto-rotate
systemctl --user start auto-rotate
systemctl --user status auto-rotate
loginctl enable-linger $(USER)
config-systemv:
echo "Use systemd instead"
sudo cp auto-rotate.sh /etc/init.d/
echo "You still have to adjust the run-levels"
run: build
echo "Make sure you have closed the lid or suspended first: systemctl suspend"
./auto-rotate --verbose
clean:
rm auto-rotate
.PHONY: all install config-systemd config-systemv