aboutsummaryrefslogtreecommitdiffstats
path: root/src/libtracelog/Makefile
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/libtracelog/Makefile
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/libtracelog/Makefile')
-rw-r--r--src/libtracelog/Makefile9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/libtracelog/Makefile b/src/libtracelog/Makefile
index 7f74df339..e272fd77e 100644
--- a/src/libtracelog/Makefile
+++ b/src/libtracelog/Makefile
@@ -1,6 +1,9 @@
1ROOT = ../.. 1ROOT = ../..
2-include $(ROOT)/config.mk 2-include $(ROOT)/config.mk
3 3
4SO = libtracelog.so
5TARGET = $(SO)
6
4MOD_HDRS = ../include/rundefs.h 7MOD_HDRS = ../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: libtracelog.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
18libtracelog.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) libtracelog.so *.plist 25clean:; rm -fr $(OBJS) $(SO) *.plist
23 26
24.PHONY: distclean 27.PHONY: distclean
25distclean: clean 28distclean: clean