File: Makefile

package info (click to toggle)
libtree 3.1.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 288 kB
  • sloc: ansic: 1,412; makefile: 202
file content (36 lines) | stat: -rw-r--r-- 758 bytes parent folder | download | duplicates (3)
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
-include Make.user

CFLAGS ?= -O2
LIBTREE_CFLAGS = -std=c99 -Wall -Wextra -Wshadow -pedantic
LIBTREE_DEFINES = -D_FILE_OFFSET_BITS=64

PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
SHAREDIR ?= $(PREFIX)/share

.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)$(SHAREDIR)/man/man1
	cp -p doc/libtree.1 $(DESTDIR)$(SHAREDIR)/man/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