diff options
| author | Charles <sircharlesaze@gmail.com> | 2019-10-25 04:42:08 +0200 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2019-10-25 04:42:08 +0200 |
| commit | feb71e200972bb78fe86130629ef040ef80811a7 (patch) | |
| tree | 24b84b3f4937ab4eb930e1ad851494d8d49a9775 /Makefile | |
| parent | 1b4df01bfa793fe91a58192a4b79917909bf1614 (diff) | |
| download | ft_printf-feb71e200972bb78fe86130629ef040ef80811a7.tar.gz ft_printf-feb71e200972bb78fe86130629ef040ef80811a7.tar.bz2 ft_printf-feb71e200972bb78fe86130629ef040ef80811a7.zip | |
WIP: Added libft submodule, make ft_printf lib
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 46 |
1 files changed, 32 insertions, 14 deletions
@@ -1,32 +1,50 @@ +LIBFT_ROOT = ./libft + CC = gcc -CCFLAGS = -Wall -Wextra #-Werror +CCFLAGS = -Wall -Wextra -Werror +LDFLAGS = -L. -lftprintf +INCFLAGS = -I$(LIBFT_ROOT) RM = rm -f +LIB = ar rcs +MAKE = make -j4 -NAME = ft_printf +NAME = libftprintf.a SRC = ft_printf.c utils.c printer.c parse.c list.c extract.c OBJ = $(SRC:.c=.o) INCLUDE = header.h -all: $(NAME) - -debug: CCFLAGS += -g -fsanitize=address -debug: re +all: libft_all $(NAME) $(NAME): $(OBJ) - $(CC) $(CCFLAGS) -o $@ $(OBJ) + cp $(LIBFT_ROOT)/libft.a $(NAME) + $(LIB) $(NAME) $(OBJ) %.o: %.c $(INCLUDE) - $(CC) $(CCFLAGS) -c -o $@ $< + $(CC) $(CCFLAGS) $(INCFLAGS) -c -o $@ $< -clean: - $(RM) $(OBJ) +bonus: all -fclean: clean +clean: libft_clean $(RM) $(OBJ) +fclean: libft_fclean clean + $(RM) $(NAME) + re: fclean all -test: fclean - make -C ../schooltest - ../schooltest/all_tests +test: all + $(CC) $(CCFLAGS) $(LDFLAGS) $(INCFLAGS) -o test main.c + + +libft_all: + $(MAKE) -C $(LIBFT_ROOT) all + +libft_bonus: + $(MAKE) -C $(LIBFT_ROOT) bonus + +libft_clean: + $(MAKE) -C $(LIBFT_ROOT) clean + +libft_fclean: + $(MAKE) -C $(LIBFT_ROOT) fclean |
