forked from tsutsu/btier
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
58 lines (48 loc) · 2.23 KB
/
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
VERSION := 2.0.1
CC := gcc -O2
all: userspace
install: install_dkms_src install_userspace
deb:
$(MAKE) -f ./debian/rules clean
fakeroot $(MAKE) -f ./debian/rules binary
userspace:
gzip -c usr/share/man/man1/btier_setup.1 > usr/share/man/man1/btier_setup.1.gz
gzip -c usr/share/man/man1/btier_inspect.1 > usr/share/man/man1/btier_inspect.1.gz
$(CC) -D_FILE_OFFSET_BITS=64 cli/btier_setup.c -o cli/btier_setup
$(CC) -D_FILE_OFFSET_BITS=64 cli/btier_inspect.c -o cli/btier_inspect
install_userspace:
install -D -m 755 usr/share/initramfs-tools/hooks/btier $(DESTDIR)/usr/share/initramfs-tools/hooks/btier
install -D -m 755 usr/share/initramfs-tools/scripts/init-premount/btier $(DESTDIR)/usr/share/initramfs-tools/scripts/init-premount/btier
install -D -m 755 -s cli/btier_setup $(DESTDIR)/sbin/btier_setup
install -D -m 755 -s cli/btier_inspect $(DESTDIR)/sbin/btier_inspect
install -D -m 644 etc/bttab_example $(DESTDIR)/etc/bttab_example
install -D -m 644 etc/init.d/btier $(DESTDIR)/etc/init.d/btier
install -D -m 644 usr/share/man/man1/btier_setup.1.gz $(DESTDIR)/usr/share/man/man1/btier_setup.1.gz
install -D -m 644 usr/share/man/man1/btier_inspect.1.gz $(DESTDIR)/usr/share/man/man1/btier_inspect.1.gz
install_dkms_src:
install -d -m 744 $(DESTDIR)/usr/src/btier-$(VERSION)
install -m 644 kernel/btier/*.h $(DESTDIR)/usr/src/btier-$(VERSION)/
install -m 644 kernel/btier/*.c $(DESTDIR)/usr/src/btier-$(VERSION)/
install -m 644 kernel/btier/dkms.conf $(DESTDIR)/usr/src/btier-$(VERSION)/
install -m 644 kernel/btier/Makefile $(DESTDIR)/usr/src/btier-$(VERSION)/
uninstall_userspace:
rm $(DESTDIR)/sbin/btier_setup
rm $(DESTDIR)/sbin/btier_inspect
rm $(DESTDIR)/etc/init.d/btier
rm -f $(DESTDIR)/etc/bttab_example
rm $(DESTDIR)/usr/share/man/man1/btier_setup.1.gz
rm $(DESTDIR)/usr/share/man/man1/btier_inspect.1.gz
rm -r $(DESTDIR)/usr/src/btier-$(VERSION)
clean:
$(MAKE) -Wall -C kernel/btier modules
rm -f usr/share/man/man1/btier_inspect.1.gz
rm -f usr/share/man/man1/btier_setup.1.gz
rm -f cli/btier_setup
rm -f cli/btier_inspect
pretty:
cd kernel/btier;$(KDIR)/scripts/Lindent *.c
cd kernel/btier;$(KDIR)/scripts/Lindent *.h
cd kernel/btier;rm -f *.c~
cd kernel/btier;rm -f *.h~
cd cli;$(KDIR)/scripts/Lindent *.c
cd cli;rm -f *.c~