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
8
votes
2 answers

Python build goes into infinite loop

When trying to build Python 2.7.3 on Snow Leopard, it seems the Make process gets stuck in an infinite loop. It appears that the configure script gets called over and over, which is odd because it is the configure script that creates the Makefile in…
wonderlr
  • 165
  • 2
  • 5
8
votes
1 answer

How to do a conditional statement in makefile

I'm trying to use a commandline var to choose the toolkit we use to compile. When in command line I use a line like: make all-arm OUR_TOOLKIT=1 And, in every makefile implied, i put this include include ARM_Compiler.inc Then, in every makefile,…
Killrazor
  • 6,856
  • 15
  • 53
  • 69
8
votes
1 answer

Makefile for CUDA and C

I am working on a project that uses .c and .cu files. The original package was written entirely in C and had its own Makefile (it was perfectly working). I added the .cu file to the project and now I want to modify the Makefile so that it compiles…
vburca
  • 208
  • 2
  • 10
8
votes
5 answers

Make doesn't rebuild headers when changed

I have a project for which I regularly modify headers and when I do so, and forget to make clean then make, I get all sorts of weird behavior. I'm currently using Qt Creator as my IDE, but I've seen this happen on a Qt-independent project. My…
Drise
  • 4,310
  • 5
  • 41
  • 66
8
votes
2 answers

Makefile : syntax ?=

I have a makefile from Intel in which there is some "?=". Like COMPILER ?= $(GCC_PATH)g++ But EXECUTABLE = run What is the difference between ?= and = and when do I have to use the first one instead of the second one ? Thank you very much.
Vincent
  • 57,703
  • 61
  • 205
  • 388
8
votes
2 answers

How to follow linking order when linking against static library with gnu-make?

I've got the following problem: cc -g -O2 -Wall -Wextra -Isrc -rdynamic -DNDEBUG build/liblcthw.a tests/list_tests.c -o tests/list_tests /tmp/ccpvGjZp.o: In function `test_create': ~/lcthw/tests/list_tests.c:12: undefined reference to…
J0HN
  • 26,063
  • 5
  • 54
  • 85
8
votes
3 answers

Missing Separator Error in Makefile

I am working on Qt 4.7.2 on Windows. I have generated Makefile, Makefile.Debug and Makefile.Release. However, when I try to use mingw32-make to build an executable, I get the following error: mingw32-make -f Makefile.Debug all mingw32-make[1]:…
gizemdemirel
  • 377
  • 2
  • 4
  • 13
8
votes
3 answers

file was built for unsupported file format which is not the architecture being linked (x86_64)

I have a build file on OSX Lion VPATH = src include CFLAGS ="-I include -std=gnu99" hello: hello.o gcc $^ -o $@ hello.o: hello.h hello.c gcc $(CFLAGS) -c $< -o $@ But when I try and run this make file I get the following error ld:…
user156862
8
votes
2 answers

Is dependency on a symlink possible in a Makefile?

I need a couple of symlinks in my project. From src/openlayers, folders img and theme have to be symlinked in contrib/openlayers. The contrib/openlayers folder should also be created automatically. .PHONY: run run: contrib/openlayers/theme…
culebrón
  • 34,265
  • 20
  • 72
  • 110
8
votes
2 answers

Autotools library and object file output control

My goal is to have all object files built in a .objs directory instead of the root of the Makefile, and to have the binaries (and libraries) copied into the project's bin/ directory. But I have been unable to find any resources to explain how to do…
John Bellone
  • 1,351
  • 1
  • 16
  • 29
8
votes
5 answers

How to create two mains in an eclipse C++ project

We've got a program which runs separately, executed with an execvp command. So it needs a main method, but I believe that poses a problem to eclipse with a managed make. Do we have to keep this code segregated into a separate project, or is there a…
Jack BeNimble
  • 35,733
  • 41
  • 130
  • 213
7
votes
1 answer

how to get environment variable value in Android.mk?

Any possibility to get environment variable value inside Android.mk? For example #export MYBASEDIR=/home/whoami/base And, inside Android.mk How to get MYBASEDIR value ? Bear with me for very basic question.
Whoami
  • 13,930
  • 19
  • 84
  • 140
7
votes
0 answers

Leksah: automatically build and/or reinstall dependencies when changed

I'm going to work on a project where I will need to work on both the dependencies and the dependent project at the same time. I have arranged it so that the dependencies lies in separate repos side by side with my dependent program. Now, if I make…
worldsayshi
  • 1,788
  • 15
  • 31
7
votes
6 answers

Where did the first make binary come from?

I'm having to build gnu make from source for reasons too complicated to explain here. I noticed to build it I require the make command itself, in the traditional fashion: ./configure make install So what if I didn't have the make binary already?…
Adam
  • 35,919
  • 9
  • 100
  • 137
7
votes
2 answers

Makefile failing when using diff on different files

Part of my makefile for my C++ project uses the diff command to compare two files that were output by the recently built code. The issue is that if the files are different, the script should not fail and should continue. There are more files that…
gsgx
  • 12,020
  • 25
  • 98
  • 149