Questions tagged [makefile]

A makefile is an input file for the build control language/tool make. It specifies targets and dependencies along with associated commands to perform (a.k.a. recipes) to update the targets.

A makefile is usually an input file for the build control language/tool make. The make utility and the corresponding makefile format is standardized by POSIX.

Common newbie mistakes:

Makefile variable assignment error in echo - running two distinct commands in a recipe and not realizing the shell from the first will exit and lose any changes to the environment.

Make implementations

More information

25125 questions
7
votes
1 answer

CMake multiple toolchains and target platforms

I am changing from plain make to CMake as a build system for a project. The project is supposed to run on different embedded Linux systems each with its own toolchain and also has quite a few different configuration options per target (e.g.…
trenki
  • 7,133
  • 7
  • 49
  • 61
7
votes
2 answers

How to keep newline intact in a sed command used in Makefile (POSIX)?

Note: This is not a duplicate of Is it possible to create a multi-line string variable in a Makefile and other such questions. This question requests POSIX compliant solutions that do not depend Bash-only or GNU Make-only features. The other…
Lone Learner
  • 18,088
  • 20
  • 102
  • 200
7
votes
1 answer

What's the script language inside kernel Makefile?

55 ifeq ("$(origin C)", "command line") 56 KBUILD_CHECKSRC = $(C) 57 endif 58 ifndef KBUILD_CHECKSRC 59 KBUILD_CHECKSRC = 0 60 endif In normal bash,there's no keywords like ifndef...
compiler
  • 4,143
  • 9
  • 36
  • 40
7
votes
3 answers

why automake fails to generate Makefile.in

Trying to use automake/autoconf (versions 1.10 and 2.61, respectively). Everything is working OK, except automake is not generating Makefile.in. There are some warnings generated, but I don't think they're significant. However, the last line makes…
wadesworld
  • 13,535
  • 14
  • 60
  • 93
7
votes
3 answers

How to enable shared library build while using CMake for LLVM?

The problem: Ubuntu 10.10 doesn't supply LLVM CMake modules (/usr/share/llvm) or (/usr/local/share/llvm) when installing LLVM 2.8 from Ubuntu repositories. So I'm now compiling LLVM 2.8 using CMake by myself and then installing it like this: cmake…
Tarantula
  • 19,031
  • 12
  • 54
  • 71
7
votes
6 answers

configure: error: Could not find a version of the library

I am building this DNP3 program and when I follow the build instructions ./configure does not make a make file. When I run it I get the following output: checking for a BSD-compatible install... /usr/bin/install -c checking whether build…
Kyle Coulombe
  • 71
  • 1
  • 2
7
votes
1 answer

Makefile - applying a variable as a prefix to multiple parts of another variable

i have a small java project i want to build using a makefile, the code is in src/package... /*.java, the bytecode should go to bin/package.../*.class. My current file looks like this (simplified): JC = javac SRCDIR = src BINDIR = bin JCFLAGS = -d…
tth
  • 73
  • 1
  • 3
7
votes
4 answers

How to compile python from source and get a clean/minimal install?

If you follow the simple configure -> make -> make install process for compiling python from source code, you end up with a very large install that includes a whole lot of files that are not necessary for a functional python environment. eg: All…
Russ
  • 10,835
  • 12
  • 42
  • 57
7
votes
1 answer

Fail to hit breakpoint of C++ program build with CMake on Ubuntu

I am trying to debug a C++ program with VS Code on Ubuntu. I have build the project by make successfully. I use bin/show dat command to call it from terminal and it works. In VS Code, I install C++ debug tool than create launch.json and tasks.json.…
Summer Sun
  • 947
  • 13
  • 33
7
votes
1 answer

Capitalize first letter of string in Makefile using bash 4 syntax

In bash 4 (and above), to capitalize the first letter of a string stored in variable L1, I can do the following: L1=en Ll1=${L1^} echo $Ll1 This prints En. I'm trying to do something similar within a Makefile, but I can't get the ${L1^} syntax to…
Proyag
  • 2,132
  • 13
  • 26
7
votes
1 answer

how can I use annotationProcessor in android.mk

I just want to use bufferknife and drag2 in my system app, I have built my app with the command mm. I have tried every possible method I could find, but failed! I've only found the below Android.mk by Googling: # Copyright (C) 2015 The Android Open…
feng
  • 71
  • 3
7
votes
2 answers

GNU Make: Check number of parallel jobs

I'd like to add a quick check to a (GNU) makefile which can alert the user to the availability of -j/--jobs (parallel make). That is, something like $ make TIP: this will build faster if you use use "make -j" Building .. $ make -j Building…
Patrick Sanan
  • 2,375
  • 1
  • 23
  • 25
7
votes
2 answers

What's with these g++ "multiple definition" errors?

I'm in the early stages (read:just started yesterday) of a project, and I'm setting up my initial makefile. It's very simplistic. Here's the full contents of the file: all: main.o resource.o g++ -o output.exe main.o resource.o main.o: main.cpp…
Ken Bellows
  • 6,711
  • 13
  • 50
  • 78
7
votes
2 answers

Download list of files from list of URLs as prerequisites in makefile

I'd like to have a makefile for compiling a project, and I need some files (binaries) to be downloaded if they are missing, as it's not a good idea to track them with git. I have a list of URLs and a list of given names for them (and I'd like to be…
7
votes
1 answer

Dynamic linking with rpath not working under Ubuntu 17.10

I build an R package which uses Rcpp and links to a third-party shared object (libbarraopt.so) (which also links to other shared objects such as liboptsrvr.so in its own directory). To ensure that it is able to find those shared objects it links…
Kun Ren
  • 4,715
  • 3
  • 35
  • 50
1 2 3
99
100