-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
33 lines (27 loc) · 924 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
VERSION=$(shell grep '^Version' ChangeLog | head -n 1 | cut -d' ' -f2 | tr -d ' ')
BIN=sysrqd
O=sysrqd.o
CFLAGS+=-W -Wall -Wextra \
-Wundef -Wshadow -Wcast-align -Wwrite-strings -Wsign-compare \
-Wunused -Winit-self -Wpointer-arith -Wredundant-decls \
-Wmissing-prototypes -Wmissing-format-attribute -Wmissing-noreturn \
-std=gnu99 -pipe -DSYSRQD_VERSION="\"$(VERSION)\"" -O3
LDFLAGS+=-lcrypt
SBINDIR=$(DESTDIR)/usr/sbin
#MANDIR=$(DESTDIR)/usr/share/man/man1
INSTALL = install
#MAN=sysrqd.1
$(BIN): $(O)
$(CC) -o $(BIN) $(O) $(LDFLAGS)
install: $(BIN)
$(INSTALL) -d -m 755 $(SBINDIR)
$(INSTALL) -m 755 $(BIN) $(SBINDIR)
#$(INSTALL) -d -m 755 $(MANDIR)
#$(INSTALL) -m 644 $(MAN) $(MANDIR)
clean:
rm -f *~ $(O) $(BIN)
release: clean
mkdir ../$(BIN)-$(VERSION)
cp -a * ../$(BIN)-$(VERSION)
cd .. && tar czf $(BIN)-$(VERSION).tar.gz $(BIN)-$(VERSION)
rm -rf ../$(BIN)-$(VERSION)