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
3 answers

make: $LD_RUN_PATH is ignored

I'm compiling FFmpeg from source. ./configure --enable-shared --enable-gpl --enable-version3 --enable-nonfree --enable-x11grab --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora…
htoip
  • 437
  • 5
  • 19
7
votes
2 answers

guide to mingw make files mingw32-make

I'm a C++ programmer and have experience with GCC on Linux. I want to develop an application in Windows , so i need a full guide to mingw make files, variables and mingw32-make. Is there anybody who can introduce a resource for this?
Hesam Qodsi
  • 1,569
  • 3
  • 25
  • 38
7
votes
2 answers

Can I execute a command in sub folder in makefile

My project folders look like this Makefile /src /flash build.xml /blabla ... I wrote a Makefile like this flash: src/flash/bin-debug/App.swf src/flash/bin-debug/App.swf: cd src/flash ant When I execute make flash, I get the…
guilin 桂林
  • 17,050
  • 29
  • 92
  • 146
7
votes
4 answers

nmake Makefile to Place object files in a separate directory

I have all my source files in the Source folder, The makefile is in the Makefile folder and I want all object files to be placed in Objects folder. It is a C project iam working on. All these three folders are in a folder named Project. Project…
user115897
7
votes
3 answers

How do I disable GCC optimization when using makefiles?

I've just started learning Linux and I'm having some trouble disabling GCC's optimization for one of my C++ projects. The project is built with makefiles like so... make -j 10 && make install I've read on various sites that the command to disable…
inline
  • 695
  • 1
  • 7
  • 17
7
votes
2 answers

Makefile - Pass jobs param to sub makefiles

I have a makefile which calls multiple other makefiles. I'd like to pass the -j param along to the other makefile calls. Something like (make -j8): all: make -f libpng_linux.mk -j$(J) Where $(J) is the value 8 from -j8. I absolutely swear…
Halsafar
  • 2,540
  • 4
  • 29
  • 52
7
votes
1 answer

make & gmake compatible if else statement

Is there any type of if/else statement compatible with GNU make and Berkley make (freeBSD)? GNU MAKE: ifeq ($(BUILD_TYPE), debug) berkley make: .ifdef (BUILD_TYPE)
abrahab
  • 2,430
  • 9
  • 39
  • 64
7
votes
2 answers

Stop compilation immediately with parallel make

Is there any way to make parallel invocations of GNU make (ie. make -jN) cease ALL compilation immediately whenever it encounters an error? Currently I see a "Waiting for unfinished jobs" message & then many lines of output whilst existing make…
Scott Smedley
  • 1,779
  • 20
  • 28
7
votes
1 answer

Working with multiple source file extensions in a makefile

I have a c++ project with various extensions for the source files (.cpp, .c, .cc) and various extensions for the header files (.hpp, .h, .hh). The source files are located in a directory called SRC, and the header files are predictably in a…
user487100
  • 918
  • 1
  • 11
  • 22
7
votes
2 answers

what's the difference between DLDFLAGS and LDFLAGS

A quick question. I found both "DLDFLAGS" and "LDFLAGS" in a sample Makefile. The compiler used is gcc. It looks like they are both used for linkers. I'm wondering what's the difference between them.
user1101096
  • 699
  • 2
  • 6
  • 7
7
votes
1 answer

Error message from make: missing separator

Possible Duplicate: Make error: missing separator I've made many makefiles, but today I was making an easy one and it doesn't work because it is missing a separator. CC = g++ CFLAGS = -O2 -Wall LDFLAGS = MODULOS = externa libreria ann PARTES =…
Jorge Vega Sánchez
  • 7,430
  • 14
  • 55
  • 77
7
votes
3 answers

makefile patternrule with further wildcards in target file name

I need to create a special makefile rule, which is best explained by an example. Maybe we create files with the rules %_test.pdf: %.tex pdflatex -jobname=%_test %.tex %_result.pdf: %.tex pdflatex -jobname=%_result %.tex and it is working…
Bastian Ebeling
  • 1,138
  • 11
  • 38
7
votes
2 answers

Installing FastCGI Dev Kit

I am trying to install the FastCGI Dev kit from here. But I get the error below when I'm trying to make. I have no idea how to resolve. Any ideas? I am using Ubuntu 64 bit. *** Warning: This library needs some functionality provided by -lnsl. ***…
user959129
7
votes
2 answers

Install binaries into /bin, /sbin, /usr/bin and /usr/sbin, interactions with --prefix and DESTDIR

Most packages using Autotools are user-level utilities or at least high-enough level to be completely under /usr, or low enough to be entirely below /usr. I'm writing a package that would need to install some files into /bin, some into /sbin,…
Paweł Hajdan
  • 18,074
  • 9
  • 49
  • 65
7
votes
1 answer

Android.mk conditions

Is there any way to use conditional expressions in Android.mk? I need it to do smth like this: IF arch = AREABI_V7 *use path for my arm_v7 static libs* ELSE *use path for arm static libs*
givi
  • 1,883
  • 4
  • 22
  • 32