-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
85 lines (74 loc) · 2.08 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
##
## EPITECH PROJECT, 2021
## libgote
## File description:
## Makefile automatically generated using Epine!
##
NAME = libgote.a
all: libgote.a
.PHONY: all
__NAME__SRCS := $(shell find -path './src/*.c')
__NAME__OBJS := $(filter %.c,$(__NAME__SRCS))
__NAME__OBJS := $(__NAME__OBJS:.c=.o)
__NAME__DEPS := $(__NAME__OBJS:.o=.d)
$(NAME) $(__NAME__OBJS): ./lib/libmy
$(NAME): CPPFLAGS :=
$(NAME): CPPFLAGS += -MD -MP
$(NAME): CPPFLAGS += -I./include
$(NAME): CPPFLAGS += -I./lib/libmy/include
$(NAME): CFLAGS :=
$(NAME): CFLAGS += -Wall
$(NAME): CFLAGS += -Wextra
$(NAME): CFLAGS += $(if DEBUG,-g3)
$(NAME): $(__NAME__OBJS)
$(AR) rc $@ $(__NAME__OBJS)
-include $(__NAME__DEPS)
unit_tests_SRCS := $(shell find -path './tests/*.c')
unit_tests_OBJS := $(filter %.c,$(unit_tests_SRCS))
unit_tests_OBJS := $(unit_tests_OBJS:.c=.o)
unit_tests_DEPS := $(unit_tests_OBJS:.o=.d)
unit_tests $(unit_tests_OBJS): libgote.a ./lib/libmy/libmy.a
unit_tests: CPPFLAGS :=
unit_tests: CPPFLAGS += -MD -MP
unit_tests: CPPFLAGS += -I./include
unit_tests: CPPFLAGS += -I./lib/libmy/include
unit_tests: CFLAGS :=
unit_tests: CFLAGS += -Wall
unit_tests: CFLAGS += -Wextra
unit_tests: CFLAGS += $(if DEBUG,-g3)
unit_tests: LDLIBS :=
unit_tests: LDLIBS += -l:libgote.a
unit_tests: LDLIBS += -l:./lib/libmy/libmy.a
unit_tests: LDLIBS += -lcriterion
unit_tests: LDFLAGS :=
unit_tests: LDFLAGS += -L.
unit_tests: LDFLAGS += -Wl,-rpath .
unit_tests: $(unit_tests_OBJS)
$(CC) -o $@ $(unit_tests_OBJS) $(LDFLAGS) $(LDLIBS)
-include $(unit_tests_DEPS)
tests_run: ./unit_tests
./unit_tests $(ARGS)
.PHONY: tests_run
clean:
$(RM) $(__NAME__DEPS) $(__NAME__OBJS) $(unit_tests_DEPS) $(unit_tests_OBJS)
$(MAKE) -C ./lib/libmy fclean
.PHONY: clean
fclean: clean
$(RM) $(NAME) unit_tests
$(RM) ./unit_tests
.PHONY: fclean
re: fclean all
.PHONY: re
# libs
pull:
$(RM) -r './lib/libmy'
git clone git@github.com:nasso/libmy './lib/libmy'
$(RM) -r './lib/libmy/.git'
.PHONY: pull
./lib:
mkdir -p $@
./lib/libmy:
$(error $@ wasn't found! don't forget to `make pull`)
./lib/libmy/%: | ./lib/libmy
$(MAKE) -C ./lib/libmy $*
$(MAKE) -C ./lib/libmy clean