-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
59 lines (48 loc) · 1.05 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
# Directories
PROJECT = libparse
BINDIR ?= .
BUILDDIR ?= build
NAME = $(BINDIR)/libparse.a
# Compiler options
CC = clang
CFLAGS = $(addprefix -I,$(INCLUDE)) -Wall -Wextra -Werror -g
# Color output
BLACK = "\033[0;30m"
RED = "\033[0;31m"
GREEN = "\033[0;32m"
YELLOW = "\033[1;33m"
BLUE = "\033[0;34m"
MAGENTA = "\033[0;35m"
CYAN = "\033[0;36m"
WHITE = "\033[0;37m"
END = "\033[0m"
SRC += comb_and.c
SRC += cons.c
SRC += noneof.c
SRC += oneof.c
SRC += parg_range.c
SRC += parg_str.c
SRC += run_parser.c
SRC += run_pfun.c
SRC += satisfy.c
SRC += space.c
SRC += uni.c
SRC += uni_manyrange.c
OBJECTS = $(addprefix $(BUILDDIR)/, $(SRC:%.c=%.o))
all: $(NAME)
$(BUILDDIR)/%.o: %.c
@[ -d $(BUILDDIR) ] || mkdir $(BUILDDIR)
@printf $(YELLOW)$(PROJECT)$(END)'\t'
$(CC) $(CFLAGS) -c $< -o $@
$(NAME): $(OBJECTS)
@printf $(YELLOW)$(PROJECT)$(END)'\t'
@ar rc $(@) $(OBJECTS)
@echo OK
.PHONY: clean fclean re
clean:
@printf $(YELLOW)$(PROJECT)$(END)'\t'
rm -rf build/
fclean: clean
@printf $(YELLOW)$(PROJECT)$(END)'\t'
rm -rf $(NAME)
re: fclean all