diff options
author | Kelvin M. Klann <kmk3.code@protonmail.com> | 2022-10-19 14:06:16 -0300 |
---|---|---|
committer | Kelvin M. Klann <kmk3.code@protonmail.com> | 2022-11-21 17:15:29 -0300 |
commit | 60a95f00bb1a3185fce4bacb5367201685767444 (patch) | |
tree | e4f7d7ab251be37f354d8626c1c6a331c0b857b8 | |
parent | makefiles: rename H_FILE_LIST and C_FILE_LIST (diff) | |
download | firejail-60a95f00bb1a3185fce4bacb5367201685767444.tar.gz firejail-60a95f00bb1a3185fce4bacb5367201685767444.tar.zst firejail-60a95f00bb1a3185fce4bacb5367201685767444.zip |
makefiles: expand HDRS, SRCS and OBJS immediately
Use immediate expansion of the right-hand side (with `:=`) to set the
variables to the output of the commands rather than to the (text of the)
commands themselves.
This should prevent deferred/lazy evaluation, which is something that
might potentially result in the relevant files being looked up each time
that HDRS and SRCS are evaluated.
Commands used to search and replace:
git grep -Ilz '^SRCS' -- src | xargs -0 -I '{}' \
sh -c "printf '%s\n' \"\$(sed \
-e 's/^HDRS =/HDRS :=/' \
-e 's/^SRCS =/SRCS :=/' \
-e 's/^OBJS =/OBJS :=/' '{}')\" >'{}'"
-rw-r--r-- | src/common.mk | 6 | ||||
-rw-r--r-- | src/libpostexecseccomp/Makefile | 6 | ||||
-rw-r--r-- | src/libtrace/Makefile | 6 | ||||
-rw-r--r-- | src/libtracelog/Makefile | 6 |
4 files changed, 12 insertions, 12 deletions
diff --git a/src/common.mk b/src/common.mk index 07082e183..c20aaf52f 100644 --- a/src/common.mk +++ b/src/common.mk | |||
@@ -2,9 +2,9 @@ | |||
2 | # | 2 | # |
3 | # Note: $(ROOT)/config.mk must be included before this file. | 3 | # Note: $(ROOT)/config.mk must be included before this file. |
4 | 4 | ||
5 | HDRS = $(sort $(wildcard *.h)) | 5 | HDRS := $(sort $(wildcard *.h)) |
6 | SRCS = $(sort $(wildcard *.c)) | 6 | SRCS := $(sort $(wildcard *.c)) |
7 | OBJS = $(SRCS:.c=.o) | 7 | OBJS := $(SRCS:.c=.o) |
8 | 8 | ||
9 | CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' $(HAVE_GCOV) | 9 | CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' $(HAVE_GCOV) |
10 | CFLAGS += -DPREFIX='"$(prefix)"' -DSYSCONFDIR='"$(sysconfdir)/firejail"' -DLIBDIR='"$(libdir)"' -DBINDIR='"$(bindir)"' -DVARDIR='"/var/lib/firejail"' | 10 | CFLAGS += -DPREFIX='"$(prefix)"' -DSYSCONFDIR='"$(sysconfdir)/firejail"' -DLIBDIR='"$(libdir)"' -DBINDIR='"$(bindir)"' -DVARDIR='"/var/lib/firejail"' |
diff --git a/src/libpostexecseccomp/Makefile b/src/libpostexecseccomp/Makefile index 284e0973b..c0cab45fb 100644 --- a/src/libpostexecseccomp/Makefile +++ b/src/libpostexecseccomp/Makefile | |||
@@ -1,9 +1,9 @@ | |||
1 | ROOT = ../.. | 1 | ROOT = ../.. |
2 | -include $(ROOT)/config.mk | 2 | -include $(ROOT)/config.mk |
3 | 3 | ||
4 | HDRS = $(sort $(wildcard *.h)) | 4 | HDRS := $(sort $(wildcard *.h)) |
5 | SRCS = $(sort $(wildcard *.c)) | 5 | SRCS := $(sort $(wildcard *.c)) |
6 | OBJS = $(SRCS:.c=.o) | 6 | OBJS := $(SRCS:.c=.o) |
7 | CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIC -Wformat -Wformat-security | 7 | CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIC -Wformat -Wformat-security |
8 | LDFLAGS += -pie -fPIE -Wl,-z,relro -Wl,-z,now | 8 | LDFLAGS += -pie -fPIE -Wl,-z,relro -Wl,-z,now |
9 | 9 | ||
diff --git a/src/libtrace/Makefile b/src/libtrace/Makefile index 60edfc22d..bff003e8f 100644 --- a/src/libtrace/Makefile +++ b/src/libtrace/Makefile | |||
@@ -1,9 +1,9 @@ | |||
1 | ROOT = ../.. | 1 | ROOT = ../.. |
2 | -include $(ROOT)/config.mk | 2 | -include $(ROOT)/config.mk |
3 | 3 | ||
4 | HDRS = $(sort $(wildcard *.h)) | 4 | HDRS := $(sort $(wildcard *.h)) |
5 | SRCS = $(sort $(wildcard *.c)) | 5 | SRCS := $(sort $(wildcard *.c)) |
6 | OBJS = $(SRCS:.c=.o) | 6 | OBJS := $(SRCS:.c=.o) |
7 | CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIC -Wformat -Wformat-security | 7 | CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIC -Wformat -Wformat-security |
8 | LDFLAGS += -pie -fPIE -Wl,-z,relro -Wl,-z,now | 8 | LDFLAGS += -pie -fPIE -Wl,-z,relro -Wl,-z,now |
9 | 9 | ||
diff --git a/src/libtracelog/Makefile b/src/libtracelog/Makefile index 540d2a367..97f33003e 100644 --- a/src/libtracelog/Makefile +++ b/src/libtracelog/Makefile | |||
@@ -1,9 +1,9 @@ | |||
1 | ROOT = ../.. | 1 | ROOT = ../.. |
2 | -include $(ROOT)/config.mk | 2 | -include $(ROOT)/config.mk |
3 | 3 | ||
4 | HDRS = $(sort $(wildcard *.h)) | 4 | HDRS := $(sort $(wildcard *.h)) |
5 | SRCS = $(sort $(wildcard *.c)) | 5 | SRCS := $(sort $(wildcard *.c)) |
6 | OBJS = $(SRCS:.c=.o) | 6 | OBJS := $(SRCS:.c=.o) |
7 | CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIC -Wformat -Wformat-security | 7 | CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIC -Wformat -Wformat-security |
8 | LDFLAGS += -pie -fPIE -Wl,-z,relro -Wl,-z,now | 8 | LDFLAGS += -pie -fPIE -Wl,-z,relro -Wl,-z,now |
9 | 9 | ||