Questions tagged [make]
21 questions
45
votes
8 answers
Is directly using Make considered obsolete?
So I have been coming across many comments/posts/etc regarding creating makefiles directly, and how it is a silly thing to do in 2015. I am aware of tools such as CMake, and I actually use CMake quite often. The thing is, CMake is just creating the…

JParrilla
- 671
- 1
- 6
- 9
19
votes
6 answers
Why should makefiles have an "install" target?
Coming from the world of C and C++, most build system have an install target, notably Makefiles (where it is recommended by GNU for example) or CMake. This target copies the runtime files (executables, libraries, ...) in the operating system (for…

Synxis
- 307
- 2
- 6
14
votes
3 answers
Why incremental builds in "make" don't use hashing algorithms?
I am a beginner with make and I'm wondering about when to use make clean.
One colleague told me that incremental builds with make are based on the files timestamps. So, if you checkout an old version of a file in your VCS, it'll have an "old"…

filaton
- 309
- 3
- 9
14
votes
4 answers
Is there a general rule for when you should use 'make clean' instead of just 'make'?
I am writing a multiple-filed program right now, and apparently running only 'make' (as one would intuitively think needs to be done in most situations) for some reason causes my program to fail. I guess I can provide more detail of the problem, but…

Dark Templar
- 6,223
- 16
- 46
- 46
11
votes
5 answers
Is a makefile really needed
I have been programming in c/c++ for a while now, and I have never once used a makefile. I know that it is supposed to be useful when you are dealing with a large project, but I have always been able to compile, build and execute my program using…

Ankush
- 821
- 1
- 8
- 12
11
votes
8 answers
How important is it to learn makefiles?
I work in c++ mostly as a hobby (I'm still in school and therefor don't have a real job). The IDEs generate the makefile for me and so I'm wondering if it's worth learning how to make them myself. By "worth learning" I mean, should I drop everything…

sinθ
- 1,311
- 15
- 25
11
votes
2 answers
How many make threads to use?
When I (re-)build large systems on a desktop/laptop computer, I tell make to use more than one thread to speed up the compilation speed, like this:
$ make -j$[ $K * $C ]
Where $C is supposed to indicate the number of cores (which we can assume to…

bitmask
- 879
- 2
- 8
- 19
8
votes
5 answers
Why doesn't Haskell have a 'format' function for string interpolation?
I'm trying to use Shake and I stumbled upon the following problem: there's no easy and convenient way to interpolate a string. I know about Text.Printf — it's not what I'm looking for. The interpolation syntax I'm talking about is like…

Michael Pankov
- 568
- 1
- 5
- 15
7
votes
1 answer
Is it useful to write a clean make target nowadays?
Make comes from a time when version control was fairly immature. I understand the need for a streamlined way to clean the workspace back then.
Nowadays any decent version control tool can clean the unversioned files in the workspace. Files which…

marcv81
- 176
- 5
4
votes
1 answer
Using Makefile as a script repository
Is it reasonable to use Makefile targets as scripts?
So for example, instead of having a script script_A, script_B, etc, and running them as standard executables with ./script_A, we have a makefile that has targets script_A, script_B, and run them…

gardenhead
- 4,719
- 2
- 19
- 24
4
votes
1 answer
Makefile for library project to be able to compile the unit tests and the demo program using make
I am new to makefiles and I am developing a (non-executable) library in C++.
Additionally to the library I have (executable) unit tests and an (executable) demo program.
I would now like to be able to compile the unit tests and the demo program…

user695652
- 529
- 3
- 16
3
votes
1 answer
How to deal with relative paths in out of source build?
An out of source build is a build which can be in any directory other than the source directory
I have a project which contains relative paths to some resource files, needed at runtime, which are located close to the source directory.
But when I…

user695652
- 529
- 3
- 16
3
votes
2 answers
What uses are there today for manually writing Makefiles?
I remember the general gist of writing Makefiles, but, due to CMake, autotools and other such Makefile generators, I've forgotten so many details that, if you were to ask me to write a makefile from scratch for a complex project, well, it would take…

Greg Kramida
- 282
- 2
- 12
3
votes
1 answer
How do I transparently cache data in intermediate stages of processing?
I am working with MATLAB on a model reduction algorithm. It is basically a data processing pipeline.
ckt = generate_ckt(ckt_properties);
freq = generate_fpoints(fconfig);
result = freq_dom_sim(ckt,freq);
red_ckt = run_PRIMA(ckt, red_order);
Each of…

Milind R
- 155
- 8
3
votes
1 answer
Generating CMakeLists.txt
I got a bunch of C++ sources files and headers. They may use external libraries such as Boost e.g. I am interested in the process of building binaries for Windows and *nix.
Makefiles (*nix) and .vcproj (Windows) call compilers with some…

vanna
- 337
- 4
- 13