aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2022-05-06 21:00:19 -0300
committerLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2022-06-12 16:08:47 -0300
commitda6d855dc29e0db10ecf1065f9860a2874b6bf07 (patch)
tree1ccebf31579401effbd97467ccce86b84805eeba /configure.ac
parentcommon.mk.in: fix comment about file usage intent (diff)
downloadfirejail-da6d855dc29e0db10ecf1065f9860a2874b6bf07.tar.gz
firejail-da6d855dc29e0db10ecf1065f9860a2874b6bf07.tar.zst
firejail-da6d855dc29e0db10ecf1065f9860a2874b6bf07.zip
makefiles: define root dir and include relative to it
A non-absolute path on an include command is always treated as being relative to the directory in which "make" was started in, rather than being relative to the makefile that contains the command. For example, given the following project structure and file contents: * Makefile: include src/foo.mk * src/foo.mk: include bar.mk * src/bar.mk: Running "make" on the root project directory (that is, where "Makefile" is) yields the following: src/foo.mk:1: bar.mk: No such file or directory As "bar.mk" in "include bar.mk" is relative to the current (process) directory (that is, "./bar.mk") and not to where foo.mk is located in ("./src/bar.mk"). So on every makefile that contains an include command, define the root project directory in the ROOT variable and always include relative to it, to later enable any included mkfiles to include other mkfiles without having to worry about the correct path. Commands used to search and replace: $ git grep -Flz 'include ../common.mk' -- src | xargs -0 -I '{}' sh -c \ "printf '%s\n' \"\`sed 's|include ../common.mk|ROOT = ../..\ninclude \$(ROOT)/src/common.mk|' '{}'\`\" >'{}'" Environment: GNU make 4.3-3.1 on Artix Linux
Diffstat (limited to 'configure.ac')
0 files changed, 0 insertions, 0 deletions