aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 468998a53a6b49891c1efd4a5036cedab5265cde (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
RM = rm -f
UNAME = $(shell uname)

ifeq ($(UNAME), Linux)
	PYTHON = python3.7
else
	PYTHON = python3
endif

LIBASM_PATH = ../libasm

CC = gcc -fPIC -no-pie
CCFLAGS = -I. -Wall -Wextra
LDFLAGS = -L$(LIBASM_PATH) -lasm

NAME = runtest
SRC = main.c \
	  helper.c \
	  test/ft_strlen_test.c \
	  test/ft_strcpy_test.c \
	  test/ft_strcmp_test.c \
	  test/ft_write_test.c \
	  test/ft_read_test.c \
	  test/ft_strdup_test.c \
	  test/ft_atoi_base_test.c \
	  functions_reference/ref_ft_atoi_base.c
	  #ft_list_push_front_test.c ft_list_size_test.c \
	  # ft_list_sort_test.c ft_list_remove_if_test.c \

OBJ = $(SRC:.c=.o)

run: pretty

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

run_raw: all
	./$(NAME)

all: $(NAME)

$(NAME): libasm_all $(OBJ)
	$(CC)  -o $@ $(OBJ) $(LDFLAGS)

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

clean:
	$(RM) $(OBJ)

fclean: clean
	$(RM) $(NAME)

re: libasm_fclean libasm_all fclean all


libasm_all:
	make -C $(LIBASM_PATH) all

libasm_fclean:
	make -C $(LIBASM_PATH) fclean