diff options
author | 2022-07-15 02:40:30 -0300 | |
---|---|---|
committer | 2022-11-21 17:23:00 -0300 | |
commit | a1e29acb44b706d56609204bb791afc2aa6a7d10 (patch) | |
tree | ca324f8cb4508352b8ba6b8fbfea325023100fd5 /src/libtracelog | |
parent | makefiles: deduplicate many makefiles into common.mk (diff) | |
download | firejail-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')
-rw-r--r-- | src/libtracelog/Makefile | 9 |
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 @@ | |||
1 | ROOT = ../.. | 1 | ROOT = ../.. |
2 | -include $(ROOT)/config.mk | 2 | -include $(ROOT)/config.mk |
3 | 3 | ||
4 | SO = libtracelog.so | ||
5 | TARGET = $(SO) | ||
6 | |||
4 | MOD_HDRS = ../include/rundefs.h | 7 | MOD_HDRS = ../include/rundefs.h |
5 | 8 | ||
6 | HDRS := $(sort $(wildcard *.h)) $(MOD_HDRS) | 9 | HDRS := $(sort $(wildcard *.h)) $(MOD_HDRS) |
@@ -10,16 +13,16 @@ CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' -fstack-prot | |||
10 | LDFLAGS += -pie -fPIE -Wl,-z,relro -Wl,-z,now | 13 | LDFLAGS += -pie -fPIE -Wl,-z,relro -Wl,-z,now |
11 | 14 | ||
12 | .PHONY: all | 15 | .PHONY: all |
13 | all: libtracelog.so | 16 | all: $(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 | ||
18 | libtracelog.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 |
22 | clean:; rm -fr $(OBJS) libtracelog.so *.plist | 25 | clean:; rm -fr $(OBJS) $(SO) *.plist |
23 | 26 | ||
24 | .PHONY: distclean | 27 | .PHONY: distclean |
25 | distclean: clean | 28 | distclean: clean |