All Projects → mbcrawfo → Genericmakefile

mbcrawfo / Genericmakefile

Licence: mit
A generic makefile for use with small/medium C and C++ projects.

Programming Languages

Makefile
30231 projects
C++
36643 projects - #6 most used programming language
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Genericmakefile

Businesscard Linux
A Buildroot distribution small enough to run on my business card
Stars: ✭ 1,573 (-0.88%)
Mutual labels:  makefile
Openwrt Shadowsocksr
ShadowsocksR-libev for OpenWrt/LEDE
Stars: ✭ 118 (-92.56%)
Mutual labels:  makefile
Openwrt Examples
Examples for creating OpenWrt programs&packages.
Stars: ✭ 120 (-92.44%)
Mutual labels:  makefile
Docker Sinopia
Docker image of Sinopia (deprecated)
Stars: ✭ 116 (-92.69%)
Mutual labels:  makefile
Gfa Spec
Graphical Fragment Assembly (GFA) Format Specification
Stars: ✭ 117 (-92.63%)
Mutual labels:  makefile
Tatoeba Challenge
Stars: ✭ 119 (-92.5%)
Mutual labels:  makefile
Switchmode
an open form contract for open source contractors
Stars: ✭ 114 (-92.82%)
Mutual labels:  makefile
Freebsd Vscode
Visual Studio Code port for FreeBSD
Stars: ✭ 121 (-92.38%)
Mutual labels:  makefile
Opentelemetry Specification
Specifications for OpenTelemetry
Stars: ✭ 2,242 (+41.27%)
Mutual labels:  makefile
Luci tutorials
An outdated outline of a set of LuCI tutorials. (Updates stopped in 2013)
Stars: ✭ 119 (-92.5%)
Mutual labels:  makefile
Drone Tutorial
Drone Continuous Delivery Documentation using docker-compose
Stars: ✭ 117 (-92.63%)
Mutual labels:  makefile
Awesome Cl
A curated list of awesome Common Lisp frameworks, libraries and other shiny stuff.
Stars: ✭ 1,736 (+9.39%)
Mutual labels:  makefile
Kylin Docker
This repository trackes the code and files for building docker image with Apache Kylin.
Stars: ✭ 119 (-92.5%)
Mutual labels:  makefile
Elfhacks
Dive into ELF files using simple self-contained examples
Stars: ✭ 115 (-92.75%)
Mutual labels:  makefile
Arduino.tmbundle
The TextMate Arduino Bundle
Stars: ✭ 119 (-92.5%)
Mutual labels:  makefile
Br Atlas
Create TopoJSON files from IBGE's collection of Brazil maps
Stars: ✭ 114 (-92.82%)
Mutual labels:  makefile
Nordicsnippets
Bare-metal examples for nRF51 and nRF52
Stars: ✭ 118 (-92.56%)
Mutual labels:  makefile
Awesome Dtrace
A curated list of awesome DTrace books, articles, videos, tools and resources.
Stars: ✭ 121 (-92.38%)
Mutual labels:  makefile
Redo
Smaller, easier, more powerful, and more reliable than make. An implementation of djb's redo.
Stars: ✭ 1,589 (+0.13%)
Mutual labels:  makefile
Elsmd
Easy lecture slides made difficult with pandoc and beamer
Stars: ✭ 119 (-92.5%)
Mutual labels:  makefile

GenericMakefile

A generic makefile for use with small/medium C and C++ projects. Allows for easy project setup without the need to create tedious build rules or dependency lists. The c directory contains a makefile configured for C, while the makefile in the cpp directory is configured for C++.

Features

  • Automatically finds and compiles all source files within the source directory.
  • Compiles most recently modified files first, to hopefully find problems earlier.
  • Automatically generates dependecies as files are compiled, ensuring that files are correctly recompiled when dependecies have updated.
  • Includes configurations for normal (release) build and debug build suitable for GDB debugging.
  • Times the compilation of each file and the entire build.
  • Generates version numbers based on git tags (see below), which are passed the compiler as preprocessor macros.
  • By default, builds in a "quiet" mode that only lists the actions being performed. By passing V=true to make, you can compile in verbose mode to see the full compiler commands being issued.

Versioning

Tags should be made in the format vMAJOR.MINOR.PATCH[-description], where MAJOR, MINOR, and PATCH are numeric. The following macros will be generated and passed to the preprocessor:

  • VERSION_MAJOR (int) - The major version number from the most recent tag.
  • VERSION_MINOR (int) - The minor version number from the most recent tag.
  • VERSION_PATCH (int) - The patch version number from the most recent tag.
  • VERSION_REVISION (int) - The number of commits since the most recent tag.
  • VERSION_HASH (string) - The SHA of the current commit. Includes the "-dirty" suffix if there are uncommited changes.

If the makefile is not used in a git repository, or is in a repository with no tags, the version macros are not created.

Limitations

  • Assumes GNU make.
  • Timing does not work correctly with MacOS. See issue #6 for a workaround patch that allows timing in seconds on Mac.
  • Doesn't really support multiple types of source files in the same project.
  • No easy way to exclude files from the build. You can either change the extension of files to be excluded, or use preprocessor flags for conditional compilation.

Thanks to

  • My friend Jay and people on Stack Overflow for help with regex to parse the version info.
  • The residents of /r/programming for suggesting numerous tweaks and improvements.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].