-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (46 loc) · 935 Bytes
/
Makefile
File metadata and controls
59 lines (46 loc) · 935 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
include libvector.mk
include specs.mk
SRCS_OBJS := $(patsubst %.c,$(OBJS_DIR)/%.o,$(SRCS))
$(OBJS_DIR)/%.o:$(SRCS_DIR)/%.c
@mkdir -vp $(dir $@)
$(CC) \
$(CFLAGS) \
-MMD \
-MP \
-o $@ \
-c $< \
-I $(INCS_DIR)
all: $(NAME)
-include $(SRCS_OBJS:.o=.d)
$(NAME): $(SRCS_OBJS)
ar rc \
$(NAME) \
$(SRCS_OBJS)
g: CFLAGS = $(CFLAGS_DBG)
g: all
test: g
$(CC) \
$(TESTS_SRCS) \
$(SPECS_SRCS) \
$(CFLAGS_DBG) \
-I $(INCS_DIR) \
-I $(TESTS_INCS_DIR) \
-L. -lvector \
-o tester
./tester
clean:
rm -rf $(OBJS_DIR)
rm -rf .cache
rm -rf .dSYM
format:
find . \( -name "*.c" -o -name "*.h" \) \
-type f \
-exec \
clang-format \
--verbose \
-style=file -i {} \;
fclean: clean
rm -rf $(TESTS_BIN)
rm -rf $(NAME)
re: fclean all
.PHONY : all test clean g fclean re format sparse