-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
49 lines (36 loc) · 1.09 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
NAME = lemipc
CC = gcc
RM = rm -f
SRCS = ./srcs/main.c \
./srcs/map.c \
./srcs/lemipc.c \
./srcs/displayer.c \
./srcs/player.c \
./srcs/orders.c \
./srcs/move.c \
./srcs/sem.c \
./srcs/msg.c \
./srcs/is_alive.c
OBJS = $(SRCS:.c=.o)
CFLAGS = -I include
CFLAGS += -W -Wall -Wextra -g3
LDFLAGS =
.c.o:
@$(CC) $(CFLAGS) $(LDFLAGS) -c $< -o $@ && \
printf "[\033[1;32mcompiled\033[0m] % 29s\n" $< | tr ' ' '.' || \
printf "[\033[1;31mfailed\033[0m] % 31s\n" $< | tr ' ' '.'
all: $(NAME)
$(NAME): $(OBJS)
@$(CC) $(OBJS) -o $(NAME) $(LDFLAGS) && \
printf "[\033[1;36mbuilt\033[0m] % 32s\n" $(NAME) | tr ' ' '.' || \
printf "[\033[1;31mfailed\033[0m] % 31s\n" $(NAME) | tr ' ' '.'
clean:
@$(RM) $(OBJS) && \
printf "[\033[1;31mdeleted\033[0m] % 30s\n" $(OBJS) | tr ' ' '.' || \
printf "[\033[1;31mdeleted\033[0m] % 30s\n" $(OBJS) | tr ' ' '.'
fclean: clean
@$(RM) $(NAME) && \
printf "[\033[1;31mdeleted\033[0m] % 30s\n" $(NAME) | tr ' ' '.' || \
printf "[\033[1;31mdeleted\033[0m] % 30s\n" $(NAME) | tr ' ' '.'
re: fclean all
.PHONY: all clean fclean re