• Stars
    star
    136
  • Rank 267,670 (Top 6 %)
  • Language Makefile
  • Created over 10 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A handy makefile for simple C/C++ applications

Easymake

Introduction

Easymake is a handy makefile for C/C++ applications on Linux system. For simple applications, you don’t even need to write a single line of makefile code to build your target with easymake.

Features description:

  • Finds and compiles all C/C++ source files in the directory recursively (optional). Places the object files and target files in a separate directory.
  • Only re-compiles the changed and affected source files. That is, if you modify your header foo.h, all your source files with #include "foo.h" will be re-compiled.
  • Supports Simple unit testing.
  • Handles more than one entry point in the project.
  • Support both static library(libfoo.a) and shared library(libfoo.so) building.

NOTICE: Easymake is designed to be easy to use on simple applications, not as a highly flexible or extensible template. If you want more customization, you might need to look for a small and simple example for start.

Getting Started

Basics

git clone https://github.com/roxma/easymake
cd easymake/samples/basics
cp ../../easymake.mk Makefile
make
./bin/add  # if you rename add.cpp to myprogram.cpp, then you get ./bin/myprogram.cpp

basics

Unit Testing

Files with *_test.cpp or *_test.c pattern will be used for testing (inspired by golang).

unit_test

Multi Entries

multi_entries

Options

Easymake is trying to follow the Makefile Conventions (1) (2). The following options are supported.

  • CFLAGS Extra flags to give to the C compiler.
  • CXXFLAGS Extra flags to give to the C++ compiler.
  • LDFLAGS Extra flags to give to compilers when they are supposed to invoke the linker
  • LDLIBS Library flags or names given to compilers when they are supposed to invoke the linker
  • ARFLAGS Flags to give the archive-maintaining program; default cr

Recommended Style

In the GIFs, I simply copy easymake.mk into my souce code directory as a makefile. However, for code simplicity, I recommend the following style:

CXXFLAGS=-O2

# other options
# ...

include /path/to/easymake.mk

More Repositories

1

nvim-completion-manager

⚠️ PLEASE USE https://github.com/ncm2/ncm2 INSTEAD
Python
927
star
2

vim-tmux-clipboard

seamless integration for vim and tmux's clipboard
Vim Script
272
star
3

nvim-yarp

Yet Another Remote Plugin Framework for Neovim
Vim Script
228
star
4

vim-hug-neovim-rpc

EXPERIMENTAL
Python
219
star
5

vim-paste-easy

Automatically set paste for you
Vim Script
99
star
6

SMS-Forward

A very simple Android SMS forwardning APP. [NOT MAINTAINING]
Java
79
star
7

cpp_learn

PHP
69
star
8

LanguageServer-php-neovim

Vim Script
39
star
9

ncm-clang

DEPRECATED use https://github.com/ncm2/ncm2-pyclang instead
Python
29
star
10

envrc-rs

Auto source bash .envrc of your workspace
Rust
29
star
11

python-support.nvim

[DEPRECATED] use a single command :PythonSupportInit to initialize python support for neovim.
Vim Script
25
star
12

nvim-cm-tern

Python
24
star
13

SimpleAutoComplPop

Please use https://github.com/ncm2/ncm2 instead
Vim Script
22
star
14

nvim-cm-racer

Neovim/vim8 completion for rust
Python
17
star
15

vim-window-resize-easy

Vim Script
17
star
16

ncm-phpactor

USE https://github.com/phpactor/ncm2-phpactor FOR NCM2!
Python
13
star
17

ncm-github

[DEPRECATED] use https://github.com/ncm2/ncm2-github instead
Python
11
star
18

vim-syntax-compl-pop

Vim Script
9
star
19

vim-encode

Provides simple stirng encode/escape functionality inside vim
Vim Script
8
star
20

ncm-rct-complete

rcodetools source for nvim-completion-manager
Python
4
star
21

nvim-ascript

Vim Script
3
star
22

ncm-flow

flow completion source for nvim-completion-manager
Python
2
star
23

nvim-cm-php-language-server

Vim Script
2
star
24

aps-agent

Application Performance Statistics
C++
1
star
25

tmux-yank.el

Emacs Lisp
1
star
26

modus-themes

Forked from https://gitlab.com/protesilaos/modus-themes
Emacs Lisp
1
star
27

ncm-elm-oracle

elm-oracle source for nvim-completion-manager
Python
1
star
28

stm32f1-blinky

A Minimal Project Template for STM32F10x Development on Linux
C
1
star