-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
47 lines (31 loc) · 804 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
44
45
46
47
NAME = pathfinder
CFLAGS = -std=c11 -Wall -Wextra -Werror -Wpedantic
SRCD = src
INCD = inc
OBJD = obj
LMXDIR = libmx
LMXA := $(LMXDIR)/libmx.a
LIBMXINC := $(LMXDIR)/inc
INC = pathfinder.h
INCS = $(addprefix $(INCD)/, $(INC))
SRC = main.c mx_atoi.c mx_printerr.c parse_file.c astar.c queue.c output.c paths_changes.c
SRCS = $(addprefix $(SRCD)/, $(SRC))
OBJS = $(addprefix $(OBJD)/, $(SRC:%.c=%.o))
all: install
install: $(LMXA) $(NAME)
$(NAME): $(OBJS)
clang $(CFLAGS) $(OBJS) $(LMXA) -o $@
$(OBJD)/%.o: $(SRCD)/%.c $(INCS)
clang $(CFLAGS) -c $< -o $@ -I$(INCD) -I$(LIBMXINC)
$(OBJS): | $(OBJD)
$(OBJD):
@mkdir -p $@
$(LMXA):
@make -sC $(LMXDIR)
clean:
@make -sC $(LMXDIR) $@
@rm -rf $(OBJD)
uninstall: clean
@make -sC $(LMXDIR) $@
@rm -rf $(NAME)
reinstall: uninstall install