Coder Social home page Coder Social logo

makefiletemplate's Introduction

MakefileTemplate

A Generic Makefile Template for C/C++ Projects

Description

Features:

  • Automatically traverses and lists all (code files in) sub-directories, or you manually add;
  • Automatically generates and processes dependencies;
  • Can hanlde cross-compiling or cross-platform projects (e.g. Linux, MacOS, Windows);
  • Can work with C projects, C++ projects, or mixed;
  • With examples in-file, and flags for high performance with small size of binary;
  • Not only for executable binaries, but also for static & dynamic libraries [to-do].

Usage:

  1. Copy the Makefile file to your program source code directory.
  2. Customize in the "Customizable Section" only if necessary:
    • to use non-standard C/C++ libraries, set pre-processor or compiler options to <EXTRA_CFLAGS> and linker ones to <EXTRA_LIBS>
    • to search sources in more directories, set to <SRCDIRS>
    • to specify your favorite program name, set to <PROGRAM>
  3. Type make to start building your program.

Make Target:

The Makefile provides the following targets to make:

   make            # compile and link
   make NODEP=yes  # compile and link without generating dependencies
   make objs       # compile only (no linking)
   make tags       # create tags for Emacs editor
   make ctags      # create ctags for VI editor
   make clean      # clean objects and the executable file
   make distclean  # clean objects, the executable and dependencies
   make help       # get the usage of the makefile

Users

Reference & Thanks to

makefiletemplate's People

Contributors

cheedoong avatar

Watchers

James Cloos avatar panda avatar

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.