59
votes
How to run make file from any directory?
You could use
make -C dir
to change to directory dir before reading the pointed makefile. Please notice that option -C is capitalized.
47
votes
Accepted
Compiling C files on Ubuntu and using the executable on Windows
The standard compiler toolchain on Ubuntu will produce Linux executables, not Windows executables. It is possible to install a cross-compiler that will produce Windows executables - this Stack ...
24
votes
Variables in GNU Make recipes, is that possible?
Thanks to https://stackoverflow.com/questions/6519234/cant-assign-variable-inside-recipe
This is the solution to change a variable in a recipe:
recipe:
$(eval variablename=whatever)
16
votes
Accepted
How to get Colored Build Output from Make in Sublime Text 3?
Recent versions of ST3's Makefile build system (as described in the Make.sublime-build file) already contain a syntax definition which produces colorized output.
If you're not happy with that, here's ...
16
votes
Keep color in less after make and pipe
The simplest solution is:
unbuffer make |& less -r
This is based on the answer to Preserve colors while piping to tee
I had to "sudo apt-get install expect" to get the unbuffer command ...
12
votes
Compiling C files on Ubuntu and using the executable on Windows
This is called cross-compiling. You need a "toolchain" (compiler, linker, etc.) that will generate the appropriate code and format, involving:
The target processor architecture. In your case is is ...
11
votes
Using make from Windows PowerShell
2021 - March Windows 10 Enterprise 64Bit Successful Approach
Despite looking old, the gnuwin install for "make" works fine reflecting stability and backward support in Linux and Windows.
I ...
11
votes
8
votes
Accepted
Make install into a temporary directory?
The answer to this question depends on which open source project you're attempting to install this way. The general answer is that some open source projects have Makefiles which provide optional ...
5
votes
Using make from Windows PowerShell
** 2022 update **
With the package manager Chocolatey, run choco install make.
To verify that you now have make, run make --version.
To install Chocolatey, run:
Set-ExecutionPolicy Bypass -Scope ...
5
votes
Variables in GNU Make recipes, is that possible?
taking what @user3645902 mentioned, here is the solution to the main question:
recipe:
@$(eval REV=`svn info $<|grep 'Last Changed Rev'|cut -f4 -d`)
@echo $(REV)
5
votes
Where does "make install" put the files?
"make -n install" will do a dry run of the install process and tell you where things will be installed to.
5
votes
Where do I find nmake for Windows 7 x64
The x64 version of nmake.exe is located in the VC\bin\amd64 subdirectory. The 32-bit version of nmake.exe is located in VC\bin.
If you open up the Visual Studio x64 Command Prompt
VS2013 x64 ...
5
votes
Accepted
make: mk-build-deps: commande not found
The mk-build-deps command is a part of devscripts package , to install it run:
sudo apt-get install devscripts
4
votes
What is the difference between `make clean` and `make distclean`?
Why the libvpx step uses make clean instead of make distclean
At the time of writing the guide libvpx had no rule in its Makefile for the target distclean, so clean was used instead.
Why make (dist)...
4
votes
python3.2 - ERROR:root:code for hash md5 was not found
Your problem is that you're using OpenSSL 1.1 and an old version of Python that doesn't support that version of OpenSSL. Python 3.2 was released in 2011 and OpenSSL 1.1.0 was released in 2016.
Since ...
3
votes
Accepted
How to check if make uninstall will work
Yes it is...
In the Makefile there are different sections.
You can enumerate them by pressing tab after you write make (but before you press enter ;-)).
Search the one with uninstall and check if it ...
3
votes
Jenkins Docker image has no make or sudo
you can run this command, get bash in your container and then install whatever you want:
docker exec -it -u root jenkins bash
otherwise you can configure it into your dockerfile
3
votes
Where does "make install" put the files?
Further to Matteo's answer, you can examine the Makefile to
see where a particular program is going to install. Using GNU Hello as an
example:
/usr/local/src/hello-2.10 $ cat Makefile | grep prefix
.....
3
votes
Where do I find nmake for Windows 7 x64
Nmake doesn't come natively in Windows 10, but you could include it without installing the complete Visual Studio by installing Microsoft Visual C++ Build Tools.
when complete, navigate to this ...
3
votes
Linux From Scratch
The use of a Makefile makes life easier for both the developer and the end user. Basically, it is a cheat sheet of how to build a particular piece of software. For a simple "Hello world" a g++ hw....
3
votes
Accepted
Cannot use `time` keyword in Makefile rule action
Having sh symlinked to bash does not mean that invoking sh will be equivalent to invoking bash.
This is what Archwiki says:
When Bash, mksh and zsh are invoked with the sh name,
they automatically ...
3
votes
Add all firmware to CONFIG_EXTRA_FIRMWARE?
Compiling and booting into an "intermediate" kernel with include/uapi/linux/binfmts.h:MAX_ARG_STRLEN set to (PAGE_SIZE * 128) let an "all firmware" build of kernel 5.17.4 (plus ...
2
votes
How to run make file from any directory?
This is an old question but I like to use a ~/.bashrc alias, which looks like this:
alias makeaway="cd /dir/to/make && make && cd -"
2
votes
What is the character used to indent the Make file rule recipe?
In light of the accepted answer: recipes must be preceded by a tab character, which is automatically replaced if set expandtab is enabled in your .vimrc. Overwriting your .RECIPEPREFIX is not ...
2
votes
Installing lapacke using make on Mac
I'm not quit sure where you got that lapacke* package. the latest version of netlib lapack comes with lapacke inside. to get it installed/compiled:
download the latest lapack from netlib website (you ...
2
votes
Using make from Windows PowerShell
As this is the first result I get on Bing when I search for "PowerShell make", I'm creating this answer to note that the official GNU page and the mirrors have Make for Windows source as ...
2
votes
Using make from Windows PowerShell
Install Make for Windows from GNU Make and add C:\Program Files (x86)\GnuWin32\bin to your Path Path Ubication Edit Path
2
votes
compilation on cygwin64 doesn't work with g++ 4.9.2
I've just had this problem on a fresh Cygwin64 install on Windows 10.
Run cygwin setup, setup-x86_64.exe or setup-x86.exe, search for libcloog, and libisl.
From the Libs category select:
libcloog-...
2
votes
Accepted
fatal error: 'mysql/mysql.h' not found (but added in path)
You have to add -I(replace this with the path where the mysql includes are) to your CFLAGS. The C++ compiler does not look for includes on the PATH.
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
make × 299linux × 97
compile × 34
ubuntu × 33
makefile × 32
installation × 26
bash × 23
macos × 21
windows × 19
cygwin × 19
gcc × 19
build × 19
centos × 12
debian × 11
c++ × 9
vim × 8
python × 8
windows-10 × 7
command-line × 7
mac × 7
redhat-enterprise-linux × 7
terminal × 6
shell × 6
shell-script × 6
perl × 6