Questions tagged [make]

For questions pertaining to make, a utility that automates the build process by managing dependencies amongst targets. Use this tag for questions about make itself or questions about issues arising from using the make command-line utility.

Filter by
Sorted by
Tagged with
70
votes
8answers
55k views

Why can't gcc find libevent when building tmux from source?

I want to install tmux on a machine where I don't have root access. I already compiled libevent and installed it in $HOME/.bin-libevent and now I want to compile tmux, but configure always ends with ...
56
votes
7answers
58k views

How to determine the maximum number to pass to make -j option?

I want to compile as fast as possible. Go figure. And would like to automate the choice of the number following the -j option. How can I programmatically choose that value, e.g. in a shell script? ...
54
votes
4answers
41k views

What is the purpose of the 'install' command?

I've seen the install command used in a lot of Makefiles, and its existence and usage are kind of confusing. From the manpages, it seems like a knockoff of cp with less features, but I assume it ...
50
votes
8answers
58k views

Makefile include env file

I'm trying to include some env vars into a Makefile. The env file looks like: FOO=bar BAZ=quux Note there's no leading export to each env var. If I add the leading export and just include the env ...
49
votes
1answer
124k views

make fatal error: openssl/sha.h: No such file or directory

I'm trying to compile a program that, according to the documentation, requires the "OpenSSL library". I have OpenSSL installed, and it's still giving me the error openssl/sha.h: No such file or ...
46
votes
9answers
57k views

jemalloc and other errors making redis on centos 6.4

I am setting up a new, dedicated, centos 6.4 system with redis. I have installed redis many times, but have never hit this issue (and have never been on centos 6.4 before). cd redis-2.6.16 sudo make ...
42
votes
1answer
4k views

How does this Makefile makes C program without even specifying a compiler?

I was using a Makefile from the book "Advanced Linux Programming (2001)" [code]. It was strange for me to see that GNU make does compile the code correctly, without even specifying a compiler in the ...
36
votes
3answers
45k views

What are .in files?

Sometimes in the sources of projects I see "*.in" files. For example, a bunch of "Makefile.in"s. What are they for and/or what does the ".in" part mean? I assume that this has something to do with ...
35
votes
10answers
6k views

Why are programs not distributed in compiled format?

But they give instructions like cd downloaded_program ./configure make install This creates the ELF that is needed, and probably some .so files. Why not put those inside a zip file for download, ...
33
votes
2answers
25k views

How to list all targets in make?

Let's say you have a project structure with lots of Makefiles and there is a top level Makefile that includes all the other. How can you list all the possible targets? I know writing make and ...
30
votes
8answers
106k views

How do I change which version of Qt is used for qmake?

I feel like there should be a simple way of doing this, but my googlefu is failing so I'd really appreciate some info on how to switch (or even permanently change) which version of Qt is used when ...
30
votes
1answer
24k views

What happens in each step of the Linux kernel-building process?

I've read many tutorials about how to build custom kernels and boot Ubuntu using those kernels, and successfully followed the guides and booted custom kernels, but I have no understanding about what ...
28
votes
2answers
159k views

Where can I find a list of 'make' error codes?

I am trying to compile a program written in Fortran using make (I have a Makefile and, while in the directory containing the Makefile, I type the command $ make target, where "target" is a system-...
28
votes
3answers
73k views

Don't stop make'ing if a command fails, but check exit status

I am trying to instruct GNU Make 3.81 to not stop if a command fails (so I prefix the command with -) but I also want to check the exit status on the next command and print a more informative message. ...
27
votes
2answers
70k views

Checking environment variables' value in Makefile

I have a Makefile target, in which I have to check the value of an environment variable. But, I don't get the exact syntax of it. Tried hard, but can't find it. Any help is appreciated. Environment ...
26
votes
4answers
20k views

How to display dependencies given in a makefile as a tree?

Problem I want to see the dependencies for one or more targets of a makefile. So I am looking for a program that can parse makefiles and then will represent the dependencies in some tree-like format (...
23
votes
2answers
21k views

.PHONY all rules in GNU make file?

Am I wrong in my interpretation that I should basically just put first before all make rules: .PHONY: all of my rules all: echo "Executing all ..." of: echo "Executing of ..." my: echo ...
19
votes
3answers
72k views

Difference between “make install” and “sudo make install”

Sometimes I encounter problems with using make install which gives me a permission denied error when writing to some folders. So instinctively I use sudo make install. Will this introduce additional ...
19
votes
3answers
9k views

Installing from source. How to resolve dependencies without destroying the package manager

Compiling and installing software is a pain and problem I cannot overcome. I just want to run down through my understanding of this process with someone more knowledgeable to clear my mind to get to ...
18
votes
2answers
43k views

Why current directory doesn't change in makefile?

I'm trying to run a simple script- clone a git repository into a certain directory, then cd to this directory in order to execute an installation script. This script is in a Makefile. But the cd ...
18
votes
4answers
72k views

How to write exactly bash scripts into Makefiles?

I love to type bash scripts, but if I prepare multiple tools, project's root directory is filled with so many shell scripts. That's why I prefer using Makefile. Makefile is good. However I want to ...
18
votes
4answers
12k views

Why people recommend the -j3 option for make when having a dual-core CPU?

In Gentoo Linux it is possible to set the MAKEOPTS variable in /etc/portage/make.conf to tell make how many jobs it should run in parallel when building packages. Since I have a dual-core CPU, I ...
18
votes
5answers
16k views

What could be causing make to hang when compiling on multiple cores?

Yesterday I was trying to compile the ROOT package from source. Since I was compiling it on a 6 core monster machine, I decided to go ahead and build using multiple cores using make -j 6. The ...
17
votes
5answers
13k views

Compare two kernel config files from the menuconfig perspective?

I have a situation in which i have two kernel config files (for the same kernel source ). Both of them have a part of the functionality that i need (on one, USB works correctly, on other, the second ...
17
votes
2answers
21k views

Why both `make clean` and `make mrproper` are used?

It is written in the linux kernel Makefile that clean - Remove most generated files but keep the config and enough build support to build external modules mrproper - Remove all generated files ...
17
votes
2answers
40k views

How to include local header files in linux kernel module

Say I have a module mymod with source files as follows: src/mod/mymod.c src/inc/mymod.h I try to include mymod.h as follows #include <mymod.h> My makefile contains EXTRA_CFLAGS= -I$(...
16
votes
2answers
31k views

How to append some text to a variable in makefile?

I have a Makefile. Somewhere in the makefile there is a variable defined: FOO=hello Later on I need to append some text to FOO's content. I tried it like this: FOO=$(FOO)_world I suggested that ...
15
votes
2answers
27k views

What does % symbol in Makefile mean

I am playing around with makefiles and I came across %.o or %.c. From what I understood, it specify all c or o files. But why this work: %.o: %.c $(CC) -c $^ -o $@ and this doesn't work ...
15
votes
1answer
3k views

Restricting GNU‑Make to POSIX Make behaviour

Is there a known way to make Linux's make reject unintended use of GNU‑Make specific extensions in Makefile when editing or using other's Makefile in Linux? I mean, restricting GNU‑Make to behave as ...
14
votes
2answers
36k views

“No target” error using Make

I'm learning how to use make and makefiles, so I wrote this little file: %.markdown: %.html pandoc -o $< $@ But when I run make, all I get is make: *** No targets. Stop. What's going on?
14
votes
1answer
43k views

Pass an option to a makefile

Makefile my_test: ifdef $(toto) @echo 'toto is defined' else @echo 'no toto around' endif Expected behavior $ make my_test no toto around $ make my_test toto toto is defined ...
14
votes
3answers
107k views

How do I fix “make: No rule to make target `config'”? [closed]

When I type make config in the terminal, the system responds with: make: *** No rule to make target `config'. Stop. Any idea how to fix that problem?
14
votes
1answer
38k views

How to fix “skipping incompatible /usr/lib/libc.a”

I get the following error when I try to build an embedded Linux target on a 64 bit Fedora 16 (Verne): make[3]: Entering directory `/export/home/git/minerva-5.x/third_party/multifiles' mips-linux-gnu-...
14
votes
2answers
5k views

Is `make -j` (with no argument) dangerous? [closed]

Earlier today when building something, I decided to run make as $ make -j perhaps out of habit with other programs such as cabal where -j defaults to a reasonable limit. About 20 seconds later, my ...
13
votes
1answer
19k views

Makefile: Default Value of Variable that is set but has null value

I have a Makefile that has a variable that needs to have a default value in case when variable is unset or if set but has null value. How can I achieve this? I need this, as I invoke make inside a ...
13
votes
1answer
3k views

Process substitution in GNU Makefiles

On a bash prompt, one can execute diff using pseudo files: diff <(echo test) <(echo test) Adding this as is into a Makefile fails: all: diff <(echo test) <(echo test) The error ...
13
votes
2answers
11k views

Simulate the running of a “make install” — a “dry run” or simulator utility?

Is there a generic way of running a bash script and seeing the commands that result, but not actually run the commands - i.e. a "dry run"/simulator of sorts? I have a database install script (...
12
votes
4answers
11k views

how can a makefile detect whether a command is available in the local machine?

I began to use org-mode for planning out my tasks in GTD-style system. Putting every org files in a directory of a Dropbox folder, I run emacs to edit / manage these files from three different local ...
12
votes
3answers
18k views

How to script make menuconfig to automate Linux kernel build configuration?

I want to automate a Linux build but eventually get to a point where I need to run what seems to be a very manual step: make menuconfig. This seems to synchronize configs between the OS and kernel ...
12
votes
1answer
27k views

GCC error trying to exec 'cc1'

I was cross-compiling a Linux kernel for my Raspberry Pi on a laptop (running debian 7) (followed the instructions in Raspberry Pi Kernel Compilation); but when compiling with make ARCH=arm ...
11
votes
3answers
7k views

How does make continue compilation?

I know that I can interrupt a make process anytime without having to recompile the entire source tree again. As I know, make only compiles a target if it's not compiled yet, or the source code is ...
11
votes
2answers
10k views

File function in makefile takes args prefixed by '@' symbol

This code excerpt is from Chapter 8.6 of GNU makefile manual. What does @$@.in for file function arg in a makefile mean? and why are shell commands like rm prefixed by '@' symbol program: $(OBJECTS) ...
10
votes
5answers
60k views

Adding directory to PATH through Makefile

I'm having some trouble in exporting the PATH I've modified inside the Makefile into the current Terminal. I'm trying to add to the PATH, the bin folder inside wherever the Makefile directory is. ...
10
votes
3answers
7k views

Which shell is used in GNU Make files?

I've seen things like echo, mv, if, for, in makefile rules. Some kind of shell commands seem to be recognized. Is this bash? How can I figure out which shell is being used and full list of keywords ...
10
votes
4answers
90k views

make complains “missing separator (did you mean TAB?)”

While trying to install the som_pak-3.1-NAcMoS.tar.gz file, I've used the below commands: $ tar xvf som_pak-3.1-NAcMoS.tar.gz $ cd som_pak-3.1 $ cp makefile.unix makefile $ make $ cd .. $ ln -s ...
10
votes
1answer
8k views

Use multi-threaded make by default?

Is there any way to have make use multi-threading (6 threads is ideal on my system) system-wide, instead of by just adding -j6 to the command line? So, that if I run make, it acts the same as if I ...
10
votes
1answer
12k views

Difference between make-kpkg and make deb-pkg

I would like to know the exact difference between make-kpkg and make deb-pkg . This question asks almost the same thing but with no satisfying answers. Previously I was using make -j `getconf ...
9
votes
1answer
8k views

What does this strange Makefile target “.PHONY” mean?

In this https://github.com/kubernetes/helm/blob/master/Makefile there are targets with a dot in front of them. What is this convention for ? .PHONY: all all: build .PHONY: build build: GOBIN=$(...
9
votes
1answer
1k views

Prevent completion of files for 'make' command in zsh shell

Context zsh shell, oh-my-zsh framework, no special zsh's configuration (same problem with or without zsh-completions): see .zshrc at the end. Trouble If a directory contains: a makefile with ...
9
votes
2answers
10k views

Add environment variable for duration of Make task

I'm using make to handle building files for my application, and those build processes use node modules. Since I install those node modules locally, I have to specify in my $PATH where to call the ...

1
2 3 4 5
18