forked from muhasturk/ukupgrade
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
33 lines (28 loc) · 852 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
MY_DIR := $(realpath ./)
.PHONY: all
all: make-exec install
.PHONY: install
install: ukupgrade ukpurge
@echo Creating the directories if neccessary
@mkdir -p $(DESTDIR)$(PREFIX)
@echo Linking profile.d file for reboot message
@ln -s $(MY_DIR)/profile /etc/profile.d/ukupgrade.sh
@echo Linking files to global sbin directory
@ln -s $(MY_DIR)/ukupgrade $(DESTDIR)$(PREFIX)/do-kernel-upgrade
@ln -s $(MY_DIR)/ukpurge $(DESTDIR)$(PREFIX)/do-kernel-purge
@do-kernel-upgrade
.PHONY: make-exec
make-exec: ukupgrade ukpurge
@echo adding x to files
@chmod +x ukupgrade
@chmod +x ukpurge
.PHONY: uninstall
uninstall:
@echo Removing do-kernel- links
@rm -f $(DESTDIR)$(PREFIX)/do-kernel-*
@echo Removing profile.d file
@rm -f /etc/profile.d/ukupgrade.sh
.PHONY: upgrade
upgrade: uninstall make-exec install