aboutsummaryrefslogtreecommitdiffstats
path: root/src/libpostexecseccomp
diff options
context:
space:
mode:
authorLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2022-07-15 02:40:30 -0300
committerLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2022-11-21 17:23:00 -0300
commita1e29acb44b706d56609204bb791afc2aa6a7d10 (patch)
treeca324f8cb4508352b8ba6b8fbfea325023100fd5 /src/libpostexecseccomp
parentmakefiles: deduplicate many makefiles into common.mk (diff)
downloadfirejail-a1e29acb44b706d56609204bb791afc2aa6a7d10.tar.gz
firejail-a1e29acb44b706d56609204bb791afc2aa6a7d10.tar.zst
firejail-a1e29acb44b706d56609204bb791afc2aa6a7d10.zip
makefiles: deduplicate main target name into new SO var
Put the main target name into a new SO variable, put SO into a new TARGET variable, make "all" depend on `$(TARGET)` and replace every other occurrence of the main target name with `$(SO)`. On the makefiles that build shared objects, to make them more similar. With this commit, all of their targets are identical.
Diffstat (limited to 'src/libpostexecseccomp')
-rw-r--r--src/libpostexecseccomp/Makefile9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/libpostexecseccomp/Makefile b/src/libpostexecseccomp/Makefile
index 870c32891..304138f52 100644
--- a/src/libpostexecseccomp/Makefile
+++ b/src/libpostexecseccomp/Makefile
@@ -1,6 +1,9 @@
1ROOT = ../.. 1ROOT = ../..
2-include $(ROOT)/config.mk 2-include $(ROOT)/config.mk
3 3
4SO = libpostexecseccomp.so
5TARGET = $(SO)
6
4MOD_HDRS = ../include/seccomp.h ../include/rundefs.h 7MOD_HDRS = ../include/seccomp.h ../include/rundefs.h
5 8
6HDRS := $(sort $(wildcard *.h)) $(MOD_HDRS) 9HDRS := $(sort $(wildcard *.h)) $(MOD_HDRS)
@@ -10,16 +13,16 @@ CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' -fstack-prot
10LDFLAGS += -pie -fPIE -Wl,-z,relro -Wl,-z,now 13LDFLAGS += -pie -fPIE -Wl,-z,relro -Wl,-z,now
11 14
12.PHONY: all 15.PHONY: all
13all: libpostexecseccomp.so 16all: $(TARGET)
14 17
15%.o : %.c $(HDRS) $(ROOT)/config.mk 18%.o : %.c $(HDRS) $(ROOT)/config.mk
16 $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ 19 $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@
17 20
18libpostexecseccomp.so: $(OBJS) $(ROOT)/config.mk 21$(SO): $(OBJS) $(ROOT)/config.mk
19 $(CC) $(LDFLAGS) -shared -fPIC -z relro -o $@ $(OBJS) -ldl 22 $(CC) $(LDFLAGS) -shared -fPIC -z relro -o $@ $(OBJS) -ldl
20 23
21.PHONY: clean 24.PHONY: clean
22clean:; rm -fr $(OBJS) libpostexecseccomp.so *.plist 25clean:; rm -fr $(OBJS) $(SO) *.plist
23 26
24.PHONY: distclean 27.PHONY: distclean
25distclean: clean 28distclean: clean