Questions tagged [gnu-make]

This tag is for questions about `gmake`, the GNU version of the `make` utility to maintain and update programs.

GNU Make is the GNU implementation of the Make utility. It is probably the most common version in use today.

GNU Make supports extensions to the Make language beyond the POSIX standard, therefore GNU Make solutions may not work under other versions, so the gnu-make tag is appropriate for questions from those using GNU Make, or pertaining to makefiles written for it.

Documentation

The latest GNU Make manual can be found in several formats here.

See also

make makefile

4424 questions
1
vote
0 answers

How to make the debugger use "make" in VSCode for C/C++ files. What parameters should I add/change in tasks.json or launch.json?

I had to use an external library which is not inbuilt in gcc, which needs linking manually every time I compile. So I changed some environment variables in order for it to work properly with make filename. But VSCode debugger uses gcc so it doesn't…
A J
  • 11
  • 2
1
vote
1 answer

Error handling (if else kind of case) in Makefile

I am in a situation where I want to do something is a target returns error. My code is: pre-submit: cp test.csv test.csv.bk make test.csv make lint rm test.csv.bk This run just fine. But there can be cases when make lint or make…
codingenious
  • 8,385
  • 12
  • 60
  • 90
1
vote
2 answers

Makefile rule with no target

I'm debugging a makefile, and in a macro expansion it creates a rule with no target (as so:) : | directoryA @echo running $@ ... I've looked it up online, and the makefile documentation seems to hint (but not explicitly state) that there…
HardcoreHenry
  • 5,909
  • 2
  • 19
  • 44
1
vote
1 answer

How a new target can call a previous target with additional arguments?

I have such code snippet: .PHONY: program1 program2 a=A b=B c=C program1: @python example.py a=$(a) b=$(b) program2: program1 c=$(c) d=d Due to the DRY principle, I don't want to replicate code and composed program2 in a way calling…
Kenenbek Arzymatov
  • 8,439
  • 19
  • 58
  • 109
1
vote
1 answer

how to write a loop in gnu make that feed list to execuable

I have a lot of files that with .e extension, and I have a custom program that can process and convert them. the custom program take input_file_name and output_file_name ./custom [input] output It needs the [] around the input_file_name. I used…
1
vote
1 answer

`make` not linking locally installed library automatically (CS50x's cs50.h)

I am trying to replicate CS50x's sandbox on my Gentoo system, but I am getting this kind of error when running make % make price cc price.c -o price /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld:…
1
vote
1 answer

Why does gnu make ignore missing dependencies for pattern rules?

A minimal example: %.bar: missing_file.pckl @echo executed When I type make foo.bar, make says "Nothing to be done". Why? The missing_file.pckl does not exist and neither does a rule for it. Shouldn't this raise an error? (I know that you can…
karu
  • 465
  • 3
  • 12
1
vote
2 answers

How to make GNU make run in batches?

I'd like to use make to process a large number of inputs to outputs using a script (python, say.) The problem is that the script takes an incredibly short amount of time to run per input, but the initialization takes a while (python engine + library…
Ben Braun
  • 418
  • 4
  • 10
1
vote
3 answers

Running parallel builds using GNUmake

We are supporting two modes of builds (32 & 64 bit). For that we are having two targets: For 32 bit we have make32 For 64 bit we have make64 Whenever user try to run make command with make32, It will run 32bit build and same way for with make64 it…
Naga
  • 59
  • 8
1
vote
1 answer

cmake: dynamic job pool change

Is it possible to do following? I have a cmake project, I can build it using, say, 16 threads. but in this cmake I include some other project which build as a part of the parent project. The child project cannot be build with 16 thread, for some…
kreuzerkrieg
  • 3,009
  • 3
  • 28
  • 59
1
vote
1 answer

What is the nmake equivalent of filter-out?

I've been given a makefile for ubuntu, and I'm trying to use it with nmake on Windows 10. nmake doesn't seem to recognize the filter-out keyword such as in the following line: OBJS_TEST = $(filter-out $(EXE_OBJ), $(OBJS)) Does nmake have a keyword…
butterflyknife
  • 1,438
  • 8
  • 17
1
vote
0 answers

Error: /usr/bin/ld: cannot find -lpython2.7 collect2: error: ld returned 1 exit status

I'm trying build using make command, But I'm getting following error /usr/bin/ld: cannot find -lpython2.7 collect2: error: ld returned 1 exit status Its saying cannot find -lpython2.7, but I have python2.7 installed. I have googled it around but…
1
vote
3 answers

clearmake doesn't like my MAKEFLAGS=j12 values

I use both GNU Make and - woe is me - ClearCase' clearmake. Now, GNU make respect a flag named MAKEFLAGS, which for me is set to j20 on this multi-core machine I'm on. Unfortunately, clearmake also recognizes this option, yet doesn't except this…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
1
vote
2 answers

Static patterns and conditionals with make

I have a problem with GNU Make 4.2.1. It seems there is some interaction between the syntax of static pattern rules and conditional functions that I do not quite understand. The context: I have a project documented by a set of Markdown files, and I…
Edgar Bonet
  • 3,416
  • 15
  • 18
1
vote
1 answer

Why do builds for various projects fail with ‘Operation not permitted’ using iOS on-device compiler/toolchain?

I am an intermediately skilled Linux/Unix user trying to compile software for an iPad on a (jailbroken) iPad. Many builds (for example, make and tex-live) fail with some Operation not permitted error. This will either look like Can't exec "blah":…
deaton.dg
  • 1,282
  • 9
  • 21