-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
43 lines (32 loc) · 801 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
39
40
41
42
43
NAME = pathfinder
INC = inc/../inc/pathfinder.h
SRC := $(wildcard src/*.c)
OBJ = $(addprefix obj/, $(notdir $(SRC:%.c=%.o)))
LIBMX = libmx/libmx.a
FLAGS = -std=c11 -Wall -Wextra -Werror -Wpedantic
SANFLAG = -g -fsanitize=address
all: $(NAME)
install: $(NAME)
$(NAME): $(LIBMX) $(OBJ)
@make clean
@clang $(FLAGS) $(OBJ) $(LIBMX) -o $(NAME)
@printf "\x1b[32;1m$(NAME) created\x1b[0m\n"
$(LIBMX):
@make -C libmx
$(OBJ): | obj
obj:
@mkdir obj
obj/%.o: src/%.c $(INC)
@clang $(FLAGS) -c $< -o $@
@printf "\x1b[32mcompiled: \x1b[0m[$<]\n"
clean:
@rm -rf *.o pathfinder.dSYM
@make clean -C libmx
uninstall: clean
@make uninstall -C libmx
@make clean
@rm -rf ./obj
@rm -rf $(NAME)
reinstall: uninstall install
d:
@clang $(FLAGS) $(SANFLAG) src/*.c libmx/libmx.a -o pathfinder --debug