From d278d4eb3c1fae305c99044d4be8a641c6c6af93 Mon Sep 17 00:00:00 2001 From: starnakin Date: Sat, 7 Sep 2024 00:56:56 +0200 Subject: [PATCH] add: makefile --- Makefile | 34 ++++++++++++++++++++++++++++++++++ src/kprint/kprintf.c | 8 ++++---- 2 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..2a9bcf7 --- /dev/null +++ b/Makefile @@ -0,0 +1,34 @@ +SRCDIR = src +OBJDIR = obj +BUILDDIR = build + +SRC := $(wildcard $(SRCDIR)/**/*.c) +OBJ := $(patsubst $(SRCDIR)/%.c,$(OBJDIR)/%.o,$(SRC)) + +CC = gcc +CFLAGS = -iquoteheaders -c + +AR = ar +ARFLAGS = + +NAME = libbozo.a + +$(OBJDIR)/%.o: $(SRCDIR)/%.c + mkdir -p $(dir $@) + $(CC) $(CFLAGS) $< -o $@ + +all : $(NAME) + +clean : + rm -rf $(OBJDIR) + +fclean : clean + rm -rf $(BUILDDIR) + +$(NAME) : $(OBJ) + mkdir -p $(BUILDDIR) + $(AR) -rc $(BUILDDIR)/$(NAME) $(OBJ) + +re: fclean all + +.PHONY: clean fclean test all re \ No newline at end of file diff --git a/src/kprint/kprintf.c b/src/kprint/kprintf.c index 4c3d19c..20a80c3 100644 --- a/src/kprint/kprintf.c +++ b/src/kprint/kprintf.c @@ -1,7 +1,7 @@ -#include "../../headers/kprint.h" -#include "../../headers/string.h" -#include "../../headers/terminal.h" -#include "../../headers/ctype.h" +#include "kprint.h" +#include "string.h" +#include "terminal.h" +#include "ctype.h" #include