Skip to content

MarcosFlavioGS/Prefect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

103 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prefect

logo-no-background

A modern C package manager and build tool that simplifies your development workflow.

Overview

Typing SVG

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.

Features

🚀 Project Management

  • Create standardized C project structures
  • Automatic Git repository initialization
  • Configurable project templates
  • Dependency management

🛠️ Build System

  • Smart compilation with automatic dependency tracking
  • Multiple build modes (debug, release)
  • Object file compilation support
  • Customizable compiler flags

📦 Package Management

  • Easy dependency installation
  • Version management
  • Project-specific configurations
  • Support for external libraries

🎓 Educational Support

  • Specialized templates for 42 school projects
  • Built-in support for common project structures
  • Standardized build configurations
  • Easy project submission preparation

Quick Start

Installation

From Release

  1. Download the latest release from the Releases page
  2. Ensure you have GLIBC 2.38 or higher
  3. Make the binary executable: chmod +x prefect
  4. Move to your PATH: sudo mv prefect /usr/local/bin/

From Source

# Clone the repository
git clone https://github.com/MarcosFlavioGS/Prefect.git

# Navigate to the project directory
cd Prefect

# Build and install
make

Basic Usage

Create a New Project

prefect new my_project

This creates a new C project with the following structure:

my_project/
├── src/
│   └── main.c
├── include/
├── obj/
├── test/
└── bin/

Build Your Project

# 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 -cb

Run Your Project

prefect run

Generate Project Dependencies

# Generate a Makefile
prefect generate makefile

# Short form
prefect g makefile

Advanced Usage

Project Configuration

Prefect 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"))
)

Build Options

  • --release: Enable optimizations
  • --debug: Include debug information
  • -c: Compile to object files
  • -b: Build executable
  • -cb: Compile objects and build

Requirements

  • OCaml 4.14.0 or higher
  • OPAM 2.1.0 or higher
  • Dune 3.0.0 or higher
  • GLIBC 2.38 or higher

Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

License

This project is licensed under the MIT License.

Acknowledgments

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! 🚀

About

A C build tool if you are too lazy for Makefile

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors