aboutsummaryrefslogtreecommitdiffstats
path: root/src/prog.mk
diff options
context:
space:
mode:
authorLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2022-10-25 15:08:02 -0300
committerLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2022-11-21 17:37:17 -0300
commit3dcc7fa38f065fc1d15d07ed047ec37111379928 (patch)
treeea2354a46bdb661158c4a7f3e2fb001ad042748b /src/prog.mk
parentmakefiles: deduplicate lib makefiles into so.mk (diff)
downloadfirejail-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.mk28
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
5HDRS := $(sort $(wildcard *.h)) $(MOD_HDRS)
6SRCS := $(sort $(wildcard *.c)) $(MOD_SRCS)
7OBJS := $(SRCS:.c=.o) $(MOD_OBJS)
8
9CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' $(HAVE_GCOV)
10CFLAGS += -DPREFIX='"$(prefix)"' -DSYSCONFDIR='"$(sysconfdir)/firejail"' -DLIBDIR='"$(libdir)"' -DBINDIR='"$(bindir)"' -DVARDIR='"/var/lib/firejail"'
11CFLAGS += $(MANFLAGS)
12CFLAGS += -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIE -Wformat -Wformat-security
13LDFLAGS += -pie -fPIE -Wl,-z,relro -Wl,-z,now
14
15.PHONY: all
16all: $(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
25clean:; rm -fr *.o $(PROG) *.gcov *.gcda *.gcno *.plist
26
27.PHONY: distclean
28distclean: clean