Search notes:

make: VPATH variable

VPATH contains a list of directories that should be searched for prerequisite files (and apparently also for targets).
The names of the directories are separated by colons or blanks.
The following Makefile is able to compile proc.c although it is located in the subdirectory src (in relation to the directory in which the Makefile is located).
VPATH=src

prog: prog.c
	gcc $< -o $@

.PHONY: clean

clean:
	@rm -f prog
Github repository about-Makefile, path: /variables/VPATH/example-1/Makefile

See also

Variables
The make directive vpath (note the lowercase letters).

Index