diff options
author | 2022-10-25 15:08:02 -0300 | |
---|---|---|
committer | 2022-11-21 17:37:17 -0300 | |
commit | 3dcc7fa38f065fc1d15d07ed047ec37111379928 (patch) | |
tree | ea2354a46bdb661158c4a7f3e2fb001ad042748b /src/prog.mk | |
parent | makefiles: deduplicate lib makefiles into so.mk (diff) | |
download | firejail-3dcc7fa38f065fc1d15d07ed047ec37111379928.tar.gz firejail-3dcc7fa38f065fc1d15d07ed047ec37111379928.tar.zst firejail-3dcc7fa38f065fc1d15d07ed047ec37111379928.zip |
makefiles: rename common.mk to prog.mk
For clarity, as it is included by the Makefiles that create programs and
non-shared-objects, but not by the ones that create shared objects (see
src/so.mk).
Commands used to move and search and replace:
$ git mv src/common.mk src/prog.mk
$ git grep -IFlz 'common.mk' -- src | xargs -0 -I '{}' sh -c \
"printf '%s\n' \"\$(sed 's/common.mk/prog.mk/' '{}')\" >'{}'"
Diffstat (limited to 'src/prog.mk')
-rw-r--r-- | src/prog.mk | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/prog.mk b/src/prog.mk new file mode 100644 index 000000000..6ec216b46 --- /dev/null +++ b/src/prog.mk | |||
@@ -0,0 +1,28 @@ | |||
1 | # Common definitions for building C programs and non-shared objects. | ||
2 | # | ||
3 | # Note: $(ROOT)/config.mk must be included before this file. | ||
4 | |||
5 | HDRS := $(sort $(wildcard *.h)) $(MOD_HDRS) | ||
6 | SRCS := $(sort $(wildcard *.c)) $(MOD_SRCS) | ||
7 | OBJS := $(SRCS:.c=.o) $(MOD_OBJS) | ||
8 | |||
9 | CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' $(HAVE_GCOV) | ||
10 | CFLAGS += -DPREFIX='"$(prefix)"' -DSYSCONFDIR='"$(sysconfdir)/firejail"' -DLIBDIR='"$(libdir)"' -DBINDIR='"$(bindir)"' -DVARDIR='"/var/lib/firejail"' | ||
11 | CFLAGS += $(MANFLAGS) | ||
12 | CFLAGS += -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIE -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) $(EXTRA_CFLAGS) $(INCLUDE) -c $< -o $@ | ||
20 | |||
21 | $(PROG): $(OBJS) $(ROOT)/config.mk | ||
22 | $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) $(EXTRA_LDFLAGS) | ||
23 | |||
24 | .PHONY: clean | ||
25 | clean:; rm -fr *.o $(PROG) *.gcov *.gcda *.gcno *.plist | ||
26 | |||
27 | .PHONY: distclean | ||
28 | distclean: clean | ||