-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (37 loc) · 1014 Bytes
/
Copy pathMakefile
File metadata and controls
47 lines (37 loc) · 1014 Bytes
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
NAME = libmy_printf_`uname -m`-`uname -s`
my_printf_static = $(NAME).a
my_printf_dynamic = $(NAME).so
##
## DIRECTORY
##
LIBS = ./libs/
SRCS = my_printf.c \
variadique.c \
fc_var_scid.c \
fc_var_ouxx.c \
utils_fc.c \
$(LIBS)put.c \
$(LIBS)f_str.c \
$(LIBS)my_strcat.c \
$(LIBS)my_getnbr.c \
$(LIBS)my_strcpy.c \
$(LIBS)my_strdup.c \
$(LIBS)xfunctions.c
OBJS = $(SRCS:.c=.o)
AR = ar r
RANLIB = ranlib
CFLAGS = -fPIC -O2 -W -Wall -Wextra -pedantic -ansi -Wformat-nonliteral -Wpointer-arith -Wmissing-declarations -Winline -Wundef -Wcast-align -Wformat-security
CC = gcc
RM = rm -f
$(NAME) : my_printf_static my_printf_dynamic
my_printf_dynamic : $(OBJS)
$(CC) -shared -o $(my_printf_dynamic) $(OBJS)
my_printf_static : $(OBJS)
$(AR) $(my_printf_static) $(OBJS)
$(RANLIB) $(my_printf_static)
all : $(NAME)
clean :
$(RM) $(OBJS) *~ *#
fclean : clean
$(RM) $(my_printf_static) $(my_printf_dynamic)
re : fclean all