-
Notifications
You must be signed in to change notification settings - Fork 59
/
Makefile
41 lines (30 loc) · 879 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
38
39
40
41
CFLAGS ?= -O2
LIBTREE_CFLAGS = -std=c99 -Wall -Wextra -Wshadow -pedantic
LIBTREE_DEFINES = -D_FILE_OFFSET_BITS=64
# uppercase variables for backwards compatibility only:
PREFIX = /usr/local
prefix = $(PREFIX)
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
datarootdir = $(prefix)/share
mandir = $(datarootdir)/man
.PHONY: all check install clean
all: libtree
.c.o:
$(CC) $(CFLAGS) $(LIBTREE_CFLAGS) $(LIBTREE_DEFINES) -c $<
libtree-objs = libtree.o
libtree: $(libtree-objs)
$(CC) $(LDFLAGS) -o $@ $(libtree-objs)
install: all
mkdir -p $(DESTDIR)$(bindir)
cp -p libtree $(DESTDIR)$(bindir)
mkdir -p $(DESTDIR)$(mandir)/man1
cp -p doc/libtree.1 $(DESTDIR)$(mandir)/man1
check:: libtree
clean::
rm -f *.o libtree
clean check::
find tests -mindepth 1 -maxdepth 1 -type d | while read -r dir; do \
$(MAKE) -C "$$dir" $@ || exit 1 ;\
done
-include Make.user