diff options
author | Kelvin M. Klann <kmk3.code@protonmail.com> | 2022-05-03 05:47:23 -0300 |
---|---|---|
committer | Kelvin M. Klann <kmk3.code@protonmail.com> | 2022-11-21 17:36:47 -0300 |
commit | adbd02f4213666cf68a455599dc366a840b3ad25 (patch) | |
tree | 309bc6cb59c25b64d45ac32d0a23ac199b784782 /src/libtracelog/Makefile | |
parent | makefiles: deduplicate main target name into new SO var (diff) | |
download | firejail-adbd02f4213666cf68a455599dc366a840b3ad25.tar.gz firejail-adbd02f4213666cf68a455599dc366a840b3ad25.tar.zst firejail-adbd02f4213666cf68a455599dc366a840b3ad25.zip |
makefiles: deduplicate lib makefiles into so.mk
The following makefiles are nearly identical, except for the main target
name and for any extra headers that they might use:
* src/libpostexecseccomp/Makefile
* src/libtrace/Makefile
* src/libtracelog/Makefile
So move all of their (duplicated) code into a new src/so.mk file, and
add an include of src/so.mk, which leaves only variables, and the
includes of config.mk and src/so.mk in place.
With this commit, CFLAGS and LDFLAGS are only defined/changed in the
following files:
* config.mk.in
* src/common.mk
* src/so.mk
Diffstat (limited to 'src/libtracelog/Makefile')
-rw-r--r-- | src/libtracelog/Makefile | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/src/libtracelog/Makefile b/src/libtracelog/Makefile index e272fd77e..bfc5adddc 100644 --- a/src/libtracelog/Makefile +++ b/src/libtracelog/Makefile | |||
@@ -6,23 +6,4 @@ TARGET = $(SO) | |||
6 | 6 | ||
7 | MOD_HDRS = ../include/rundefs.h | 7 | MOD_HDRS = ../include/rundefs.h |
8 | 8 | ||
9 | HDRS := $(sort $(wildcard *.h)) $(MOD_HDRS) | 9 | include $(ROOT)/src/so.mk |
10 | SRCS := $(sort $(wildcard *.c)) $(MOD_SRCS) | ||
11 | OBJS := $(SRCS:.c=.o) $(MOD_OBJS) | ||
12 | CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIC -Wformat -Wformat-security | ||
13 | LDFLAGS += -pie -fPIE -Wl,-z,relro -Wl,-z,now | ||
14 | |||
15 | .PHONY: all | ||
16 | all: $(TARGET) | ||
17 | |||
18 | %.o : %.c $(HDRS) $(ROOT)/config.mk | ||
19 | $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ | ||
20 | |||
21 | $(SO): $(OBJS) $(ROOT)/config.mk | ||
22 | $(CC) $(LDFLAGS) -shared -fPIC -z relro -o $@ $(OBJS) -ldl | ||
23 | |||
24 | .PHONY: clean | ||
25 | clean:; rm -fr $(OBJS) $(SO) *.plist | ||
26 | |||
27 | .PHONY: distclean | ||
28 | distclean: clean | ||