Questions tagged [make]

make is a utility that automates the build process by managing dependencies amongst targets.

Filter by
Sorted by
Tagged with
7
votes
2answers
7k 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 ...
27
votes
4answers
22k 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? ...
19
votes
3answers
8k 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 ...
41
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 ...
8
votes
5answers
48k 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. ...
6
votes
4answers
658 views

How to send stderr to stdout with a pipe to another command?

I'm trying to capture all of the output of a build operation, and send it to myprogram. I seem to only be able to capture part of it. This is what I'm trying: make clean && make ...
3
votes
2answers
2k views

Makefile shell ignoring sed regexp end of line

I have a folder for various testing of C code, containing many files named *.c. My aim is to have a Makefile search for any filename ending in .c and add the root of that filename to the targets. ...
1
vote
1answer
335 views

Linux from Scratch 8.1. Issue related to Zlib 1.2.11

I am doing Linux from Scratch. I am currently at 6.11 section i.e zlib 1.2.11 in LFS 8.2 . I did the following as per the book: 1) Prepare Zlib for compilation: ./configure --prefix=/usr 2)Compile ...
1
vote
1answer
112 views

Is there a way to tell make to apply a rule to every file that matches a pattern?

I am working on a project that has a directory structure that looks a bit like this: inputs/ a.txt b.txt c.txt outputs/ a.out b.out c.out makefile The files in the outputs folder ...
65
votes
8answers
48k 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 ...
49
votes
4answers
38k 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 ...
27
votes
3answers
30k 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 ...
18
votes
4answers
10k 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 ...
17
votes
2answers
34k 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$(...
18
votes
3answers
9k 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 (...
11
votes
4answers
8k 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 ...
8
votes
1answer
7k 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 ...
5
votes
2answers
26k views

Problems with CMake in CentOS 6

I try to install a software in CentOS 6.2, without success. In README file it says: Requirements: - qt4 gui lib version >= qt4.6.x Note that many linux distributions split packages into a ...
4
votes
3answers
28k views

Ubuntu make fails with No such file or directory /lib/modules/3.4.0/build

I am trying to build the CP210x driver for the 3.x.x kernel on ChrUbuntu. Build instructions: Ubuntu: make ( your cp210x driver ) cp cp210x.ko /lib/modules/<kernel-version>/kernel/drivers/usb/...
5
votes
4answers
5k views

What is a subshell (in the context of the documentation of make)?

I'm reading a book about the make command and there is a paragraph: If any of the prerequisites has an associated rule, make attempts to update those first. Next, the target file is considered. ...
7
votes
1answer
2k views

Strange behavior automating with “make -f”

I have a set of directories, some of which contain makefiles, and some of the makefiles have clean targets. In the parent directory, I have a simple script: #!/bin/bash for f in *; do if [[ ...
6
votes
2answers
3k views

How do I install an older version of GNU make using apt on Ubuntu 16.04?

The installed version is 4.1 and need to downgrade to 3.81. I searched apt for make 3.81, but I couldn't find it.
4
votes
2answers
3k 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 ...
2
votes
1answer
715 views

To write this Pseudocode with Regex

I am doing a Makefile which I run regularly by Crontab every day at 0230 crontab -e; 30 2 * * * /bin/thePseudocode Python-like Pseudocode directories = ["Cardiology", "Rheumatology", "Surgery"] for ...
1
vote
1answer
1k views

What are the differences of editing UTS_RELEASE and EXTRAVERSION?

UTS_RELEASE is in include/generated/utsrelease.h EXTRAVERSION is in makefile For example my kernel has UTS_RELEASE "4.4.30-7+" and the EXTRAVERSION contains -7+ Both are affecting the result of ...
1
vote
1answer
5k views

Looping over directory entries in bash and saving to an array

(See update at the foot of the question). This is a followup question to "Make directory copies using find". This question involved manipulating a bunch of directories, This got too complicated to ...
0
votes
4answers
978 views

Makefile alternative for those who don't want tab indenting all content under the opener

Is there a GNU make alternative if don't want to use tab indents in my make program (or make-like) program? For example, when I use make, I need to indent everything after the make opener, (% :). ...
6
votes
5answers
13k views

Cannot Compile Apache: “Error, SSL/TLS libraries were missing or unusable”

Arch Linux 2011.08.19 (Linux 3.4.2 i686) Apache 2.2.22 → 2.2.22 (recompile & reinstall) OpenSSL 1.0.1.c-1 These details are likely irrelevant, but: I’m using yaourt with customizepkg to build ...
4
votes
1answer
12k views

Makefile error: empty variable name

I am writing a simple Hello World kernel module. The Makefile I wrote is giving me such an error: esp@ubuntu:~/task1-2$ make all make -C /usr/src/linux-headers-3.13.0-35-generic SUBDIRS = /home/esp/...
4
votes
2answers
2k views

Autocompletion for Makefile rules in tcsh

I'm using tcsh in a SUSE 11 box and I realized that when typing makeTab it allows me to auto-complete the rules available within the Makefile, not the files that are inside the current directory. ...
3
votes
1answer
234 views

unresolved dependencies of bz* files for rpm make from source

I am trying to do a build of rpm from source. I got through the ./configure and ran through a good chunk of make. Unfortunately, I keeping getting stopped up on undefined references to bzerror, ...
2
votes
1answer
438 views

GNU install -d recursive?

I have 3 commands to create the folders necessary in a Makefile: install -d $(DESTDIR)/usr/lib/app install -d $(DESTDIR)/usr/lib/app/scripts install -d $(DESTDIR)/usr/lib/app/scripts/...
1
vote
1answer
76 views

Calling wget from make based on a pattern

I'm using make to grab a set of files that are updated daily on a Web site. What I'd like to do is place the files into a folder named with the date, and then use make to do other processing on the ...
1
vote
4answers
1k views

Argument list too long error with makefile

In a makefile, I have @echo "$(IGNORE_DIRS) $(CLEAN_FILES) $(CLEAN_DIRS) $(REALCLEAN_FILES)" | tr ' ' '\n' >> $@ The problem is that $(CLEAN_FILES) is quite large, so when I run make, I get ...
0
votes
0answers
59 views

Trouble installing GS from source

I'm trying to install Ghostscript 9.23 from source, and getting some errors I'm not familiar with. I'm using CentOS. $ cat /proc/version Linux version 2.6.9-67.ELsmp (brewbuilder@ls20-bc1-14.build....
0
votes
0answers
71 views

Cannot build source from FreeBSD live CD

I screwed up my FreeBSD system, so I'm going to fix it from a FreeBSD live CD. First, I boot into the live CD, mount the partition where the broken system resides in with mount -t ufs /dev/ada0p5 /...
0
votes
2answers
640 views

make: xscale_be-gcc: Command not found

I'm new to embedded and am reading 'Embedded Linux Primer' at the moment. I tried to build an xscale arm kernel: make ARCH=arm CROSS_COMPILE=xscale_be- ixp4xx_defconfig # # configuration written to ...
0
votes
1answer
847 views

Set newly created file as variable in makefile [closed]

I am trying to create a file and set the contents of a file to a variable but the variable is always seen as empty. An example: define FILE_VAR cat /output/1.txt >> /output/2.txt $(...