Giter Club home page Giter Club logo

mmpp's Introduction

C++ Build System Generator

This C++ build system generator is a simple utility that can help you create a Makefile for your C++ projects. It analyzes the source files in the current directory and generates a Makefile with dependencies and build rules. You can use this generated Makefile to build your C++ project with just one command.

Prerequisites

  • C++ Compiler with C++20 support (e.g., g++)

Usage

  1. Compile the program:

     make
     make install
  2. Run the program to generate a Makefile:

    • If you provide an output_file argument, the generated Makefile will be saved to that file.
     $ mmpp
    • If you don't provide an output_file argument, the Makefile will be printed to the console.
     $ mmpp makefile
  3. Use the generated Makefile to build your C++ project:

    make
  4. Clean the generated object files:

    make clean

Features

  • Generates Makefile rules for all .cpp source files in the current directory.
  • Automatically detects source file dependencies and includes them in the Makefile.
  • Provides build, run, clean, install, and uninstall targets in the generated Makefile.

Example

Suppose you have the following C++ source files in your project directory:

  • main.cpp
  • utils.cpp
  • utils.hpp

Running the mmpp program will generate a Makefile that includes rules for building your project, such as:

# Generated with github.com/da0x/mmpp
# Binary:
my_program: .obj utils.o main.o
    g++ -std=c++20 .obj/utils.o .obj/main.o -o my_program

.obj:
    mkdir .obj

.obj/main.o: main.cpp utils.hpp
    g++ -std=c++20 -o .obj/main.o -c main.cpp

.obj/utils.o: utils.cpp utils.hpp
    g++ -std=c++20 -o .obj/utils.o -c utils.cpp

run: my_program
    ./my_program

clean:
    rm -rfv .obj

install:
    sudo cp -v my_program /usr/local/bin/

uninstall:
    sudo rm -v /usr/local/bin/my_program

mmpp's People

Contributors

da0x avatar

Watchers

 avatar

mmpp's Issues

Support lib files

Either automatically link all available .lib files, or allow the user to annotate source code with such libraries.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.