-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmakefile
More file actions
31 lines (24 loc) · 748 Bytes
/
makefile
File metadata and controls
31 lines (24 loc) · 748 Bytes
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
CC ?= gcc
CFLAGS ?= -Wall -Wextra -Werror -pedantic -std=c11 -O2
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
MANDIR ?= $(PREFIX)/share/man
INSTALL ?= install -p -m 0755
INSTALL_MAN ?= install -p -m 0644
execdir: execdir.c
$(CC) $(CFLAGS) execdir.c $(LDFLAGS) -o execdir
install: execdir
mkdir -p $(DESTDIR)$(BINDIR)
$(INSTALL) execdir $(DESTDIR)$(BINDIR)
ln -f -s execdir $(DESTDIR)$(BINDIR)/x
mkdir -p $(DESTDIR)$(MANDIR)/man1
$(INSTALL_MAN) execdir.1 $(DESTDIR)$(MANDIR)/man1
ln -f -s execdir.1 $(DESTDIR)$(MANDIR)/man1/x.1
uninstall:
rm -f $(DESTDIR)$(BINDIR)/execdir
rm -f $(DESTDIR)$(BINDIR)/x
rm -f $(DESTDIR)$(MANDIR)/man1/execdir.1
rm -f $(DESTDIR)$(MANDIR)/man1/x.1
clean:
rm -f execdir
.PHONY: install uninstall clean