This commit is contained in:
Jack Halford 2016-08-28 19:03:21 +02:00
parent 5cbab4fd98
commit 63c6f69988
2 changed files with 13 additions and 6 deletions

View file

@ -1,19 +1,27 @@
NAME = fillit
CC = gcc
D_SRC = src
F_SRC := $(shell ls -1 $(D_SRC) | grep "\.c$$")
D_OBJ = obj
D_LIB = lib
F_OBJ = $(F_SRC:.c=.o)
F_OBJ := $(addprefix $(D_OBJ)/, $(F_OBJ))
D_INC = includes
D_LIB = lib
D_LIB := $(shell find $(D_LIB) -maxdepth 1 -mindepth 1 -type d)
D_LIB := $(addprefix -L,$(D_LIB))
F_LIB = ft
F_LIB := $(addprefix -l, $(F_LIB))
W_FLAGS = -Wall -Wextra -Werror
DEBUG =
MKDIR = mkdir -p
RM = /bin/rm -rf
F_SRC := $(shell ls -1 $(D_SRC) | grep "\.c$$")
F_OBJ := $(F_SRC:.c=.o)
F_OBJ := $(addprefix $(D_OBJ)/, $(F_OBJ))
.PHONY: all clean fclean re
@ -25,7 +33,7 @@ $(D_OBJ)/%.o: $(D_SRC)/%.c $(D_INC)
@echo "Compiling "$<"..."
$(NAME): $(F_OBJ)
$(CC) -I$(D_INC) -L$(D_LIB) -lft $(F_OBJ) -o $@ $(DEBUG)
$(CC) -I$(D_INC) $(D_LIB) $(F_LIB) $(W_FLAGS) $(F_OBJ) -o $@ $(DEBUG)
clean:
$(RM) $(D_OBJ)

View file

@ -1 +0,0 @@
libft/libft.a