-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
75 lines (63 loc) · 2.33 KB
/
Makefile.in
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# @configure_input@
# VPATH-specific substitution variables
srcdir = @srcdir@
VPATH = @srcdir@
# Compiler-specific substitution variables
CXXFLAGS = @CXXFLAGS@
EXTRAS = $(srcdir)/deps/beep.o $(srcdir)/deps/i18n.o
LIBS = @LIBS@
DEFS = @DEFS@
# Package-specific substitution variables
PACKAGE = @PACKAGE_NAME@
# Prefix-specific substitution variables
prefix = @prefix@
exec_prefix = @exec_prefix@
sbindir = @sbindir@
sysconfdir = @sysconfdir@
# Installation-specific substitution variables
environment = cinnamon
initdir = $(sysconfdir)/init.d/
systemdir = $(sysconfdir)/systemd/system/
deskletdir = $$(eval echo ~$${SUDO_USER})/.local/share/$(environment)/desklets
desklet = $(PACKAGE)@zener-diode
USER = $$(eval echo $${SUDO_USER})
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
all:
$(MAKE) $(PACKAGE)
$(PACKAGE): $(srcdir)/source/intermediate driver.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(DEFS) -I. -I$(srcdir)/include -I.. $(EXTRAS) $(OBJS) -o $@ $(srcdir)/driver.cpp $(LIBS)
include source/Makefile
Makefile: Makefile.in config.status
./config.status $@
config.status: configure
./config.status --recheck
install:
which $(environment)
$(INSTALL) -d $(DESTDIR)$(sbindir)
$(INSTALL_PROGRAM) $(PACKAGE) $(DESTDIR)$(sbindir)
sed -i.bak "s|ROOT_PATH=.*|ROOT_PATH=$(sbindir)|" $(srcdir)/service/$(PACKAGE)
sed -i.bak "s|WorkingDirectory=.*|WorkingDirectory=$(sbindir)|" $(srcdir)/service/$(PACKAGE).service
$(INSTALL) -d $(DESTDIR)$(initdir) $(DESTDIR)$(systemdir)
cp $(srcdir)/service/$(PACKAGE) $(DESTDIR)$(initdir)
cp $(srcdir)/service/$(PACKAGE).service $(DESTDIR)$(systemdir)
@echo ${USER_HOME}
systemctl daemon-reload
-systemctl stop $(PACKAGE).service
update-rc.d $(PACKAGE) defaults
update-rc.d $(PACKAGE) enable 2
$(INSTALL) -d $(DESTDIR)$(deskletdir)
cp -r $(srcdir)/$(desklet)/files/$(desklet) $(DESTDIR)$(deskletdir)
chown $(USER): $(DESTDIR)$(deskletdir)/$(desklet)
chown -R $(USER): $(DESTDIR)$(deskletdir)/$(desklet)
systemctl start $(PACKAGE).service
uninstall:
rm -f $(DESTDIR)$(sbindir)/$(PACKAGE)
-rmdir $(DESTDIR)$(sbindir) >/dev/null 2>&1
rm -f $(DESTDIR)$(initdir)/$(PACKAGE)
rm -f $(DESTDIR)$(systemdir)/$(PACKAGE).service
rm -rf $(DESTDIR)$(deskletdir)/$(desklet)
systemctl stop $(PACKAGE).service
update-rc.d -f $(PACKAGE) remove
systemctl daemon-reload
.PHONY: all install uninstall clean