Questions tagged [makefile]

A makefile is usually an input file for the build control language/tool make.

Filter by
Sorted by
Tagged with
23 votes
1 answer
1k views

Portable CMake script

I'm trying to write a portable CMake script for a simple Qt application. The target platforms are Win and Mac OSX. But as you can see, it's quite a monster already. Are there any CMake profs? Can you ...
Roman Kruglov's user avatar
21 votes
3 answers
19k views

makefile dependency generation

I need automatic dependency generation to be done in my makefile. So, I have tried to write one, after googling for similar ones. I have found some ways to do that, ...
user avatar
18 votes
4 answers
3k views

C Makefile boilerplate

This is the current Makefile that I use with my C projects. Here is what I would like to be reviewed: Reusability - is this Makefile easy to use for multiple separate projects with minimal ...
syb0rg's user avatar
  • 21.8k
15 votes
2 answers
42k views

Makefile that places object files into an alternate directory (bin/)

I'm trying to learn how to use makefiles, and this is my attempt at making a makefile that compiles source files in a source directory (src/) into object files that are created in a bin directory. <...
hopeless_nerd's user avatar
12 votes
1 answer
3k views

Bubble Sort in C: Array vs Linked List

A few weeks ago I posted a code review of a linked list so I decided to implement bubble sort on my journey of learning C. Here is the referenced linked list library, though this isn't really what's ...
dysruption's user avatar
11 votes
1 answer
255 views

Makefile for a custom operating system kernel

I'm now posting the second semi-complete part of my operating system makefile. The kernel itself is currently incomplete, so don't be surprised by the small size of the makefile. When the kernel ...
u185619's user avatar
  • 805
10 votes
1 answer
8k views

Generic Makefile handling unit testing and folder structure

I'm going back to C++ and, even though I'm not a beginner in programming and OOP, I'm quite new in the C++ world and I've not mastered the art of Makefiles. I'd like to know what you think about my ...
user avatar
10 votes
4 answers
3k views

Converting GTA Vice City ADF audio files to MP3

I wrote a tiny command line tool that converts ADF audio files from the Grand Theft Auto - Vice City game to MP3 files that can be played outside the game. The ADF file format stores the game ...
glampert's user avatar
  • 17.1k
10 votes
1 answer
188 views

A Makefile to make some Cheese

Excuse the pun in the title, the project this is for is called "Cheddar" (a type of cheese). Github I have recently been writing a language, in which I was using grunt. Grunt was very slow for me, ...
Downgoat's user avatar
  • 902
10 votes
2 answers
6k views

Mocking socket calls in C++

Explanation I'm trying to get better unit test coverage of my server. I needed to mock out some system libraries (I could not find anything that worked easily for C++). Because I did not want to do ...
Martin York's user avatar
  • 94.6k
9 votes
2 answers
11k views

Makefile for C++ OpenGL with GLFW and glad

This is a makefile I wrote to compile a simple OpenGL test project which is going to use the libraries GLFW and the C library glad.c. ...
InvisiblePanda's user avatar
8 votes
2 answers
4k views

Avoid --compiler-options in makefile using nvcc

I am working with CUDA and I am currently using this makefile to automate my build process. However, there are multiple --compiler-options, basically one for each ...
Xaphanius's user avatar
  • 183
8 votes
2 answers
979 views

std::vector<bool> workaround in C++

I've been trying to make an std::vector of boolean values and I got fed up with the specialization. To get around this, I made a wrapper class around ...
S.S. Anne's user avatar
  • 1,715
8 votes
3 answers
589 views

Calculating effective shop inventories from CSV files

Program purpose The purpose for the program is to create a file containing the effective inventory for each stocked item stored in a collection of shops. Input and algorithm details For clarity, ...
pk72's user avatar
  • 113
7 votes
2 answers
811 views

Simple VGA driver for a toy kernel

I learn about OS development and follow the tutorial Bare Bones on OSDev. And I did some extra tasks from the Moving Forward section. I would like to get any suggestion about code improvement, ...
eanmos's user avatar
  • 395
7 votes
2 answers
7k views

Improving Makefile and general C++ project structure

I am a single developer on a numerics project. As it is growing, I would like to improve the Makefile the general organisation of the project structuring of the files workflow As it stands now I ...
Da Frenk's user avatar
  • 105
7 votes
2 answers
3k views

A basic, modern, idiomatic GNU makefile

I have prepared a small makefile for a small project, but I am trying to find what would be the best practices; up to now I have gathered these: relatively idiomatic (typical structures, flows, var ...
hmijail's user avatar
  • 173
7 votes
1 answer
2k views

Updating my package version using only a Makefile

So I have written a Makefile that has a release function that can be run like: make release bump=patch and I want it to be fully ...
Rambatino's user avatar
  • 243
6 votes
3 answers
547 views

Built-in help in a Makefile

My colleagues often ask me, "Dude could you remind me what I have to type to build this target?". So I eventually implemented a nice workaround in my Makefiles. I wanted my Makefiles to have a help ...
nowox's user avatar
  • 1,099
6 votes
1 answer
9k views

Makefile for building ASM/C project

I am building a bare bones freestanding kernel in ASM and C. My make file is below. ...
Sebazzz's user avatar
  • 161
6 votes
1 answer
81 views

Automake for an S/KEY implementation

I've been tasked with giving a legacy codebase some love. The actual code is written in C, but is not very relevant aside from the #includes each file makes. No, ...
JesseTG's user avatar
  • 459
6 votes
1 answer
280 views

Makefile for building classwork from markdown files and LaTeX

The following makefile builds my classwork for my various college classes and builds pdfs to hold the notes I took during class. I would like feedback on my directory structure and any optimizations ...
HSchmale's user avatar
  • 875
6 votes
0 answers
192 views

DSL for Makefile generation for dotfiles using symlinks

As I explain in my rant, I have been searching for a replacement to hand-crafted POSIX-make-compatible makefiles to manage my dotfiles (which use symlinks). I ...
D. Ben Knoble's user avatar
6 votes
0 answers
136 views

Makefile for CodeReview (and other Stack Exchange sites)

This makefile (for GNU Make) has grown slowly as I've been building code samples from this site and others. One thing that's different from most project makefiles is that each binary tends to have its ...
Toby Speight's user avatar
  • 74.4k
5 votes
2 answers
1k views

Command-line Tower of Hanoi game

This code has been revised. See (Rev. 2) Command-line Tower of Hanoi game Compiled with g++ 9.4.0. makefile included. Any ...
Mode77's user avatar
  • 641
5 votes
2 answers
410 views

x86 Single Stage Bootloader

I'm learning OS development and have written a single stage bootloader that loads the kernel, enters to protected mode and finally jumps to the kernel. I'll very appreciate any feedback and ...
eanmos's user avatar
  • 395
5 votes
2 answers
532 views

Makefile for a x86 operating system in C++

I recently had submitted my bashscript for building an OS for review and got valuable feedback, so I rewrote the entire script for a makefile: Makefile ...
aswin mohan's user avatar
5 votes
1 answer
267 views

Generic Makefile

I decided to setup a generic makefile to compile SFML programs, as I'm going to be making a bunch of small apps over the next few weeks playing around with it. I'm still new to writing makefiles (...
user2941616's user avatar
5 votes
1 answer
2k views

Monitor filesystem for continuous integration and build

I've written a simple Python module that depends on watchdog to monitor for modified files, then runs various integration and build processes. I'm fairly new to Python, so I'd appreciate all ...
Martin's user avatar
  • 306
5 votes
2 answers
119 views

Mathematical expression evaluator (C++) Using Flex and Yacc Attempt2

Attempt 2: First Try here. Usage: ./expression Then you can either type expressions that are evaluated when you hit ...
Martin York's user avatar
  • 94.6k
4 votes
3 answers
344 views

Completed Makeshift Bash & Makefile To Compile C++ Examples

I am just experimenting with Bash and Makefiles to make my life easier, and here's what I came up with. Scenario: Files are in a directory containing a tutorial, or an iteration. For example, one ...
Jordan Jelinek's user avatar
4 votes
2 answers
387 views

A clean and efficient makefile for a simple c program

I have an instructor who is very stringent on makefiles only containing rules and dependencies that need to be included. The structure for the program is very basic. The requirement is to produce ...
David Kaczynski's user avatar
4 votes
2 answers
3k views

Makefile to build and debug a C++ console app

I had to create this makefile to build and debug a C++ console app. I just need some hints and tips on how I can organize my makefile. ...
NinjaDeveloper's user avatar
4 votes
3 answers
4k views

Find the greatest common divisor, with unit tests

Introduction I was daunted by the complexity of Makefiles for even seemingly simple projects and I decided to rectify that. I also needed to make myself a few handy command-line tools for convenience ...
Hungry Blue Dev's user avatar
4 votes
3 answers
392 views

Makefile -- Platform Dependency

My application has two parts -- a client and a server. Within this, there are different versions for different platforms. The user specifies this in the args, i.e. "make PLATFORM=x11". However, I ...
Conner Bryan's user avatar
4 votes
4 answers
131 views

Math expression on-the-fly interpreter

In the last few day, I wanted to sharpen my C skills a bit, so I wrote a math expression interpreter that can handle + - * / ( ) and only integers. I just want to know how good this code is, if ...
u185619's user avatar
  • 805
4 votes
1 answer
103 views

How do I simplify the following slice of a Makefile?

Considering the following Makefile: ...
Shoe's user avatar
  • 856
4 votes
1 answer
86 views

Standalone GNU Makefile tracking `@import` statements in Sass

The following is a (working) excerpt from the Makefile I want to use in web projects. I wanted this Makefile to contain all the necessary code and not rely on other self-written files. Partly, because ...
Oliver Scholz's user avatar
4 votes
1 answer
108 views

Makefile for refactored recursive breadth first search Knight Tour

This is my first hand crafted makefile in quite a while. I thought it might be useful for anyone who wants to review the Knights Tour - Improved Refactored Recursive Breadth First Search. I believe ...
pacmaninbw's user avatar
  • 23.8k
4 votes
1 answer
314 views

Simplifying a Makefile

I have a makefile like the one below and I am trying to simplify it. I know I should be assigning variables to cut down on repeated things but I am still confused as to how to properly simplify this ...
user avatar
4 votes
1 answer
424 views

Pandoc builder system

I have created a GNUMake building system for pandoc. It has grown quite a bit, I wonder if I can optimize it further. Would it be possible, for instance, that it only runs a target if the output hasn'...
lf_araujo's user avatar
  • 145
4 votes
1 answer
5k views

Makefile for compiling shared libraries

I have a makefile that I've been using to compile my shared libraries which reads in the files from different folders and then builds the objects and binaries in their own folders. The folder ...
jpmorr's user avatar
  • 141
4 votes
0 answers
45 views

Make stylesheets, with automatic dependency tracking

This is a revision of the code posted here. It's a Makefile that I want to use for compiling Sass files to CSS in web projects. For this, I typically have two folders ...
Oliver Scholz's user avatar
4 votes
0 answers
599 views

Deploy a Python script as an AWS Lambda micro web service

I'm still new to python, but my history is in the C/C++ world with plenty of Makefiles, though I've rarely written from scratch such elaborate ones as this. The Hitchhiker's Guide to Python gave me ...
feuGene's user avatar
  • 363
3 votes
2 answers
2k views

FASTBuild makefile

I'm replacing my Visual Studio project files with FASTBuild makefiles because it builds in a fraction of the time. Right now FASTBuild isn't well known. The official documentation is sorely lacking, ...
Sophit's user avatar
  • 321
3 votes
2 answers
318 views

(Rev. 2) Command-line Tower of Hanoi game

This is a follow-up from Command-line Tower of Hanoi game -- many thanks to those whose reviwed it. By request, the project is also available on GitHub. Forks and bug reports are welcomed. Compiled ...
Mode77's user avatar
  • 641
3 votes
2 answers
5k views

Optimize a Makefile

Since my project is getting bigger every day and I am just a starter in the wonderful world of makefiles, I need some help improving mine because, although it works (almost) as I wish, it really ...
makeMonday's user avatar
3 votes
2 answers
209 views

Generic makefile for C++ projects

Looking at back at the C++ projects I've developed, the Makefiles are a mess. To tell you the truth, I copied one a long time ago and basically have been cutting and pasting it haphazardly ever since....
Jaldhar's user avatar
  • 409
3 votes
1 answer
155 views

Compiling and running a program to generate fractal images

I'm making images. My steps are: create PGM files using a C program convert/resize PGM to PNG using Image Magic remove (big) PGM files To do it I use Make and a Bash script. The Makefile is very ...
Adam's user avatar
  • 175
3 votes
2 answers
953 views

Makefile for a small JNI project

So I'm going to publish this small project on GitHub and I thought I'd better do a makefile for it. The source code consists of 1 Java Class 1 Native JNI module written in C 1 stdlib wrapper object ...
Rodney's user avatar
  • 193