Skip to content

A C build system if you are too lazy for Makefile

Notifications You must be signed in to change notification settings

MarcosFlavioGS/Prefect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prefect

Capturar

A C package manager and build tool if you are too lazy for Makefile.

Overview

Typing SVG

Prefect is a powerful C package and build system crafted with the elegance of OCaml. It simplifies the entire project lifecycle, from creating a new project with a standardized C project structure to building, running, and generating project dependencies like Makefiles or specific structures for 42 school projects such as MiniShell, FDF, ft_printf, Libft, and more.

Features

Create Project

Prefect makes project initiation a breeze. It sets up a comprehensive C project structure with directories like src, obj, include, test, and bin. To create a new project, use the following command:

prefect new <project_name>

This command not only creates the necessary directories but also initializes a Git repository for version control.

Build Project

Building your C project is a seamless process with Prefect. It compiles your source code, taking care of compiler flags and other configurations. To build your project, run:

prefect build

Prefect can also build to object files.

prefect build -c

It will compile the object files and put them inside your obj/ directory. If you want to compile the object files and also build the executable, add an extra option to the build command:

prefect build -cb

or:

prefect build -c -b

This command will both compile the object files into the obj folder and build the executable.

The build option also has optimization options and debug optimization.

prefect build --release

and

prefect build --debug

Run Project

Executing your C project is as simple as running:

prefect run

This command ensures that your project is compiled and then executes the compiled binary.

Generate Project Dependencies

Need project-specific configurations like Makefiles or 42 school project structures? Prefect has you covered. To generate project dependencies, use:

prefect generate <dependencie_type>

Replace <dependency_type> with the specific dependency you need, such as Makefile.

Getting started

Typing SVG

Installation

Release

The binary is available on the release page Release

You will need GLIBC_2.38 or higher to run the executable.

Build and install from source

Clone this repository and run the make command to build the project from source and install the binary.

git clone https://github.com/MarcosFlavioGS/Prefect.git

cd Prefect

make

You will need both Makefile and Dune installed to build the project

Examples

Creating a new project

prefect new my_c_project

This command creates a new C project named "my_c_project" with the standard project structure.

Generating a Makefile

prefect generate makefile

the generate command, as well as all other commands, can be used in it's short form:

prefec g makefile

License

This project is licensed under the MIT license

Acknowledgments

We would like to express our gratitude to the OCaml and C communities for their continuous support and inspiration.

Thank you for choosing Prefect for your C projects! Happy coding! 🚀

About

A C build system if you are too lazy for Makefile

Resources

Stars

Watchers

Forks

Packages