Skip to content

Instantly share code, notes, and snippets.

@fredsiika
Created October 3, 2018 03:07
Show Gist options
  • Save fredsiika/8ea6a907852f01220d9b5abf0c1e6d01 to your computer and use it in GitHub Desktop.
Save fredsiika/8ea6a907852f01220d9b5abf0c1e6d01 to your computer and use it in GitHub Desktop.
Makefile day10 ex00
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