aboutsummaryrefslogtreecommitdiffstats
path: root/src/libtrace
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/libtrace
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/libtrace')
-rw-r--r--src/libtrace/Makefile9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/libtrace/Makefile b/src/libtrace/Makefile
index 4e826b1aa..cb2d66667 100644
--- a/src/libtrace/Makefile
+++ b/src/libtrace/Makefile
@@ -1,6 +1,9 @@
1ROOT = ../.. 1ROOT = ../..
2-include $(ROOT)/config.mk 2-include $(ROOT)/config.mk
3 3
4SO = libtrace.so
5TARGET = $(SO)
6
4HDRS := $(sort $(wildcard *.h)) $(MOD_HDRS) 7HDRS := $(sort $(wildcard *.h)) $(MOD_HDRS)
5SRCS := $(sort $(wildcard *.c)) $(MOD_SRCS) 8SRCS := $(sort $(wildcard *.c)) $(MOD_SRCS)
6OBJS := $(SRCS:.c=.o) $(MOD_OBJS) 9OBJS := $(SRCS:.c=.o) $(MOD_OBJS)
@@ -8,16 +11,16 @@ CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' -fstack-prot
8LDFLAGS += -pie -fPIE -Wl,-z,relro -Wl,-z,now 11LDFLAGS += -pie -fPIE -Wl,-z,relro -Wl,-z,now
9 12
10.PHONY: all 13.PHONY: all
11all: libtrace.so 14all: $(TARGET)
12 15
13%.o : %.c $(HDRS) $(ROOT)/config.mk 16%.o : %.c $(HDRS) $(ROOT)/config.mk
14 $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ 17 $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@
15 18
16libtrace.so: $(OBJS) $(ROOT)/config.mk 19$(SO): $(OBJS) $(ROOT)/config.mk
17 $(CC) $(LDFLAGS) -shared -fPIC -z relro -o $@ $(OBJS) -ldl 20 $(CC) $(LDFLAGS) -shared -fPIC -z relro -o $@ $(OBJS) -ldl
18 21
19.PHONY: clean 22.PHONY: clean
20clean:; rm -fr $(OBJS) libtrace.so *.plist 23clean:; rm -fr $(OBJS) $(SO) *.plist
21 24
22.PHONY: distclean 25.PHONY: distclean
23distclean: clean 26distclean: clean