aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 5ab6d2c74651f694055b03d0cc9282d598c414eb (plain)
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
FT_PRINTF_PATH = ../ft_printf

CC = gcc
CCFLAGS = -Wall -Wextra -Wno-format -g
LDFLAGS = -L$(FT_PRINTF_PATH) -lftprintf

NAME = ft_printf_test
PYTHON = python3
RM = rm -f
MAKE = make -j4

SRC = main.c helper.c moulitest_read_stdout.c
OBJ = $(SRC:.c=.o)

run: run_pretty

run_pretty: all
	./$(NAME) | $(PYTHON) prettier.py

run_raw: all
	./$(NAME)

all: $(NAME)

$(NAME): ft_printf_all clean $(OBJ)
	$(CC) $(LDFLAGS) $(CCFLAGS) -o $@ $(OBJ)

%.o: %.c
	$(CC) $(CCFLAGS) -c -o $@ $<

clean:
	$(RM) $(OBJ)

fclean: clean
	$(RM) $(NAME)

re: fclean all

ft_printf_all:
	$(MAKE) -C $(FT_PRINTF_PATH) all