What does CC?= in a Makefile mean?

From http://www.gnu.org/software/make/manual/make.html: There is another assignment operator for variables, `?=’. This is called a conditional variable assignment operator, because it only has an effect if the variable is not yet defined. This statement: FOO ?= bar is exactly equivalent to this (see The origin Function): ifeq ($(origin FOO), undefined) FOO = bar endif Probably CC … Read more

What is the job of autogen.sh when building a c++ package on Linux [duplicate]

The steps: The autogen.sh script generates the configure script (from configure.ac, using autoconf) and any files it needs (like creating Makefile.in from Makefile.am using automake). This requires autotools to be installed on your system, and it must be run when checking out the project from source control (if configure isn’t checked in). People who download … Read more

Updating Make Version on Mac

Here is what I did, and it works on my MacOS: Step1: Install homebrew (installation command comes from https://brew.sh/): /usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)” Step2: Use homebrew to install make brew install make –with-default-names just incase it doesn’t work, try this: brew install homebrew/dupes/make –with-default-names Step3: You need to change the default command to use … Read more

Makefile autocompletion on Mac

This seems to achieve simple bash completions for me on El Capitan: # .bashrc function _makefile_targets { local curr_arg; local targets; # Find makefile targets available in the current directory targets=”” if [[ -e “$(pwd)/Makefile” ]]; then targets=$( \ grep -oE ‘^[a-zA-Z0-9_-]+:’ Makefile \ | sed ‘s/://’ \ | tr ‘\n’ ‘ ‘ \ ) … Read more

Whats meaning of obj-y += something/ in linux kernel Makefile?

Kernel Makefiles are part of the kbuild system, documented in various places on the web, for example http://lwn.net/Articles/21835/. The relevant excerpt is here: — 3.1 Goal definitions Goal definitions are the main part (heart) of the kbuild Makefile. These lines define the files to be built, any special compilation options, and any subdirectories to be … Read more

Is there something in the ninja language that makes it faster than make?

In short, Ninja parses faster, and has built-in features that reduce the amount to parse. From the philosophical overview in the ninja manual: Where other build systems are high-level languages, Ninja aims to be an assembler. Ninja files are often “compiled” from other makefiles, making it a two-step process whereas Make is a single step. … Read more

tech