-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
38 lines (30 loc) · 792 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
include Config
all:
# ************* #
# Real targets. #
# ************* #
# Main program.
MAIN_INCS = $(wildcard src/*.h)
MAIN_SRCS = $(wildcard src/*.c)
MAIN_OBJS = $(patsubst src/%.c, build/%.o, $(MAIN_SRCS))
MAIN_BIN = build/bbdump
$(MAIN_OBJS): build/%.o: src/%.c $(MAIN_INCS) $(FACE_INCS)
@mkdir -p build
$(CC) $(ALL_CFLAGS) -c $< -I. -o $@
$(MAIN_BIN): $(MAIN_OBJS)
$(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) $^ -o $@
# ************** #
# Phony targets. #
# ************** #
.PHONY: all show install clean dist
all: $(MAIN_BIN)
show: all
$(MAIN_BIN) < ./all_bytes
install: all
install -m755 $(MAIN_BIN) -Dt $(DESTDIR)$(BINDIR)
clean:
rm -rf build
dist:
@mkdir -p build
tar -zcf build/$(TARNAME).tar.gz --transform="s/^\./$(TARNAME)/" \
--exclude="./build" --exclude="./.*" .