aboutsummaryrefslogtreecommitdiffstats
path: root/src/prog.mk
diff options
context:
space:
mode:
Diffstat (limited to 'src/prog.mk')
-rw-r--r--src/prog.mk26
1 files changed, 6 insertions, 20 deletions
diff --git a/src/prog.mk b/src/prog.mk
index e4473184f..70b3629b2 100644
--- a/src/prog.mk
+++ b/src/prog.mk
@@ -3,25 +3,11 @@
3# Note: $(ROOT)/config.mk must be included before this file. 3# Note: $(ROOT)/config.mk must be included before this file.
4# 4#
5# The includer should probably define PROG and TARGET and may also want to 5# The includer should probably define PROG and TARGET and may also want to
6# define MOD_HDRS, MOD_SRCS, MOD_OBJS, TOCLEAN and TODISTCLEAN. 6# define EXTRA_HDRS and EXTRA_OBJS and extend CLEANFILES.
7 7
8HDRS := $(sort $(wildcard *.h)) $(MOD_HDRS) 8HDRS := $(sort $(wildcard *.h)) $(EXTRA_HDRS)
9SRCS := $(sort $(wildcard *.c)) $(MOD_SRCS) 9SRCS := $(sort $(wildcard *.c))
10OBJS := $(SRCS:.c=.o) $(MOD_OBJS) 10OBJS := $(SRCS:.c=.o) $(EXTRA_OBJS)
11
12PROG_CFLAGS = \
13 -ggdb -O2 -DVERSION='"$(VERSION)"' \
14 -Wall -Wextra $(HAVE_FATAL_WARNINGS) \
15 -Wformat -Wformat-security \
16 -fstack-protector-all -D_FORTIFY_SOURCE=2 \
17 -fPIE \
18 -DPREFIX='"$(prefix)"' -DSYSCONFDIR='"$(sysconfdir)/firejail"' \
19 -DLIBDIR='"$(libdir)"' -DBINDIR='"$(bindir)"' \
20 -DVARDIR='"/var/lib/firejail"' \
21 $(HAVE_GCOV) $(MANFLAGS) \
22 $(EXTRA_CFLAGS)
23
24PROG_LDFLAGS = -pie -fPIE -Wl,-z,relro -Wl,-z,now $(EXTRA_LDFLAGS)
25 11
26.PHONY: all 12.PHONY: all
27all: $(TARGET) 13all: $(TARGET)
@@ -33,7 +19,7 @@ $(PROG): $(OBJS) $(ROOT)/config.mk
33 $(CC) $(PROG_LDFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) 19 $(CC) $(PROG_LDFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
34 20
35.PHONY: clean 21.PHONY: clean
36clean:; rm -fr *.o $(PROG) *.gcov *.gcda *.gcno *.plist $(TOCLEAN) 22clean:; rm -fr $(PROG) $(CLEANFILES)
37 23
38.PHONY: distclean 24.PHONY: distclean
39distclean: clean; rm -fr $(TODISTCLEAN) 25distclean: clean