Create include dir for main.h and patch Makefile acordingly.
authorLukas Jiriste <ljiriste@student.42prague.com>
Fri, 13 Oct 2023 09:51:50 +0000 (11:51 +0200)
committerLukas Jiriste <ljiriste@student.42prague.com>
Fri, 13 Oct 2023 09:51:50 +0000 (11:51 +0200)
Makefile
include/main.h [moved from main.h with 100% similarity]

index 179b3738fa6e7d9c449b6bf0adc2b18eb1c3c453..e1292d55949fde08407704c200a500eb46b5ff9f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -4,6 +4,7 @@ CFLAGS = -Wall -Wextra -Werror -g
 GNLDIR = ../
 SRCDIR = src/
 OBJDIR = obj/
+INCLUDE = include/
 
 SRCS = $(shell find $(SRCDIR) -name '*.c' -type f -printf "%f\n")
 GNLSRCS = get_next_line.c get_next_line_utils.c
@@ -19,7 +20,7 @@ $(NAME) : $(OBJS) $(GNLOBJS)
        $(CC) $(CFLAGS) $^ -o $@
        
 $(OBJS) : $(OBJDIR)%.o : $(SRCDIR)%.c | $(OBJDIR)
-       $(CC) $(CFLAGS) -c $< -o $@ -I$(GNLDIR) -I.
+       $(CC) $(CFLAGS) -c $< -o $@ -I$(GNLDIR) -I$(INCLUDE)
 
 $(GNLOBJS) : $(OBJDIR)%.o : $(GNLDIR)%.c | $(OBJDIR)
 ifndef BUFFER_SIZE
similarity index 100%
rename from main.h
rename to include/main.h