-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
35 lines (26 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
34
35
prefix = /usr/local
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
BINDIR = bin
VPATH = $(BINDIR)
CC ?= gcc
CFLAGS ?= -s -O2
CFLAGS += -Wall -Wshadow -Wimplicit -Wextra -Winline -Wundef -Wmissing-declarations \
-Wstrict-prototypes -Wmissing-prototypes -Wno-unused-parameter -Wtrampolines
printfq : printfq.c | $(BINDIR)
$(CC) $(CFLAGS) $(PRITNFQ_FLAGS) -o $(BINDIR)/printfq $^
.PHONY : install
install : $(DESTDIR)$(bindir)/printfq
.PHONY : clean
clean :
rm -f $(BINDIR)/printfq
$(DESTDIR)$(bindir)/printfq : printfq | $(DESTDIR)$(bindir)
install -o root -g root -m 0755 bin/printfq "$(DESTDIR)$(bindir)"
$(DESTDIR)$(bindir) : | $(DESTDIR)$(exec_prefix)
$(DESTDIR)$(exec_prefix) : | $(DESTDIR)
# Directory targets.
$(BINDIR) $(DESTDIR) $(DESTDIR)$(exec_prefix) $(DESTDIR)$(bindir) :
@if ! [ -d "$@" ] && ! mkdir -p "$@"; then \
echo Error. Unable to create the output directory: "$@"; \
exit 1; \
fi