Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Coderlane/makefile

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

makefile

I've included a few example projects in this repo. Some use straight makefiles and some use CMake to generate makefiles.

Make

I get tired of remaking makefiles all the time, so I have a few generic makefiles for small projects. I frequently layout my projects as follows:

|-- README.md
|-- makefile
|-- src
|   |-- main.c
|   |-- functions.h
|   |-- functions.c

Where src will hold all of my source files. My makefiles then make an object directory called "obj" and a binary directory called "bin". I also like to have release and debug objects because I use macros for testing and debugging.

When I run make debug my project expands to this:

|-- README.md
|-- makefile
|-- src
|   |-- main.c
|   |-- functions.h
|   |-- functions.c
|-- obj
|   |-- main_debug.o
|   |-- functions_debug.o
|-- bin
|   |-- example_debug

Where bin/example_debug is my binary and my object files can be found in obj.

CMake

I layout my CMake projects in a simmilar manner. Typically it'll look like this:

|-- README.md
|-- CMakeLists.txt
|-- src
|   |-- CMakeLists.txt
|   |-- main.c
|   |-- functions.h
|   |-- functions.c

The src directory still holds all of my source files. However, when I go to build my project I must setup another directory. I'll make a directory called debug and one called release.

|-- README.md
|-- CMakeLists.txt
|-- src
|   |-- CMakeLists.txt
|   |-- main.c
|   |-- functions.h
|   |-- functions.c
|-- debug
|-- release

In these directories I'll configure CMake to build a debug binary and a release binary. To do that I'll either use cmake, ccmake an ncurses cli for cmake, or cmake-gui a Qt gui for cmake.

About

Some example makefiles.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
Morty Proxy This is a proxified and sanitized view of the page, visit original site.