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
1 answer

How to write paths in Makefile for Windows

I'm running Windows 10 and am trying to write a Makefile to compile a C++ file that uses the SFML library as well as the nuklear libraries. I have MinGW installed and added to my PATH, and I also have GNU Make installed and added to my PATH. So I…
Alureon
  • 179
  • 1
  • 3
  • 14
1
vote
2 answers

VScode remote development: How can I run a build task to source environment variables before running the real build task?

I want to setup VScode so I can use build tasks to build my project. The project is build using make, en I have defined a build task that runs make. However, before running make, I normally would source a script that sets my environment variables…
1
vote
2 answers

What is the difference between CMake and GMake?

I am currently working on a project which requires me to learn about CMake and GMake. I read about them but still don't get their applications. Can someone provide a few examples of how CMake and GMake are used in software development? Thank You.
Naman Bansal
  • 191
  • 2
  • 13
1
vote
2 answers

In makefile, how to store multi-line shell output in variable

I have a shell command where it outputs multiple lines. I want to store it in a variable in makefile for later processing in the target. A simplified example: I have this file called zfile1 #zfile1 some text $echo 123 more text $$$#&^$ more…
Topa
  • 90
  • 1
  • 8
1
vote
1 answer

Makefile:How can I control the partial compilation order when I use 'make -j'?

I write a makefile and I want it to execute the program for some reasons after compiling. But it is too slow when I only use the command 'make'.So I add argument '-j' to speed up. I just want it to compile all files first and run the program…
Pudron
  • 66
  • 1
  • 7
1
vote
1 answer

Date in Makefile recipes

I want to create log files with time stamps. In my Makefile, I get the date as following: DATE = $(shell date '+%Y-%m-%d-%H:%M:%S') In my recipe I do a couple of grep on the log file: my_long_run: cd $(MYDIR); Running a tool for a…
tt_pre
  • 147
  • 8
1
vote
1 answer

Is there an automatic variable for all grouped targets in Makefile?

Not seeing anything in documentation, but I could be missing something. If I have: a b &: c echo "targets are $???" $@ will only show a or b, but not both. Is there anything that will expand to a b?
HardcoreHenry
  • 5,909
  • 2
  • 19
  • 44
1
vote
1 answer

Advanced options concatenation in buildroot package .mk file

I'm creating a buildroot package for xmms2 which uses waf build system. For the configuration step I need to pass the parameters based on the config selection. Actually it's one parameter which has comma separated values. It should look like…
Gamadril
  • 907
  • 14
  • 32
1
vote
1 answer

nmake throw error if variable is not defined

I have a makefile which I am running through nmake, as opposed to gnumake. I have some code taken from a makefile intended to gnumake... # out_repo = ifndef out_repo $(error out_repo is not set) endif This does not work with nmake. Is there a way…
Scorb
  • 1,654
  • 13
  • 70
  • 144
1
vote
1 answer

Extract string from path/dir using Make

I’ve a Makefile with multiple git repo’s which I need to clone I use the following which works clone: git clone https://github.company.corp/dev-wi/ws-led.git git clone https://github.company.corp/dev-wi/tools-extension.git git clone…
Beno Odr
  • 1,123
  • 1
  • 13
  • 27
1
vote
2 answers

How can I have clearmake default to GNU compatibility mode?

In a ClearCase codebase I am (unfortunately) working on, I use clearmake -C gnu to build. Can I somehow make GNU the default compatibility mode, so that I don't have to remember to type the extra argument?
einpoklum
  • 118,144
  • 57
  • 340
  • 684
1
vote
1 answer

CMakeLists - Make linker do not find files

I am trying to get running the GPIO_EXTI example from the STM32Cube_FW_F4_V1.24.0 using CMake and the actual GNU Tool Chain Version 9_2019_q4_major on Windows via Cygwin Terminal. The Project shall run on the STM32F4-DISCOVERY board. I have a…
MarksSO
  • 63
  • 1
  • 12
1
vote
2 answers

Can a GNU Make parallel job know which parallel job slot it is running under? (i.e. for -j 50, an index in the range 0..49)

I am trying to use GNU make to run some old code in parallel (say, 50 or 100 instances at a time); but because of a legacy resource issue (sigh), each parallel instance has to execute in a separate directory. Hence I would like to use -j 50 but…
nickpelling
  • 119
  • 9
1
vote
1 answer

Can a rule be declared in a define in gnu-make?

I thought that I could use the define directive in make to make multiple alike rules define TESTPRG ${1}: echo Build ${1} endef $(call TESTPRG,x) But I get this output $ make make: *** No rule to make target 'echo', needed by ' x'. …
Kjeld Flarup
  • 1,471
  • 10
  • 15
1
vote
1 answer

why my makefile works with asterisk as wildcard, but do not with percentage?

In my makefile: default: *.s echo $(basename $<) Does echo the basename, but default: %.s echo $(basename $<) outputs: make: *** No rule to make target '%.s', needed by 'default'. Stop. I have smf.s file in directory, where the makefile…
Herdsman
  • 799
  • 1
  • 7
  • 24
1 2 3
99
100