-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
78 lines (57 loc) · 1.38 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
##
## Makefile for printf in /home/lombar_e/rendu/PSU/PSU_2016_my_printf
##
## Made by Thomas Lombard
## Login <[email protected]>
##
## Started on Sun Dec 06 15:51:40 2016 Thomas Lombard
## Last update Sun Dec 06 15:51:40 2016 Thomas Lombard
##
NAME = libmy.a
CFLAGS += -W -Wall -Wextra
CFLAGS += -ansi -pedantic
CFLAGS += -I includes/
LDFLAGS = -L ./ -lmy
CC = gcc
AR = ar rc
RAN = ranlib
TAR = tar xzvf
RM = rm -f
PROJ_SOURCE = printf__calc.c \
printf__constructor.c \
printf__functions_base.c \
printf__functions_chars.c \
printf__functions_float.c \
printf__functions_int.c \
printf__functions_other.c \
printf__getnbr.c \
printf__getters.c \
printf__lib.c \
printf__parse.c \
printf__printf.c \
printf__vprintf.c
LIB_SOURCE = istype.c \
maths.c \
memset.c \
strlen.c
PROJ_FILES = $(addprefix src/, $(PROJ_SOURCE))
LIB_FILES = $(addprefix src/lib/, $(LIB_SOURCE))
LIB = $(LIB_FILES:.c=.o)
PROJ = $(PROJ_FILES:.c=.o)
$(NAME): $(LIB) $(PROJ)
$(AR) $(NAME) $(LIB) $(PROJ)
$(RAN) $(NAME)
all: $(NAME)
test: $(NAME)
$(TAR) src/main_test.tar.gz
$(CC) -c src/main.c -o src/main.o -I includes/
$(CC) -o test src/main.o $(LDFLAGS)
clean:
$(RM) $(LIB) $(PROJ)
$(RM) src/main.o
fclean: clean
$(RM) $(NAME)
$(RM) test
$(RM) src/main.c
re: fclean all
.PHONY: all clean fclean re