Difference in details between “make install” and “make altinstall”

Let’s take a look at the generated Makefile! First, the install target: install: altinstall bininstall maninstall It does everything altinstall does, along with bininstall and maninstall Here’s bininstall; it just creates the python and other symbolic links. # Install the interpreter by creating a symlink chain: # $(PYTHON) -> python2 -> python$(VERSION)) # Also create … Read more

GNU Makefile rule generating a few targets from a single source file

The trick is to use a pattern rule with multiple targets. In that case make will assume that both targets are created by a single invocation of the command. all: file-a.out file-b.out file-a%out file-b%out: input.in foo-bin input.in file-a$*out file-b$*out This difference in interpretation between pattern rules and normal rules doesn’t exactly make sense, but it’s … Read more

What do the makefile symbols $@ and $< mean?

$@ is the name of the target being generated, and $< the first prerequisite (usually a source file). You can find a list of all these special variables in the GNU Make manual. For example, consider the following declaration: all: library.cpp main.cpp In this case: $@ evaluates to all $< evaluates to library.cpp $^ evaluates … Read more