Created
October 3, 2018 03:07
-
-
Save fredsiika/8ea6a907852f01220d9b5abf0c1e6d01 to your computer and use it in GitHub Desktop.
Makefile day10 ex00
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NAME = libft.a | |
SRC_DIR := srcs/ | |
INC_DIR := includes/ | |
CFLAGS := -Wall -Werror -Wextra | |
FILES := ft_putchar.c \ | |
ft_putstr.c\ | |
ft_strcmp.c \ | |
ft_strlen.c \ | |
ft_swap.c | |
SRCS := $(patsubst %,$(SRC_DIR)%,$(FILES)) | |
OBJ := $(FILES:%.c=%.o) | |
RM := /bin/rm -f | |
AR := /bin/ar cr | |
all: $(NAME) | |
$(NAME): $(OBJ) | |
ar rcs $(NAME) $(OBJ) | |
$(OBJ): $(SCRS) | |
gcc -c -I$(INC_DIR) $(CFLAGS) $(SRCS) | |
clean: | |
$(RM) $(OBJ) | |
fclean: clean | |
$(RM) $(NAME) | |
re: fclean all | |
.PHONY: all clean fclean re |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment