-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (40 loc) · 1.67 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
#******************************************************************************#
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: vpoltave <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2017/08/16 12:41:59 by vpoltave #+# #+# #
# Updated: 2017/10/25 11:53:39 by vpoltave ### ########.fr #
# #
#******************************************************************************#
COR = corewar
ASM = asm
CC = gcc -Wall -Wextra -Werror
LIBFT = ./libft/libft.a
OBJ := $(patsubst %.c,%.o,$(wildcard *.c)) \
$(patsubst %.c,%.o,$(wildcard ./cor/virtual_machine/*.c)) \
$(patsubst %.c,%.o,$(wildcard ./cor/visualisation/*.c)) \
$(patsubst %.c,%.o,$(wildcard ./cor/instructions/*.c)) \
ASM_OBJ := $(patsubst %.c,%.o,$(wildcard ./assembler/src/*.c)) \
$(patsubst %.c,%.o,$(wildcard *.c)) \
.PHONY: libft
all: libft $(ASM) $(COR)
$(COR): $(OBJ)
$(CC) -o $(COR) $(OBJ) $(LIBFT) -lncurses
$(ASM): $(ASM_OBJ)
$(CC) -o $(ASM) $(ASM_OBJ) $(LIBFT)
libft:
@make -C ./libft
%.o : %.c
$(CC) -o $@ -c $<
clean:
rm -rf $(OBJ)
rm -rf $(ASM_OBJ)
make clean -C ./libft
fclean: clean
rm -rf $(COR)
rm -rf $(ASM)
make fclean -C ./libft
re: fclean all