forked from MarauderXtreme/uktools
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
33 lines (28 loc) · 863 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
DESTDIR =
PREFIX = /usr/sbin
SRC_DIR := $(realpath ./src)
MOTD_PATH = /etc/update-motd.d/85-upgrade
.PHONY: all
all: install
.PHONY: install
install:
@echo Creating the directories if neccessary
@mkdir -p $(DESTDIR)$(PREFIX)
@echo Linking profile.d file for reboot message
@sudo ln -sf $(SRC_DIR)/profile $(MOTD_PATH)
@echo Linking files to global sbin directory
@sudo ln -sf $(SRC_DIR)/upgrade $(DESTDIR)$(PREFIX)/uktools-upgrade
@sudo ln -sf $(SRC_DIR)/purge $(DESTDIR)$(PREFIX)/uktools-purge
@$(SRC_DIR)/setup
.PHONY: uninstall
uninstall:
@echo Removing uktools- links
@sudo rm -f $(DESTDIR)$(PREFIX)/uktools-*
@echo Removing profile.d file
@sudo rm -f $(MOTD_PATH)
@echo Removing autoup files
@sudo $(SRC_DIR)/autoup -unin
@echo Removing config file and other stuff
@sudo $(SRC_DIR)/setup -unin
.PHONY: upgrade
upgrade: uninstall install