-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (34 loc) · 927 Bytes
/
Makefile
File metadata and controls
44 lines (34 loc) · 927 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
32
33
34
35
36
37
38
39
40
41
42
43
44
include Config
all:
# ************* #
# Real targets. #
# ************* #
# Interface headers.
FACE_INCS = $(wildcard bbmacro/*.h)
# Proof of compilability.
PROOF_SRCS = proof.c
PROOF_OBJS = $(patsubst %.c, build/%.o, $(PROOF_SRCS))
$(PROOF_OBJS): build/%.o: %.c $(FACE_INCS)
@mkdir -p build
$(CC) $(ALL_CFLAGS) -c $< -I. -o $@
# Demo programs.
DEMO_SRCS = $(wildcard demo/*.c)
DEMO_BINS = $(patsubst demo/%.c, build/%, $(DEMO_SRCS))
$(DEMO_BINS): build/%: demo/%.c $(FACE_INCS)
@mkdir -p build
$(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) $< -I. -o $@
# ************** #
# Phony targets. #
# ************** #
.PHONY: all proof demo install clean dist
all:
proof: $(PROOF_OBJS)
demo: $(DEMO_BINS)
install: all
install -m644 $(FACE_INCS) -Dt $(DESTDIR)$(INCDIR)/bbmacro
clean:
rm -rf build
dist:
@mkdir -p build
tar -zcf build/$(TARNAME).tar.gz --transform="s/^\./$(TARNAME)/" \
--exclude="./build" --exclude="./.*" .