Thanks to visit codestin.com
Credit goes to github.com

Skip to content

An absurdly extensive C library of useful (and sometimes excessive) functions, built as a natural continuation of the 42 Libft project. This library expands on the core standard functions by adding a wide range of utilities for memory management, string operations, data structures, math, and more. All designed to support and accelerate development

License

Notifications You must be signed in to change notification settings

Sheratan095/Corekit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Usage

COREKIT_PATH = ./Corekit #path of corekit folder

FLAGS		= -Wall -Werror -Wextra -g

INCLUDES = -I$(COREKIT_PATH)/includes #path of includes folder in corekit

%.o: %.c
	cc $(FLAGS) $(INCLUDES) -c $< -o $@

$(NAME): $(OBJ)
	$(MAKE) -sC $(COREKIT_PATH) #execute make in corekit folder in silent mode
	cc $(FLAGS) $(INCLUDES) $(OBJ) -L$(COREKIT_PATH) -lcorekit -o $(NAME)
	#-lcorekit: includes library name (libcorekit)
	#-L$(COREKIT_PATH): link the specified directory to main compilation

clean:
	@${MAKE} -C corekit clean

fclean: clean
	@${MAKE} -C corekit fclean -s

In this example the project structure is:

.
├── main.c
├── makefile
├── corekit ▼
│   ├── Makefile
│   ├── README.md
│   ├── includes ►
│   └── src ►

Makefile explanation

The library (.a file) is called libcorekit.a beacause all the library during compilation must start with 'lib' prefix

$@  rename with target file name and in the directory of c original file

$< takes the firts prerequisite, so the c file

-c  flag is used to generate .o file

%.o: %.c
	@$(COMPILE) -c $< -Iincludes -o $@

-c $< means that the compiler should compile the source file specified by the first prerequisite without linking it, resulting in the generation of an object file

-Iincludes includes the 'includes' folder that contain all the headers that are to be included


R=\033[0m isn't a color but 's a control code to reset the text attributes to the default, including color.


TABLE OF CONTENT

About

An absurdly extensive C library of useful (and sometimes excessive) functions, built as a natural continuation of the 42 Libft project. This library expands on the core standard functions by adding a wide range of utilities for memory management, string operations, data structures, math, and more. All designed to support and accelerate development

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •