-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
37 lines (29 loc) · 860 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
34
35
36
37
CC=gcc
FLAGS=-Wall -O2
INSTALL=install
EXEC_NAME=beep
MAN_FILE=beep.1.gz
# Use GNU makefile conventions for directory names with one notable
# exception: prefix is not /usr/local in order to keep the default
# installation location for beep.
prefix=/usr
exec_prefix=$(prefix)
bindir=$(exec_prefix)/bin
datarootdir=$(prefix)/share
mandir=$(datarootdir)/man
man1dir=$(mandir)/man1
.PHONY: all
all: $(EXEC_NAME)
.PHONY: clean
clean:
rm -f $(EXEC_NAME)
$(EXEC_NAME): beep.c
$(CC) $(FLAGS) $(CFLAGS) -o $(EXEC_NAME) beep.c
install: all
$(INSTALL) -m 0755 -d $(DESTDIR)$(bindir)
$(INSTALL) -m 0755 -p $(EXEC_NAME) $(DESTDIR)$(bindir)/
$(INSTALL) -m 0755 -d $(DESTDIR)$(man1dir)
$(INSTALL) -m 0644 -p $(MAN_FILE) $(DESTDIR)$(man1dir)/
uninstall:
rm -f $(DESTDIR)$(bindir)/$(EXEC_NAME)
rm -f $(DESTDIR)$(man1dir)/$(MAN_FILE)