forked from netblue30/firejail
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
4 changed files
with
28 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Common definitions for making shared objects. | ||
# | ||
# Note: $(ROOT)/config.mk must be included before this file. | ||
|
||
HDRS := $(sort $(wildcard *.h)) $(MOD_HDRS) | ||
SRCS := $(sort $(wildcard *.c)) $(MOD_SRCS) | ||
OBJS := $(SRCS:.c=.o) $(MOD_OBJS) | ||
|
||
CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIC -Wformat -Wformat-security | ||
LDFLAGS += -pie -fPIE -Wl,-z,relro -Wl,-z,now | ||
|
||
.PHONY: all | ||
all: $(TARGET) | ||
|
||
%.o : %.c $(HDRS) $(ROOT)/config.mk | ||
$(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ | ||
|
||
$(SO): $(OBJS) $(ROOT)/config.mk | ||
$(CC) $(LDFLAGS) -shared -fPIC -z relro -o $@ $(OBJS) -ldl | ||
|
||
.PHONY: clean | ||
clean:; rm -fr $(OBJS) $(SO) *.plist | ||
|
||
.PHONY: distclean | ||
distclean: clean |