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

Having trouble building OpenSSL on Windows 7 64-bit

I am trying to build OpenSSL on Windows 7 for a work project, but I am having trouble. The INSTALL instructions say that the easy way to do this: Quick Start ----------- If you want to just get on with it, do: on Windows (only pick one of the…
Razorfoot
  • 397
  • 2
  • 16
7
votes
1 answer

Syntax error in Makefile: end of file unexpected (expecting "fi")

Here is my make target: copy_python: if test -d $(VIRTUAL_ENV)/lib; then \ cp -a $(VIRTUAL_ENV)/lib/python2.7/site-packages/. ./package/tmp/; \ fi if test -d $(VIRTUAL_ENV)/lib64; then \ cp -a…
7
votes
1 answer

Waf (build tool): PHONY targets like Make?

how do you set a target - maybe Waf calls them "commands" - to always be executed? That is to be like PHONY targets in Make? I'm using Waf to build - among other things - a Visual Studio solution, whose dependencies and recompilation I would prefer…
Eleno
  • 2,864
  • 3
  • 33
  • 39
7
votes
2 answers

Makefile clean not removing *.o files?

I wonder why this won't delete/clean *.o files generated when running make? # UNIX Makefile CXX = g++ LD = g++ CXXFLAGS = -g testlfunction: lfunction.o lfunctionlist.o lprocessor.o testlfunction.o $(LD) -o $@ $^ clean: rm *.o…
nacho4d
  • 43,720
  • 45
  • 157
  • 240
7
votes
2 answers

Output in makefile at top-level

I am setting a variable in a makefile like this: SOMEVAR = foo This makefile later includes some other makefile in which the actual building of programs takes place: include generic/Makefile.common So no build targets are defined in the first…
fuenfundachtzig
  • 7,952
  • 13
  • 62
  • 87
7
votes
1 answer

OpenCV build from source Windows make error "RC Object"

I downloaded the latest source from github and configured opencv and the contrib modules. I can seem to build. I already turned off FFMPEG, which I manually downloaded the .dll previously, i know that has been a recent problem. I have succeeded in…
bw4sz
  • 2,237
  • 2
  • 29
  • 53
7
votes
0 answers

Makefile considering target remade without running any rules

I was answering another question -- Dependency ordering error for multi-job make on SO, and I posted the following makefile. The OP replied back saying if -j wasn't specified on the command line, it wouldn't build the dir1/out/file.bar target... …
blackghost
  • 1,730
  • 11
  • 24
7
votes
1 answer

Exclude list of file extensions from find in bash shell

I want to write a cleanup routine for my make file that removes every thing except the necessary source files in my folder. For example, my folder contains files with the following extensions: .f .f90 .F90 .F03 .o .h .out .dat .txt .hdf .gif. I…
Tal
  • 115
  • 2
  • 6
7
votes
1 answer

cannot specify -o when generating multiple output files [C error]

I have a question about make file using gcc, below is my code in makefile. I got cannot specify -o when generating multiple output files error, but I just cant see where the problem is. Can someone point out my mistakes?…
Total_Noob
  • 103
  • 1
  • 5
7
votes
3 answers

How can I build bootimage without going through all Makefiles

I am currently working on the Linux kernel for an Android phone. My workflow is: Make changes to kernel code Build with make bootimage Flash with fastboot flash boot This works fine. However building takes unnecessary long because make bootimage…
justfortherec
  • 1,590
  • 1
  • 13
  • 17
7
votes
4 answers

Webhooks for branching in Gitlab

Is there a way to have a Webhook fire whenever a branch is updated in Git/Gitlab? I am trying to set up a Development Workflow. The original idea was to have a repository for each coding phase - ex: a repository for development, a repository for…
Casey Harrils
  • 2,793
  • 12
  • 52
  • 93
7
votes
1 answer

Check format for Continous integration

I am trying to write a Makefile command that will output an error if the Go code is not correctly formatted. This is for a CI step. I am struggling with how to get it working in the make file. This solution works on the bash command line: ! gofmt -l…
snorberhuis
  • 3,108
  • 2
  • 22
  • 29
7
votes
2 answers

How to setup a makefile in eclipse (C++)?

I have a project in Eclipse and I want to use my own makefile. I went to project -> properties -> C/C++ Build and unchecked "Generate Makfiles Automatically". I have a makefile named Makefile in the project base dir which just contains: all: …
Amir Rachum
  • 76,817
  • 74
  • 166
  • 248
7
votes
2 answers

How does one use Obj-C 2.0 with GNUstep?

I'm aware of the existence of libobjc2, and I gather that I'll need to use clang rather than GCC, but I can't find any basic instructions of what's different about the compilation process. Can anyone give explicit, step-by-step instructions on…
andyvn22
  • 14,696
  • 1
  • 52
  • 74
7
votes
1 answer

makefile giving unexpected end of file error

HOMEDIR = $(shell pwd) DEFAULT = 4.0.3 YESDIR = $(shell echo $(@:install-%=%) | tr A-Z a-z) NODIR = $(shell echo $(@:clean-%=%) | tr A-Z a-z) install: @$(MAKE) install-$(DEFAULT) install-%: @cd $(HOMEDIR);\ if [ ! -e $(YESDIR) ]; then \ echo…
apramc
  • 1,346
  • 1
  • 15
  • 30
1 2 3
99
100