A modern C package manager and build tool that simplifies your development workflow.
Prefect is a powerful C package and build system crafted with the elegance of OCaml. It streamlines your entire development workflow, from project initialization to deployment, with a focus on simplicity and efficiency.
- Create standardized C project structures
- Automatic Git repository initialization
- Configurable project templates
- Dependency management
- Smart compilation with automatic dependency tracking
- Multiple build modes (debug, release)
- Object file compilation support
- Customizable compiler flags
- Easy dependency installation
- Version management
- Project-specific configurations
- Support for external libraries
- Specialized templates for 42 school projects
- Built-in support for common project structures
- Standardized build configurations
- Easy project submission preparation
- Download the latest release from the Releases page
- Ensure you have GLIBC 2.38 or higher
- Make the binary executable:
chmod +x prefect - Move to your PATH:
sudo mv prefect /usr/local/bin/
# Clone the repository
git clone https://github.com/MarcosFlavioGS/Prefect.git
# Navigate to the project directory
cd Prefect
# Build and install
makeprefect new my_projectThis creates a new C project with the following structure:
my_project/
├── src/
│ └── main.c
├── include/
├── obj/
├── test/
└── bin/
# Standard build
prefect build
# Build with optimizations
prefect build --release
# Build with debug information
prefect build --debug
# Compile to object files
prefect build -c
# Compile objects and build executable
prefect build -cbprefect run# Generate a Makefile
prefect generate makefile
# Short form
prefect g makefilePrefect uses S-expressions for configuration. A basic configuration looks like:
(
(name "project_name")
(project_dir "/path/to/project")
(src ("/src/main.c"))
(compiler "gcc")
(flags ("-Wall" "-Wextra" "-Werror"))
)--release: Enable optimizations--debug: Include debug information-c: Compile to object files-b: Build executable-cb: Compile objects and build
- OCaml 4.14.0 or higher
- OPAM 2.1.0 or higher
- Dune 3.0.0 or higher
- GLIBC 2.38 or higher
We welcome contributions! Please see our Contributing Guidelines for details.
This project is licensed under the MIT License.
Special thanks to:
- The OCaml community for their excellent tools and support
- The C programming community for their continuous innovation
- All contributors who have helped shape Prefect
Thank you for choosing Prefect! Happy coding! 🚀
